Earlier quoted context omitted.
Not being familiar with LINQ, does it solve SQL's composability problems? I love SQL for what it can do, but I am constantly annoyed at how inconsistent it is and how terrible it is for generating queries via software. It feels ripe for a replacement that is semantically similar but syntactically different.
LINQ is a library & C# language syntax that call this library thats allow to write SQLish like query on your C# objects.
Ask HN: New Programming Language?
81–90 of 99 posts
Re: Ask HN: New Programming Language?
#82Earlier quoted context omitted.
D (the Date And Darwen one, not the Walter Bright one)? https://en.m.wikipedia.org/wiki/D_(data_language_specificati...
Thanks, I didn't knew about D (I did little to no research on other languages yet). I will read it, but mind that, I said "general purpose" I don't want this to be a language used to be only used as a Database. The whole app should be written in it.
A major point of D is to eliminate the object-relational impedance mismatch and the app language/SQL boundary by providing one language for app and database that is truly relational.
That said, I think most of the implementations (other than as libraries for existing languages, which is kind of a different thing) have ecosystem problems from not being popular, so even if they are “general purpose” languages, there's probably a heavy loft for lots of common tasks compared to languages with richer ecosystems.
Re: Ask HN: New Programming Language?
#83Earlier quoted context omitted.
LINQ is a library & C# language syntax that call this library thats allow to write SQLish like query on your C# objects.
I'm familiar with what it does (conceptually), but what I want to know is: Is it composable? Eg if I have a query and I want to add an additional filter to it, or I have a select that I want to turn into an update, is it straightforward? SQL syntax tends to make this kind of query generation difficult (though obviously not impossible).
You can add filters, groups, order, as much as you want, because each will return an IEnumerable (some methods return a child interface, like Order, which return an IOrderedEnumerable).
Then, you consume this this enumerable, most of the time with a foreach (procedural, or LINQ style, and will consume the enumerable), where you can update the values.
In the end, it's still C#: you can add side effects, where you want, even in the select, even if you shouldn't.
Most of the times, "when it tends to make this kind of query difficult" you can just consume your query with a foreach, and do the rest with the procedural style.
Re: Ask HN: New Programming Language?
#84Earlier quoted context omitted.
I'm a C# dev, I know well LINQ. LINQ has multiples issues compared to what I want to do. It's slow (at leat 1000x slower than a for loop) There is no query optimizer by default, and even less a runtime query optimiser. It's directly translated to procedural code, it doesn't get compiled and translated like a query engine will do in an SQL DB.
I’m far from a C# expert, I just happen to write some at work but that’s not my predilection language so you probably know better than me but, implementation appart, as a querying language, it feels pretty good. Also, I understood that it was translated to IEnumerable queries, so, wouldn’t EF optimize the query ?
Re: Ask HN: New Programming Language?
#85My dream feature would be for an interpreted language: when you start the program the interpreter would randomly choose one of the keywords in the language to be considered "hot lava", meaning when the program encounters that keyword the computer running the program would be shut down permanently. If this language were universally adopted it would only be a matter of time before all computers were rendered inoperable…
That certainly would be good for the environment.
Re: Ask HN: New Programming Language?
#86That, or if we assume a few more years of speech recognition gets us to rock solid ASR, then a language designed from the ground up with speech as the input in mind, not the keyboard. I lost my ability to type temporarily, a while ago, and this idea has fascinated me since. I think new kinds of graphical “languages” could become more viable with ASR in mind.
Those, or a language that lets you express pipelines better. My typical pipelines at work involve many programs run on different machines. ETL some data with a spark cluster, save it to “memory” aka S3, train a model on a GPU, save it too, then deploy a service. Imagine if five line ‘main’ function in any program had to be split into five files plus a DAG declaration, and to access the state you had to refer to memory addresses by name. And you had no solid linting/type checking/etc across it. That’s the state of pipelines today.
Re: Ask HN: New Programming Language?
#87Re: Ask HN: New Programming Language?
#88Merge the concept of type and variable (name) in simple functions:
To assign a photo to a contact: contact.image = photo
Here both photo and contact act as matching types and as variable identifiers.
2. 'that' lambda filter
files that exist =>
files.each.filter(it.exist) or
files.each.filter(file=>{file.exist})
3. of keyword : reverse properties title of book => book.title
4. indexing with '#'
Colors = [red, green, blue] Color#1 is red
(zero based indexing can still be done via [] if desired
5. universal in-place assignment
Each operator automatically works with assignment: x ⊛= b is always a shorthand for x = x ⊛ b.
6. universal broadcasting
All functions are automatically broadcasting on lists and pair values:
square number := number * number square [1 2 3] == [1 4 9]
Re: Ask HN: New Programming Language?
#89Some ideas... Language that represent numbers as rationals and always gives you precise calculations (unless you explicitly want to round them up). Language that can tell apart 1 meter from 1 second (units like in Frink lang). Language that has various data structures with consistent interface (like Scala) up to and including relational tables and graphs. That has structural composable declarative query language that…
>> Language that represent numbers as rationals
so π would be represented as π/1 or τ/2?Also wouldn't it make comparisons quite expensive?
Re: Ask HN: New Programming Language?
#90Some ideas... Language that represent numbers as rationals and always gives you precise calculations (unless you explicitly want to round them up). Language that can tell apart 1 meter from 1 second (units like in Frink lang). Language that has various data structures with consistent interface (like Scala) up to and including relational tables and graphs. That has structural composable declarative query language that…
>> Language that represent numbers as rationals so π would be represented as π/1 or τ/2? Also wouldn't it make comparisons quite expensive?
Instead od Pi I'd prefer to have Pi(3) equal exactly 3.14, or Pi(2) equal exactly 3.1 and so on.
Since numbers would be kept as smallest numerator, denominator pair comparison would be just compaing those.