Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alanvf/red.js-haxe
Temporary repo used while Red.js was moved from TypeScript to Haxe. Please look at the main repository instead: https://github.com/ALANVF/Red.js
https://github.com/alanvf/red.js-haxe
haxe red red-js
Last synced: 22 days ago
JSON representation
Temporary repo used while Red.js was moved from TypeScript to Haxe. Please look at the main repository instead: https://github.com/ALANVF/Red.js
- Host: GitHub
- URL: https://github.com/alanvf/red.js-haxe
- Owner: ALANVF
- Created: 2020-09-18T17:38:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-30T16:36:19.000Z (about 4 years ago)
- Last Synced: 2024-11-15T20:37:44.346Z (3 months ago)
- Topics: haxe, red, red-js
- Language: Haxe
- Homepage:
- Size: 160 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Note: this repository is no longer needed, as it has been moved back to the main [Red.js repo](https://github.com/ALANVF/Red.js).
# Red.js (Haxe)
This is a temporary repository that will be used while Red.js' source is being converted from TypeScript to Haxe.
Main Red.js repo: https://github.com/ALANVF/Red.js
# Why Haxe?
TypeScript is... annoying. It doesn't support nominal typing (even for classes!), lacks real pattern matching, and it's honestly just as unproductive as the language that it's built on.
Haxe, on the other hand, is a very powerful language that not only compiles to JS, but also fixes pretty much everything that I don't like about TS. These things include:
- strict typing
- pattern matching (well, it doesn't have destructuring (yet), but it's otherwise fine)
- real/better tagged unions
- (type-safe) macros
- everything is an expression, which can greatly reduce code size.That being said, Haxe does have a few downsides:
- requires more boilerplate due to its small standard library
- no support for abstract classes (although it's supposedly available in the nightly builds)
- null safety is essentially non-existent (and you can't overload postifx `!` without macros??)
- no array splats (`...`)
- no type refinement/narrowing
- no polymorphic `this` type
- pattern matching extractors exponentially increase codegen (wtf?)
- function overloading is (currently) only allowed for externs
- no untagged unionsDespite these issues, Haxe has been much nicer to work with, and gave me a chance to fix a lot of things that I had originally implemented incorrectly.