The Chaos Programming Language
chaos-lang.org
The Chaos Programming Language
1–10 of 87 posts
Re: The Chaos Programming Language
#2This page shows how to do an add function: https://chaos-lang.org/docs/11_decision_making
Re: The Chaos Programming Language
#3> 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
#4---
> kaos> num a = 5
> kaos> a = 7
> kaos> print a
> 7
Doesn't that mean a is mutable by default?
Re: The Chaos Programming Language
#5Re: The Chaos Programming Language
#6I 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
Re: The Chaos Programming Language
#7> 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?
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> 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?
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
#9From 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.…
Re: The Chaos Programming Language
#10> 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?