Live data from Hacker News

The Chaos Programming Language

chaos-lang.org

1–10 of 87 posts

Re: The Chaos Programming Language

#3
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’m skeptical about this claim. I’m not sure I believe 100% error-free is possible in any language.

Can someone please elaborate on this claim?

Re: The Chaos Programming Language

#6
post #2

I can't really find any examples. I wish the homepage showed one. This page shows how to do an add function: https://chaos-lang.org/docs/11_decision_making

Yeah, you have to dig several pages deep into the tutorial before you see meaningful code examples that distinguish it from other languages. This is a mistake that language websites make way too often.

Re: The Chaos Programming Language

#7
post #4

> Every variable in Chaos language is immutable by default. --- > kaos> num a = 5 > kaos> a = 7 > kaos> print a > 7 Doesn't that mean a is mutable by default?

Maybe the REPL behaves different than the interpreter? Haskell REPLs tend to work the same way.

  GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
  Prelude> a = 5
  Prelude> a = 7
  Prelude> print a
  7
But yeah, it doesn't seem like there's any support for first class functions either, so perhaps just a bit too much creative license in marketing?

Re: The Chaos Programming Language

#8
post #4

> Every variable in Chaos language is immutable by default. --- > kaos> num a = 5 > kaos> a = 7 > kaos> print a > 7 Doesn't that mean a is mutable by default?

No, it only means that you can reassign the name `a` to a different value (i.e. it is a variable, not a constant).

It would be mutable if it allowed something like this:

    > a = 5
    > a.add(1)
    > print a
    6
Note that numbers are immutable in most languages anyway. Arrays, hashmaps, and sometimes strings are the data types that are frequently mutable.

Re: The Chaos Programming Language

#9

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.…

If it's impossible to write anything you're guaranteed to not have any errors.

Re: The Chaos Programming Language

#10
post #4

> Every variable in Chaos language is immutable by default. --- > kaos> num a = 5 > kaos> a = 7 > kaos> print a > 7 Doesn't that mean a is mutable by default?

The language at an early development stage. So "How immutable should variables be?" is open to discussion. You might want to open an issue and propose this in the issues section: https://github.com/chaos-lang/chaos/issues
Post reply on HN