News for hackers. Stuff that matters.
Re:Six programming languages I’d like to see by patrec on Wednesday July 13, 2022 @12:42PM (#32085176)
> Contracts? how they're different or less verbose than plain asserts? what they do better?

How do you turn asserts into generative tests, or assign blame? Clojure's spec has support the former (https://clojure.org/guides/spec#_generators), racket's contracts have support for the latter (https://www2.ccs.neu.edu/racket/pubs/popl11-dfff.pdf). Also, many popular languages have a pretty broken assert statement (C, C++, python come to mind) which conflates optimization levels or/debugging with assertion support. Rust gets this right.

> What I'd love to see is a language with a first class grammars to replace many uses of regexes or badly written DSL's, like what Perl6 tried to do.

Lua sort of does this with LPeg. There's also https://rosie-lang.org/, which is more special-purpose.

Re:Six programming languages I’d like to see by cestith on Wednesday July 13, 2022 @02:10PM (#32086576)
Perl6 is now Rakulang.

https://raku.org/

Re:Six programming languages I’d like to see by spc476 on Wednesday July 13, 2022 @04:40PM (#32088475)
When I need to parse text with Lua, the first thing I reach for is LPeg. It's great when you can create a standalone expression to parse, say, an IPv4 address, then reuse that in a larger expression. And the data can be transformed as it's being parsed (say, converting a string of digits into an actual integer value).

I have a bunch of Lua modules based around LPeg: https://github.com/spc476/LPeg-Parsers