Hurl, a terrible (but cute) idea for a language
21–30 of 84 posts
Deja vu, I have been in this place before. Prior art: John Aycock and Mike Zastre. An Exceptional Programming Language. Proceedings of the 2005 International Conference on Programming Languages and Compilers. https://pages.cpsc.ucalgary.ca/~aycock/papers/plc05.pdf
Re: Hurl, a terrible (but cute) idea for a language
#22Does it really need the toss/return syntax to loop? You could use
let loop = func(state, self) {
let next = foo(state);
self(foo);
};
loop(start, loop);Re: Hurl, a terrible (but cute) idea for a language
#23While cute this is really close to call/cc and/or algebraic effects as an abstraction for control flow, which isn't as much "cute" as it is "a powerful way to express programs in as few expressions as possible"
Re: Hurl, a terrible (but cute) idea for a language
#24Fun experiment, but feels like a miss not to then explore the Optional type ideas and eliminate ‘catch’ all together.
Re: Hurl, a terrible (but cute) idea for a language
#25"Hurl" is terribly cute, but I suspect you could be even more successful if you had called it "yeet" :)
Rust already uses that for a similar feature.
https://doc.rust-lang.org/beta/unstable-book/language-featur...
Re: Hurl, a terrible (but cute) idea for a language
#26A few years back I wrote a language called “exceptional” based on some shared ideas. Hurl is super neat and you took things further than I did.
Re: Hurl, a terrible (but cute) idea for a language
#27[deleted]
Re: Hurl, a terrible (but cute) idea for a language
#28While cute this is really close to call/cc and/or algebraic effects as an abstraction for control flow, which isn't as much "cute" as it is "a powerful way to express programs in as few expressions as possible"
Yep! Everyone should read https://overreacted.io/algebraic-effects-for-the-rest-of-us/ for how powerful this can be in practice. The caller gets to pause execution on the raising/hurling of an event - which makes many crazy things possible.
Re: Hurl, a terrible (but cute) idea for a language
#29This is very fun!
I am only making suggestion because it rhymes with "hurl" (and it works well metaphorically for the repeating tossing/hurling): you could introduce a "whirl" keyword or part of the standard library as the way to handle loops.
It could be functionally the same as your loop example but removes the self-referential first argument (i.e. whirl(count, [1,3])).
Re: Hurl, a terrible (but cute) idea for a language
#30If you squint a little, what OP has invented here is pattern matching with algebraic data types.