Live data from Hacker News

The Chaos Programming Language

chaos-lang.org

21–30 of 87 posts

Re: The Chaos Programming Language

#21

From https://chaos-lang.org/docs/11_decision_making > Decision making(a.k.a. control structures) in Chaos language is only achievable on function returns for the sake of zero cyclomatic complexity. ... > At first glance, defining the control structures in this way might seem so unnecessary or inconvenient but this is the pinnacle of writing 100% testable, clean and error-free code in any programming langauge by far.…

I mean yes it's either obviously wrong or hyperbole, I assume the second. But I think the idea is that by forcing each branch in a case to be an separate function they are forced to be unit testable.

But then any more or less complex code that involves conditions will be spread over multiple functions. Even if that makes it testable, it might become incomprehensible very quickly.

Edit: If code needs certain number of conditions, they will be there in this or that form, that cannot be avoided. I would like to see real benefits of their choice in real non-trivial examples.

Re: The Chaos Programming Language

#22
post #11

Earlier quoted context omitted.

I suppose you could explain it that way. But given that it's not an object oriented language, how could any variable be mutable given your example/definition? How could you mutate a variable in a way that this language disallows?

> How could you mutate a variable in a way that this language disallows? I presume something like this: array a = [1, 2, 3] a.append(4) Names are mutable, but the values they point to are not.

I think something more like

    a[0] = 1
Would be a better example. Appending to an array could involve creating a new array and reassigning it to ‘a’.

Re: The Chaos Programming Language

#23
The fact that there are two aliases for each (most?) builtin types immediately turned me off. Maybe there’s a good reason for that particular feature of the language, but I would not throw that at a prospective user in the getting started guide.

Re: The Chaos Programming Language

#25
post #11

Earlier quoted context omitted.

I suppose you could explain it that way. But given that it's not an object oriented language, how could any variable be mutable given your example/definition? How could you mutate a variable in a way that this language disallows?

> How could you mutate a variable in a way that this language disallows? I presume something like this: array a = [1, 2, 3] a.append(4) Names are mutable, but the values they point to are not.

The getting started guide demonstrates that arrays are mutable. https://chaos-lang.org/docs/05_arrays

Re: The Chaos Programming Language

#27

Earlier quoted context omitted.

> How could you mutate a variable in a way that this language disallows? I presume something like this: array a = [1, 2, 3] a.append(4) Names are mutable, but the values they point to are not.

The getting started guide demonstrates that arrays are mutable. https://chaos-lang.org/docs/05_arrays

Yet it says [1]:

> Arrays and the elements of arrays are also immutable

I guess the docs need a bit of rewording. Forcing a deep-copy on variable assignment does not mean the variable itself is immutable.

[1] https://chaos-lang.org/docs/07_immutability

Re: The Chaos Programming Language

#29

As far as I understand after reading the docs for 5 minutes, this section is the core original idea behind the language: https://chaos-lang.org/docs/11_decision_making > Decision making(a.k.a. control structures) in Chaos language is only achievable on function returns for the sake of zero cyclomatic complexity. This looks as original and language-defining as Rust's borrow checker. I really wish authors changed their…

> This looks as original and language-defining as Rust's borrow checker.

I'm not so sure it's original; many compilers work on ASTs whose nodes are a sequence of non-branching operations terminated by a branch. Though people don't use these internal representations as "programing languages" but afaik they technically are.

Re: The Chaos Programming Language

#30
Seems like we have a fellow Chaos Magick practitioner right here. Funny that the creator named the language "Chaos", the module manager "Occultist" and the modules "Spells". Now I can't dislike it even if I found some of the language features quite alien.
Post reply on HN