Non-nullable types, tagged union types, and easy declaration file acquisition are definitely the biggest wins for me with this release.
Non-nullable types, tagged union types, and easy declaration file acquisition are definitely the biggest wins for me with this release.
Edit: I realize you mean Typescript, my apologies
Non-nullable types, OTOH, might just be the thing that makes me start using TS, despite my love of dynamic typing.
I've come to the conclusion that "mandatory and immutable" should be the default, but there are precious few languages in which that is the case, rather than some noise words that have to be plastered all over. (the noise words should be something like "dont_know_when_or_if" and "whacked_whenever_i_feel" for optional and mutable to make you cringe when you use such a local/parameter/return-value.
It's always funny (funny-sad) to read a project or a research paper that discovered "static types turned out not to catch as many errors as we thought it would".
We've made our turing tar pit, now we have to live in it :-(
... at least until we push the whole C-and-its-spawn edifice over the cliff.
Enter the XML config file... :-(
I ranted quite a bit lately about partial function application as well, but it's not appropriate for everything. But when when you're dealing with a crowd that has no idea that there are other ways of doing some things...
And partial application is never necessary. It's elegant and useful, and can save you a bit of typing, yes, but it's never needed. It's nice to be able to type:
map (+ 3) a-list
but I don't mind: (map (lambda (x) (+ x 3)) a-list)
and in most Schemes, there's a macro called cut, which means you can do this: (map (cut + <> 3) a-list)
Which is almost as nice as the first one, and works regardless of the position of the arg you want to apply.And it's no so much that the crowd doesn't know that there are other ways of doing things, it's that they reject them out of hand, because they're different.
Can you attach a property list to a function in Scheme? If so, maybe you could make a way for properly prepared functions to have an "apply" property. (like I said, it's been a LONG time since I did Lisp)
Then again, I don't totally understand your system, so I might just have gotten it wrong...
The first line looks odd to me, since there are just 3 expressions sitting there - no parens around map and the rest of the stuff. My ignorance is showing :-(
... but I don't want to write Java <= 7 style inner classes, either. I'll likely get a bad case of COBOL-fingers.
Instead, the first line is Haskell, the best-known language to support that particular feature. I personally dislike it, but if you're demonstrating partial application, it's the language to do so.
And in case you haven't realized it yet, Java is actually the new COBOL: Verbose, ugly, and very popular in industry.
I never saw any Simula 67 until VERY recently. Hmm. So its what Borland patterned Turbo Pascal 5.5 (and beyond) after, more or less. And Eiffel, as well. But the MIS industry keeps trying to rehabilitate a portable assembler for general application programming (C, C++, Java, ???)
Don't get me wrong, as a language I will defend C to the very end (C++ and Java, not so much), but it has a specific usecase: Low-level code, or code where you absolutely need the performance. If you're not in either area, stop. You shouldn't be using C. And, of course, Rust has been eating some of C's lunch of late...
One good thing about Unix is, the creators intended for things to be stitched together as insulated building blocks, NOT to be built as monolithic C programs (at least as far as I can tell). OK, I'm really off on a tangent now. Have a nice day :-)
Unfortunately that's something TypeScript doesn't tackle, but you can use external libraries for floats, where you work on floats as... strings.
You knew that, but I'm just spelling it out for others.
https://github.com/roboprog/nashorn_play/blob/master/script/...