DEV Community

Let's rewrite Typescript in Rust!

Erick Sosa Garcia on June 24, 2020

If I'm sure of one thing, it is that typescript completely changed the way developers viewed javascript. working with javascript in small and medi...
Collapse
 
xera0 profile image
XeRA0

Hello, Deno does something about this no?

Collapse
 
buttercubz profile image
Erick Sosa Garcia

Part of this concern comes from the fact that I am working on a CLI to for deno and wanted to optimize working times but it takes a long time for the typescript compiler, deno includes the official compiler

Collapse
 
xera0 profile image
XeRA0

Good to know I am learning js/Deno in the same time and the information helps

Thread Thread
 
buttercubz profile image
Erick Sosa Garcia

any questions, I have no problem helping you

Collapse
 
sirseanofloxley profile image
Sean Allin Newell

Woah. That's a spicy meatball. #bigProject #goBigOrGoHome #rustLang

Collapse
 
gklijs profile image
Gerard Klijs

Kotlin and Clojure also run both in the backend and frontend. If you include wasm it's a bunch more.

Collapse
 
eriklz profile image
Erik Lundevall Zara

F#, Purescript, Nim, Dart, Haxe are also languages that can be used for both frontend and backend since they can be compiled to Javascript.

Collapse
 
gklijs profile image
Gerard Klijs

How's the tooling. Last time I tried with Kotlin it was not that great. Clojurescript on the other hand is pretty amazing, keeping state while reloading, and doing the reloading fast. Only thing with Clojurescript is that error messages are nog always usefull.

Collapse
 
mrjjwright profile image
John Wright

Check out esbuild for fast ts bundles

Collapse
 
mindplay profile image
Rasmus Schultz

Yep, esbuild is crazy fast and is being written by an extremely talented and experienced developer - it solves the compile speed problem for both TS and ES, so in the likely event that you're going to bundle, well... 🙂

See also Facebook's Rome project, which I think is going to compete in the same space.

Collapse
 
divywork profile image
Divy Srivastava

esbuild is fast bundler but it does not typecheck

Collapse
 
willm profile image
Will Munn

This is a very important point and it's the same for SWC. From what I've seen all it does is strip the types. You can quite happily "compile" what's actually invalid typescript:

const name: number = 'foo';
Enter fullscreen mode Exit fullscreen mode

to

var name = 'foo';
Enter fullscreen mode Exit fullscreen mode

So really this is not an alternative to tsc, you might as well write javascript. What would be really cool is if their was a true typescript compiler written in rust/c++/go. I've been searching for this, but I don't think it exists.

Thread Thread
 
doitadrian profile image
Adrian Smijulj

Do you know maybe, was there any movement in the meantime?

Was searching for the same thing, and could not find anything.

Collapse
 
wongjiahau profile image
WJH

Hi there I’m interested in this project, where is the GitHub repo?

Collapse
 
buttercubz profile image
Erick Sosa Garcia

here is the project repo github.com/swc-project/swc

Collapse
 
ben profile image
Ben Halpern

Really cool

Collapse
 
arunran30008245 profile image
arun rana

Damnnnnnn