Live data from Hacker News

If I were to invent a programming language for the 21st century

wordsandbuttons.online

21–30 of 184 posts

Re: If I were to invent a programming language for the 21st century

#21

> Ultimately this: > FILE * test_file = fopen(“/tmp/test.txt”, “w+”); > Should become something like this: > create file /tmp/test.txt for input and output as test_file > Syntax highlighting should work instead of syntax notation just fine. I couldn't disagree more. The first example is easily scannable visually -- a variable is being created from a function call. I can tell because my eyes immediately notice the mid…

I think the OP perhaps wants to look at Apple Script?

The OP wants a modernized COBOL.

Re: If I were to invent a programming language for the 21st century

#22
post #11
post #3

I read that as: less syntax, less leaky abstractions and less macros; and I mostly agree. I would add better integration with the C tool chain, more separation of concerns and less academic ego bullshit. I've been working on something like that [0] lately. https://gitlab.com/sifoo/snigl

"an embedded Forth with a Lisp in C" :) Sounds like the opposite of what the post is advocating.

Yet it's not; Forth and C are too primitive for most tasks, and Common Lisp too magical. Snigl aims to find a middle way.

Programming languages will always be compromises, you always trade something in to get what you want. Anyone telling you otherwise is trying to sell you a new religion.

Re: If I were to invent a programming language for the 21st century

#24
post #7
post #3

I read that as: less syntax, less leaky abstractions and less macros; and I mostly agree. I would add better integration with the C tool chain, more separation of concerns and less academic ego bullshit. I've been working on something like that [0] lately. https://gitlab.com/sifoo/snigl

I don't agree with 'less syntax'. More syntax (when designed well) results is significantly more readable code.

How much experience do you have from C, Forth & Lisp? Spend enough time in these languages and you start seeing the world differently. Less syntax (when designed well) doesn't have to be unreadable.

Re: If I were to invent a programming language for the 21st century

#25
I'm glad this took a turn because I was not following, AT ALL. But even that last conclusion I only sort of agree with. If they are suggesting Go and Rust and Kotlin bring nothing useful to the table, I suggest they reevaluate. I am way more productive writing Go than C++, Mozilla invented Rust literally to solve concurrency problems, and Kotlin saves you a ton of typing, which speaks on it's own.

Yes there's hype. It's not about hype. It's about exploring permutations of the tried and true. Applying what we've learned. You see a lot of composition over inheritance - not because composition is a new concept, but because we learned how inheritance can be bad. It's that simple.

Re: If I were to invent a programming language for the 21st century

#26

> Ultimately this: > FILE * test_file = fopen(“/tmp/test.txt”, “w+”); > Should become something like this: > create file /tmp/test.txt for input and output as test_file > Syntax highlighting should work instead of syntax notation just fine. I couldn't disagree more. The first example is easily scannable visually -- a variable is being created from a function call. I can tell because my eyes immediately notice the mid…

I agree somewhat, but I think it's important to consider that the ease of reading c-style syntax you experience is probably greatly helped by the wide adoption it's seen of at least some of its features and the repeated exposure you've had to this point, as most of us have.

There is a choice to be made as to whether amateur learning should be optimized (not that their example would be the result), or or a greater tie-in with the existing programming ecosystem should be. Both have their trade-offs, similar to the question of whether we optimize ease of learning or ease of use for experienced programmers (think BASIC vs APL).

Re: If I were to invent a programming language for the 21st century

#29
post #7
post #3

I read that as: less syntax, less leaky abstractions and less macros; and I mostly agree. I would add better integration with the C tool chain, more separation of concerns and less academic ego bullshit. I've been working on something like that [0] lately. https://gitlab.com/sifoo/snigl

I don't agree with 'less syntax'. More syntax (when designed well) results is significantly more readable code.

Up to a point, perhaps. Say you have both `if` and `unless` control structures. Two keywords where you could have just one, but they're closely related enough that there's not much burden. But what if their grammar was completely different, like say:

    ifStmt := "if" "(" expression ")" statement ( "else" statement )?
    
    unlessStmt := "{" exprStmt exprStmt* "}" "unless" expression ";"
I doubt this additional syntax would be a positive for the language's user. And the divergence will almost certainly make implementation changes more difficult. If we had instead:

    ifStmt := "if" "(" expression ")" statement ( "else" statement )?
           |  "unless" "(" expression ")" statement
           
This smaller amount of syntax is easily understood, increases expressibility, and `unless` will most likely be implemented as simple sugar, just a negation of the expression in an `if`.

There's definitely some sweet spot in the middle, taking scan-ability and symmetry both into account.

Re: If I were to invent a programming language for the 21st century

#30
post #4

Really, this is worse? FILE * test_file = fopen(“/tmp/test.txt”, “w+”); than create file /tmp/test.txt for input and output as test_file Yeah, remove the ; and duplication of type: let test_file = fopen(“/tmp/test.txt”, “w+”)

or remove any declaration syntax altogether!

    f = open("/tmp/test.txt", "w+")
Post reply on HN