IMHO, I’m gunna say a dictionary of lambda functions is distinctly in this subject area.
I remember being pleased to see that suggested as a solution here, back in 2021.
IMHO, I’m gunna say a dictionary of lambda functions is distinctly in this subject area.
I remember being pleased to see that suggested as a solution here, back in 2021.
This is pretty much a perfect illustration of doing better, with better code.
C developer - Leap Years.
Haskell developer - Leap Years.
(explaining the use of gcd … What does GCD have in common with leap years? :: Palaiologos )
I would take the “lame” implementation above anything else on any day - and when I use a half-decent compiler it even turns the code into some reasonably fast operations.
I don’t know what that means. TEnumerable.Select<X,Y>
transforms an IEnumerable<X>
into an IEnumerable<Y>
using the given function.
Discussing Tuples, and Sum Types, on ADSP The Podcast episode 100. (7 min)
Conor Hoekstra & Bryce Adelstein both work for nVidia.
Bryce is the ISO chair for the Language Evolution Group of the C++ Committee.
Conor has a wide appreciation of languages, and in particular loves the array languages eg APL, BQN, Uiua, …
C++ is getting ‘Senders and Receivers’ in C++26.
Sean Parent, loooong time Adobe c++guru, tries to recreate the idea in a simple way - and it is a very functional flavour.
He also describes a similar approach used to implement Adobe Lightroom for mobile and tablets.
Continuation Passing Style at Google, instead of iterator-based Ranges, for code safety and efficiency.
Erik Meijer (Microsoft) on creating LINQ. YouTube date says 2019 ???
Audio is pretty bad - I assumed it was from much earlier.
Episode 72: Erik Meijer on LINQ
[1:10]
"I think since the first time one of my friends in high school tried to explain to me, you know, that x = x+1 in trs-80 basic, you know didn’t mean you know x EQUALS x+1 but x BECOMES x+1, I’ve been intrigued with programming languages. I’ve been on this quest to make programming accessible since then, moving from, I don’t know - I started out doing Prolog, and SESOL?, Miranda to Haskell, and now I’m doing Visual Basic and C# so, so it’s I’ve been everywhere.
That sort of sounds like you’re working for Microsoft.
That’s true.
Okay um so you’re you’re sort of, your brainchild the thing you’re working currently, working on right now, is is LINQ.
I heard about that I mean that’s why we’re talking here. What is LINQ? What is, what is it about?
Ok so LINQ, it’s an abbreviation of Language Integrated Query, and the goal of LINQ is to enable kind of easy querying and manipulation of kind of in all forms of data in, you know, any dotnet language. The way we achieve that is by importing ideas from functional programming, in particular Monads and Monad Comprehensions, to kind of unify all the different data models.
So you know often people kind of you know emphasize the differences between data models - like XML, SQL, AltX(?) and then so they they are all very different but the trick is that if you all view them with your monadic, you know, glasses on they are really similar - and that kind of allows us to define one query language that you can use to query over these different data models.
That sounds really great um could you tell us a little more about what these common abstractions are? How you actually go about treating them all the same.
Sure, I can do that. So if you think about data, like all these data models have elements that are like, say in relational data, are these rows, and tables are collections of these rows. If you think about XML, you have elements and attributes. Elements contain sequences and collections of child elements and attributes. And similarly in Object(?) you have a lot of different kind of container types like arrays and lists and so on.
So all these notions of collections are very similar, and if you define a set of operators that can say filter and apply a function to each element of a collection, and you know sort collections, group the elements into […] partitions, all these kind of operations - are really, you can define them independently of the specific collection.
In some sense it’s nothing more than using interface-based programming. So we define you know in a specific interface, and that all these different kind of collections implement, and then the queries are defined in terms of that interface and so really you know you can view it, you know, using […] complicated mathematics … the other hand you can say we’re just using common sense object-oriented principles. You know, you define an interface - all these types implement that interface, and then you can define your functionality on top of interface without having to know the underlying implementation. Does that make sense?
Yeah, that sort of makes sense but well I’m playing devil’s advocate a little - um, there are certain differences between let’s say XML and SQL. XML is hierarchically structured, SQL is sort of a global data pool that you just query, where you can start at any point and sort of just follow the relations any direction. How do you treat that the same?
[6:00]