Comments (19)
I'm working hard to finish the MVP this year, but I'm not sure.
from hegel.
Hi @hazelTheParrot. Sure, I started working on it, and hope (not sure about the October), but we will present MVP soon, with a pretty cool news.
from hegel.
No, currently it is in separate Repo because it will be rewritten from scratch.
from hegel.
Idea: make it compilable to WebAssembly! Is there an opportunity to work with @dcodeIO from AssemblyScript perhaps? Maybe Hegel can generate ASTs (in a way that doesn't have the downside of TypeScript transforms), and AssemblyScript can use them to map to its Wasm output?
@dcodeIO Do you have a list of all the downsides you experienced when trying to make AssemblyScript on TS transforms?
from hegel.
Hi @texastoland,
I planed to implement the MVP in September/October of this year.
from hegel.
It will be a superset of the first version, so it will have backward compatibility.
from hegel.
Thanks for the links.
WASM and JS use the same optimizing backend. You can manipulate both to get similar results.
Also as I mentioned some runtimes (builtins) methods / classes like string concatenation you can't speedup at all.
My guess is this JS code is just as fast. Benchmark this on V8 and/or JSC, two compilers that can inline and interleave generators into other code.
function toList(arr) {
for (let i = 0; i < arr.length; i++) {
yield* arr[i];
}
}
Either way, if you want a fast compiler, it comes from writing a character-by-character streaming compiler and avoiding IRs and complex data structures whenever possible. You can do that in any language.
from hegel.
@JSMonk started working on Kotlin (congrats!) so probably delayed
from hegel.
from hegel.
For projects, how compatible is it with v1?
from hegel.
WebAssembly is not magic performance pixie dust.
from hegel.
@CrazyPython It very depends on task. See another examples:
https://github.com/acutmore/type-off
https://twitter.com/matthewcp/status/1390013392950284291
https://github.com/MaxGraey/as-string-sink#benchmark-results
btw issue with growing array already fixed
from hegel.
AssemblyScript influences you to write faster code, but you can write the same fast code in JavaScript, if you know what to avoid.
from hegel.
but you can write the same fast code in JavaScript, if you know what to avoid.
That's not really true. Ofc you could do something like this in theory. Or you could use d8/chrome with --trace-deopt
to figure outing de-optimizations paths and polymorphic code but this really hard. Also as I mentioned some runtimes (builtins) methods / classes like string concatenation you can't speedup at all.
And last but not least WebAssembly will support SIMD soon (after Chrome 91, FF 89). JavaScript will never support SIMD. SIMD.js was frozen
from hegel.
WASM and JS use the same optimizing backend. You can manipulate both to get similar results.
Yes and no. First of all JS hasn't some operations like popcount
, ctz
, rorl
, rotr
per-bit reinterpret int to float and vice versa. See how this affect to performance. The reason is very simple. Also turbofun have special optimizations only for wasm backend which not yet enabled. Like this one: https://bugs.chromium.org/p/v8/issues/detail?id=11298&q=unroll&can=2. And still not apply some important optimisations for i64/u64: https://bugs.chromium.org/p/v8/issues/detail?id=11085&q=wasm%20optimize%20i64&can=2
Also JS compiler has a fairly limited time for sophisticated optimizations in graph IR while LLVM / Binaryen can spend much more time for advanced analysis and optimizations
from hegel.
Or you could use d8/chrome with --trace-deopt to figure outing de-optimizations paths and polymorphic code but this really hard.
Not really. It's just a simple matter of benchmarking different approaches and finding the right one.
First of all JS hasn't some operations like
popcount
TurboFan can nonetheless generate it.
--enable-popcnt (enable use of POPCNT instruction if available)
type: bool default: true
I doubt the examples you named– loop unrolling, popcount– are common at all for a typechecker like Hegel.
Some optimizations are JS-only, that would require manual code in WASM.
from hegel.
Seems like that discussion got really off-topic. @JSMonk How long do you anticipate until a v2 beta?
from hegel.
"I planed to implement the MVP in September/October of this year."
How is the progress? Soon october now. So a v. 2.0 will be released when?
from hegel.
don't mean to rush you and I know estimates are hard. Do you think it'll be sometime this year?
from hegel.
Related Issues (20)
- Allow optional property syntax, similar to typescript with key?: value HOT 5
- Do not expand types for mutually recursive functions HOT 1
- Unable to call super in subclass HOT 1
- Comment support? HOT 1
- Cannot read property 'getValueType' of undefined HOT 2
- Expose $StrictUnion and similar types as generic HOT 1
- Demo 2 is not compiling with TypeScript 4.2.3
- Relational operations should inferred for string as well HOT 2
- Allow function covariance/contravariance
- Inference from pattern matching HOT 7
- The object required is inferenced as unknown
- Cannot read properties of undefined (reading 'type') HOT 11
- Excess property checks for destructured arguments HOT 8
- Old school classes are not supported
- Project status HOT 2
- Mention another benefit of Hegel in the documentation HOT 1
- Option to add interfered types on actual code
- Maximum stack when inferring classes with a method that calls another method
- Document (automate?) maintenance of typings package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hegel.