797 karma · joined March 14, 2010
New Programming Language https://civet.dev
Apps for everyone https://glitch.com
Zine based operating system https://whimsy.space
Pixel editing community https://pixieengine.com
Email me: daniel@danielx.net
Types help quite a bit with implicit returns so you don't accidentally return an iteration results array from a void function.
They also help reduce the downsides of terse syntax, just hover over things in the IDE and see what they are. Missed a step in a pipeline? The IDE will warn you if there's a mismatch.
[1]: https://civet.dev
tag Box
css pos:relative
x = 0
y = 0
<self[x:{x}px y:{y}px] @touch.moved.sync(self)> <slot> "box"
tag app
<self[inset:0 d:hflex ja:center]>
<Box[hue:blue]> 'One'We've added https://github.com/tc39/proposal-pipeline-operator, a variant of https://github.com/tc39/proposal-pattern-matching, a variant of https://github.com/tc39/proposal-string-dedent and others.
Since our goal is to be 99% compatible with ES we'll need to accommodate any proposals that become standard and pick up anything TC39 leaves on the table (rest parameters in any position, etc.)
- Rest in any position
- Dedented block strings
- Default to const in for loops
- Lack of -> function shortand
- Everything is an expression
- Implicit returns
- Chained comparisons
- Nested unbraced object literals
- Optional trailing commas in arrays
- Optional trailing commas in objects
- x.map .name function shorthand
Each one is a fairly minor concern but they all add up. I'm sure different people will have a different list of favorite features as well. One of my goals in creating Civet was to fix my top 100 issues with TS syntax while being 99% backward compatible. The ultimate goal being: TS with my top 100 issues fixed will be the best language I have ever used.
The difficult part for TS/JS is they can't easily opt into some of the more whitespace/context sensitive features without breaking changes to existing code or forcing people to opt in with a "jsNext" directive or something.