The language itself looks decent enough, but what's the compelling reason for using this rather than one of the many other languages? I'm sure there must be one, scratching a personal itch aside, but at least tell us about the rationale.
I don't think 1970 is much of a filter.
That's pretty much the same as saying "doesn't clash with a language since the beginning of time".
It's literally the "beginning" of Unix time, which most systems use.
I would welcome lambda syntax in JS, you can sort of just be strict with yourself, but it takes more effort to _read_ when something is a lambda but you have to manually parse it to be sure.
I find it very useful to know that all variables in the expression are bound, expressions with free variable can be more complex to reason about, which is fine, but it would be nice to be able to easily differentiate without having to carefully parse each expression first - so a separate syntax just for that purpose would be nice - I thought that's what true lambda functions were (disallowing free variables), but it looks like i'm wrong, i guess that feature doesn't exist.
"9" + 2 # ==> 11
"9" ++ 2 # ==> "92"
If + is to be defined on a string and a number then the only sensible meaning is string concatenation. All numbers can be converted to strings but most strings cannot be converted to numbers.
The same result as `convert_to_number("badger") + convert_to_number(2)`. In Z it seems that converting an invalid string to number yields NaN, so "badger" + 2 returns NaN.
++ is for concatenation.
+ is for arithmetic.
Coercion or not, it's always puzzled me when languages used the same symbol.
I guess they're both associative and have identity values, but that's about it. One is commutative, the other is not.
* makes about as much sense for concatenation as +.
It lacks some features of Z, from a cursory glance, for example there's no `match` construct, but it packs most of the features around function currying, piping values, destructuring inputs, composing and so on into a indentation based, low-noise syntax. Syntax preference is of course a personal thing; I prefer the LS one. I've been using LiveScript on and off for years, starting back in the CoffeeScript days on the frontend, then with node, and most recently for Tizen programming. The language is on life support for many years now, meaning no new features - last addition were generator functions - but the feature set is still ahead of JS. There's a bit of an uncomfortable feeling when using constructs like let and const, which compile to very different things than what you get in ES, but well, they were implemented in LS first, so it's understandable.
I may consider Z next time I have a chance, if it's actively maintained and developed. JS may have become a better language, but it's not optimized for functional-first programming - there's no escaping the verbose syntax and the malnoutrished stdlib. It may look like it is, but that's only in comparison with Java or PHP - if you put it beside OCaml and Elixir you'll see it sticking out like a sore thumb. Which isn't bad, of course, JS is a multiparadigm, general-purpose language and it has huge amounts of backward compatibility - with both code and human minds - to uphold. Still, if you want FP-only, it's easier to use another language instead of trying to bend JS almost to the point of breaking with still subpar results.
> Z also has the ternary operator, though it's syntax is more readable than most programming languages:
I’m kind of a fan of the very terse ternary, I personally don’t feel like
X = if cond1 value1
else if cond2 value2
X = cond1 ? value1 : (cond2 ? value2 : value3)
That said, readability seems like a weak argument and always prone to subjective debate. For the last several jobs I’ve had we used auto-formatters and have completely gotten rid of stupid programmer debates about readability.
> The first thing Z clarifies is that Exceptions are not baseballs. For some reason, rather than "raising" an issue, you would "throw" it. That makes no sense at all.
FWIW, this text is off-putting, it’d be better to just describe the syntax Z uses without the incredulity. This feels like a titch of bike-shedding. The big problems with exceptions have nothing to do with the keywords and everything to do with the design. That said “settle” feels weird and it’s also going to be potentially confusing when you try to add a “finally” block, or a re-raise semantic.
> If you forget to settle an error, Z will throw a runtime error.
Should that be “Z will raise a runtime error”?
"First off, the import statement is clutter. Why can't the text function be built-in, perhaps?"
I think that every new language should show one thing that the language can do well, wheres other languages can't; in other words, we need motivating examples. I've always having a trouble figuring out why a language was created in the first place.
If the platforms succeeds, the language is deemed to success and eventually outlive the platform.
Anything else is kind of yet another programming language.
LiveScript came after Web as platform was being adopted.
.NET was created to replace COM (did not went accordingly as planned), with VB, Java and C++ on board, with support for multiple languages. C# came later given the outcome of the Sun process.
Using Ruby outside Rails development is not so common.
Younger Python developers might not be aware of this, but there were only two reasons to pick Python on the late 90's, either one disliked Perl and wanted something else, or had to deliver Web applications in Zope.
>x: "Hola Mundo" # ==> x has changed types
One of the biggest complaints people have about JS is the lack of strict typing. So, this doesn't appear to solve it.
Inversely, one thing a lot of older JS people dislike (I'm an older JS person, but this doesn't apply to me) is how functional JS is getting, so I don't think this will be very popular with that crowd. Especially considering how many features are being added via the ecmascript proposal process/babel transpiration (eg: https://github.com/tc39/proposal-pipeline-operator)
Ex: Web server in 5 lines, or super simple matrix manipulation.
Side note: how does this compare to other languages that tote cross-compiliation to JS (Haxe, Nim, ReasonML, js_of_ocaml, TypeScript, etc.)?
I do think it's interesting to compare Go-style green threading with JS-like async/await syntax. The main question is: are Z threads cooperative (as in JS) or preemptive (as in Go)?
Why do they have to put a dig to other languages in the opening paragraph?