CommunityNews
TypeScript as fast as Rust: TypeScript++
TL;DR: This is a proposal to create a language that sits somewhere between Typescript and Rust, and which you can incrementally adopt if you already use Typescript.
Typescript and Rust can feel pretty similar:
// Typescript type Vec2 = { x: number, y: number }; function avgLen(vecs: Vec2[]): number { let total = 0; for (const vec of vecs) { total += Math.sqrt(vec.x*vec.x + vec.y*vec.y); } return total / vecs.length; }// Rust struct Vec2 { x: f64, y: f64 } fn avg_len(vecs: &[Vec2]) -> f64 { let mut total = 0.0; for vec in vecs { total += (vec.x*vec.x + vec.y*vec.y).sqrt(); } return total / vecs.len() as f64; }In some ways, Rust feels like a more restrictive but faster version of Typescript. But Typescript/Javascript can be very fast too; owing to years of hard work by browser vendors. In this article we’ll look at the performance characteristics of each in more detail, and see if we can have the best of both worlds.
Read in full here:
https://zaplib.com/docs/blog_ts++.html
This thread was posted by one of our members via one of our news source trackers.
Popular Backend topics
A new study looks into the dematerialized office, where sensorial experiences such as touch, taste, smell, and sensations of hot or cold ...
New
Powerful, flexible, complex: The origins of C++ date back 40 years, yet it remains one of the most widely used programming languages toda...
New
One of Haskell’s features that I really liked was list comprehensions, so I was very pleased to discover how nice Julia’s comprehensions ...
New
codeamigo.
Byte-sized interactive coding tutorials
New
Letting Go of Random.
In a recent post I shared some thoughts about art and included a few, somewhat tongue-in-cheek comments about the ...
New
GitHub - let-def/hotcaml: Hotcaml: an interpreter with watching and reloading.
Hotcaml: an interpreter with watching and reloading - Git...
New
PHP: Frankenstein arrays.
PHP has become quite a nice language, but there are some ugly legacies left from the past. Like the deceptive ...
New
GitHub - vitalik/django-ninja: :dash: Fast, Async-ready, Openapi, type hints based framework for building APIs.
:dash: Fast, Async-rea...
New
Ruby 3.1’s incompatible changes to its YAML module (Psych 4).
Ruby made its YAML interpreter more secure by default at the cost of backw...
New
This post is my attempt to write down, in broad strokes, everything I know about good system design. A lot of the concrete judgment calls...
New
Other popular topics
Reading something? Working on something? Planning something? Changing jobs even!?
If you’re up for sharing, please let us know what you’...
New
New
Saw this on TikTok of all places! :lol:
Anyone heard of them before?
Lite:
New
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
Big O Notation can make your code faster by orders of magnitude. Get the hands-on info you need to master data structures and algorithms ...
New
Will Swifties’ war on AI fakes spark a deepfake porn reckoning?
New
Ok, well here are some thoughts and opinions on some of the ergonomic keyboards I have, I guess like mini review of each that I use enoug...
New
Latest in Rust
Latest in TypeScript
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /rails
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /zig
- /deepseek
- /scala
- /sublime-text
- /lisp
- /textmate
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /deno
- /revery
- /ubuntu
- /manjaro
- /spring
- /nodejs
- /diversity
- /lua
- /julia
- /c
- /slackware






