7 ms·
This is great. Usually with the joke programming languages, you can get at least one person arguing that "x feature" really isn't all that bad, or could maybe b
by tuchsen 3y ago
This is great. Usually with the joke programming languages, you can get at least one person arguing that "x feature" really isn't all that bad, or could maybe be useful. DreamBerd beats them all in that regard. It is 100% terrible! I lost it at the lifetimes implementation.
- occoder 3y agoThis feature really isn't all that bad! > To declare a function, you can use any letters from the word function (as long as they're in order): > function add (a, b) => a + b! > func multiply (a, b) => a * b! > fun subtract (a, b) => a - b! > fn divide (a, b) => a / b! > functi power (a, b) => a * b!
- mysterydip 3y agoWhen I first read this, I thought the function names could only include letters from the word function, and only in order!
- l0b0 3y agoYou must be a fan of Subversion then. On a more serious note, I'm sure I've seen this (any unique shortenings standing in for the whole word) in an actual language at some point, and it was infuriating.
- eps 3y agoIncidentalley this allows for count func (a,b) => ... in out (a,b) => ... of if (a,b) => ... Wonderful language, wonderful.
- wisam 3y agoI don't know, variable decelerations seem to me to be funny but useful. I mean constant constants, constant variables, and variable variables seem useful. I'm not sure how would variable constants be useful. Also, anybody knows the difference between constant constant and immutable data (constant contact constant)?
- ravi-delia 3y agoIn the normal case, Alice can write 'const const true = false' and Bob, on a second machine, can write 'const const true = 7', and there will not be an error. But if Alice writes 'const const const true = false', than Bob can't reassign or mutate 'true' without throwing an error. It's for truly global constants
- nneonneo 3y agoCome to think of it, package registries are sort of “superglobal” in many languages. It’s not entirely far-fetched to imagine a language in which variables themselves can be super-global. Heck, MUMPS global variables are immediately persisted to disk and visible to all other processes - and that’s a real language used in real systems!
- cultureswitch 3y agoIt's a rather straightforward dig at C\C++ which work exactly like this with `const` variables.
- ravi-delia 3y agoBut what elevates it is that it's written so confidently and buries the insane lede so well that at each feature there's a fraction of a second where it seems recoverable before sanity kicks in. After, before, and next almost, almost seem smart
- pmontra 3y agoThis feature is not so bad: > In case you really need to vary a variable, the when keyword lets you check a variable each time it mutates. const var health = 10! when (health = 0) { print("You lose")! } If it can really be triggered when the variable changes to any value it makes it a truly reactive paradigm programming language. By the way, could that be hacked to implement loops? const var i = 10 when (i >= 0) { do_something() i = i - 1 }
- ilaksh 3y agoYeah honestly I was really interested in that. Kind of like a logic language? Maybe Prolog is the perfect language.
- epistasis 3y agoI like this feature, but to really make it pop I would like it to be combined with comefrom control flow.
- pmontra 3y agoYes, when is the way to do loops in this language. From the hidden examples page functi fibonacci (n) => { const var sum = 1! const var i = 0! when (i < n) { sum += sum + previous sum! i++! } } when (i < 10) { fibonacci(i)? i++! }
- ravi-delia 3y agoAnd if you don't want your code to loop back by accident you can just use lifetimes! Truly an elegant language
- Doxin 3y agoOh please tell me you can specify the length of your loops in lines of code executed.
- ravi-delia 3y ago
- skykooler 3y agoI really like the "when" keyword, actually.
- laserbeam 3y agoFeel free to use it today in any language if your debugger supports it. Most do. It's called a data breakpoint/watch point.
- stefncb 3y agoI honestly liked the whitespace significant operator precedence.
- xigoi 3y agoNim used to have that, but unfortunately removed it because it was too controversial.
- myco_logic 3y agoI also quite liked that idea. It would probably be a nightmare to actually use, but it's definitely a creative solution to dealing with infix operator precedence. The only implemented language I know of with this feature is the obscure array lang I (an incrementation of the J language's name I assume) by Marshall Lochbaum: https://github.com/mlochbaum/ILanguage https://github.com/mlochbaum/ILanguage
- hansvm 3y agoAlso lost it at the timed lifetimes :) Infinite lifetime is actually useful here and there. I'll usually slap an infinite lifetime wrapper around the `requests` or `httpx` module when I'm testing out some Python web scraping code.
- cultureswitch 3y agoI think there's a hint of a good idea in the type that checks strings with a regex. Obviously it's comically impractical written that way.
- llimos 3y agoThe 'previous' feature sounds like a great idea! The compiler could even decide which variables it needs to keep track of.
- squeaky-clean 3y agoI think it would lead to a lot of hard to find logical bugs in a lot of projects but I think it would be a great operator in say, a scripting language for a turn based game.
- marssaxman 3y agoI am currently working on a DSL which actually does include a "back" operator! The language is used to describe simulated circuits, so you can inquire about the value a register had during a previous clock cycle.
- matheusmoreira 3y agoI dunno, the previous keyword seemed pretty neat to me.