I'm afraid that a language that was an agglutination of features of those three languages would be horrible to work with. Omitting features that aren't pulling their weight is key in making a good language. My instinct is to prefer a language with a minimal and orthogonal feature set. Tastes differ and some languages have a good reputation despite putting in all the bells and whistles (C# goes against all my minimali…
Ask HN: What would be your “perfect” programming language?
81–90 of 182 posts
Re: Ask HN: What would be your “perfect” programming language?
#82- One executable that is the runtime, accepting one argument: the source code file. - No linters. Code is auto-formatted. - No modules. Includes can be namespaced/aliased. - No package manager. Include by Git URL with tags. - No type annotations. Automatic type-checking. - No user-defined types. A few good types is better. - No null. Set membership with maps is better. - No exceptions. - No loops. List and map compre…
> - Terminating. All programs terminate. How are you side stepping an NP-hard issue like the halting problem?
Datalog is terminating. Programming languages don't have to allow infinite loops and recursion. There are plenty of ways to ensure recursion is terminating, like structural recursion or only allowing recursing finite data structures.
Re: Ask HN: What would be your “perfect” programming language?
#83- One executable that is the runtime, accepting one argument: the source code file. - No linters. Code is auto-formatted. - No modules. Includes can be namespaced/aliased. - No package manager. Include by Git URL with tags. - No type annotations. Automatic type-checking. - No user-defined types. A few good types is better. - No null. Set membership with maps is better. - No exceptions. - No loops. List and map compre…
> - No user-defined types. A few good types is better. > - No higher-order functions. I'm not creative enough to understand how you can do anything useful without these 2. Can you clarify?
Re: Ask HN: What would be your “perfect” programming language?
#84- One executable that is the runtime, accepting one argument: the source code file. - No linters. Code is auto-formatted. - No modules. Includes can be namespaced/aliased. - No package manager. Include by Git URL with tags. - No type annotations. Automatic type-checking. - No user-defined types. A few good types is better. - No null. Set membership with maps is better. - No exceptions. - No loops. List and map compre…
> - No user-defined types. A few good types is better. > - No higher-order functions. I'm not creative enough to understand how you can do anything useful without these 2. Can you clarify?
Re: Ask HN: What would be your “perfect” programming language?
#85- One executable that is the runtime, accepting one argument: the source code file. - No linters. Code is auto-formatted. - No modules. Includes can be namespaced/aliased. - No package manager. Include by Git URL with tags. - No type annotations. Automatic type-checking. - No user-defined types. A few good types is better. - No null. Set membership with maps is better. - No exceptions. - No loops. List and map compre…
> No package manager. Include by Git URL with tags. Go does exactly this (`go.mod`), and it turns out it still needs a package manager, just simpler. One of the reasons: diamond dependency problem.
This can be completely transparent to the user. There's no need to have a separate program do dependency resolution when dependencies are referenced in source code. Instead we have the complete waste of life that is package manifests and shared libraries.
Re: Ask HN: What would be your “perfect” programming language?
#86The germinating thought was remembering the frustration of having to choose between abstraction and performance. Sure, there are languages out there that do address this generally mutually exclusive dual to some degree of success. But there are other duals out there: {semantic-clarity and concision}, and, {effectiveness, and cognitive-load}. And the existing solutions to the first dual generally don't do so well, imho, in the other dimensions.
So my "perfect" programming language would have to:
- allow the programmer (henceforth me) effective abstraction capabilities, in the sense of what the language is used to define and describe, while also allowing for practical high performance implementation.
- have excellent semantic-clarity so the poor me who has to read code more than writing it gets a break. But who wants to read War and Peace to understand how a subsystem works? Not me.
- be effective. Get things done, and have the above two qualities. But I'd rather not have to carry some monsterous mental model in my head. That can hurt. /g
So how do we get there?
We already know a lot about tricks to make abstract code fast. So a ~near possibility that I foresee is either teaming up with, or borrowing the knowledge and tool base of, cognitive sciences to get a handle on things like semantic-clarity and cognitive-load. PLT designers will need to -start measuring things-. At some point we need to start measuring cognitive load of languages as we design them, and to do that we also need a bit of help from AI (D/ML) ("cheating", "not art", "not computer science"? :) so this feedback loop can be hugely sped up.
So first we need to have measures, actual physical measurements of a sample of end users, with existing languages and tools, up to operating and debugging software systems. At this point we'll have numbers to for example compare the cognitive load of Rust vs Go. Stuff like that. We feed that data to our DL model. That model then is expected to furnish what it thinks of your shiny new language. At that point, the PLT designer first defines the characteristic measures (of those duals), and possibly let say start from an existing language, and then have our friend AI go at it.
What will they look like? Hopefully we live long enough to see.
p.s.
fair to say to get this off the ground (measuring and creating the model) requires DARPA level research effort.
Re: Ask HN: What would be your “perfect” programming language?
#87Earlier quoted context omitted.
> Push the concurrency and distribution machinery into the language runtime. Developer can neither see nor influence it. This is completely unworkable. It's based on the assumption that nodes have zero failure rate and networks have zero latency and packet loss and infinite bandwidth. Distributed system programming is hard because you want to control the failure modes of your system as closely as possible. The opposi…
It's based on the assumption that node and network failures can be detected (with a performance cost) and unobservably healed around. It's also assuming that the runtime can make a good enough guess at when the ratio of data size to compute time for a task makes distribution profitable. Distributed systems programming is indeed hard. That's why I want it pushed out of my applications.
...which is false, especially on large scale systems. Unmanaged cascading failures are the kind of thing that caused big downtimes in various FAANGs many times.
> Distributed systems programming is indeed hard. That's why I want it pushed out of my applications.
Companies hire good software and system engineers to do this stuff.
Re: Ask HN: What would be your “perfect” programming language?
#88- Guarantee 8-bit byte and twos complement
- No undefined behavior. All behavior is defined even if the ramifications of that behavior are not. Use after free? The data in the memory location is written-to or read-from, not omitted by compiler, and programmer is responsible for the second- and third-order effects thereof. Signed integer overflow? You get the assembly ADD instruction for your platform/data width and see what happens.
- Fixed width integers. int8_t == short short int. int16_t == short int. int32_t == int. int64_t == long int. int128_t == long long int.
- char is by default always unsigned.
- byte type similar to unsigned char but requires explicit cast.
- Anonymous functions well-supported.
- A method keyword inside a struct defines a function pointer to an anonymous function with the signature and definition that follows.
- New operator --> such that x-->y(...) is equivalent to y(x, ...) (perhaps with additional error checks)
- Arrays no longer degrade to pointers but to fat pointers with an aligned prefix sds-style. Argument syntax for an array/fat pointer is arg[..]
- char type used alone is deprecated
- string type is an array/fat pointer of type char[..]
- str* functions deprecated; now that unique identifiers can use more than the first six characters, use string* functions instead
- "C" locale defined as using UTF-8 normalized to NFC
- Conforming change: allowable main() signatures include int main(string argv[..])
Re: Ask HN: What would be your “perfect” programming language?
#89I would want something like C++/Typescript/C#/Python, but only the good parts. - Multiparadigm, that means traditional OOP, but also first class functions (well first class everything) - Compiles to native code, runs relatively fast - Designed from the ground up for async/await - No undefined behavior - Statically typed, but with the feeling that the compiler is helping and not punishing you. I get that feeling from…
Why async/await? As go and soon java with loom shows it is quite a misfeature, if anything. Otherwise, I like your idea on checked exceptions, I think they are a very good feature, but somehow got a bad name and thus not experimented with as often. Your last point sounds quite macro-ish, so I guess the LISP-fanatics will come in in droves and tell you that they already have that in their language :D But relatedly, tr…
I can see the problem in js with 'function color' but everything in Go are goroutines not just some.
Re: Ask HN: What would be your “perfect” programming language?
#90Strongly typed Elixir would be it. Even better if it can be gradually typed like Typescript. Jose announced that they are working on it but I can’t wait :p
Elixir is already strongly typed (e.g. I think you can't use a number where a string is needed and doesn't automatically coerce).
I'd also like higher performance numerics in Elixir.