
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

Powerful, flexible, complex: The origins of C++ date back 40 years, yet it remains one of the most widely used programming languages toda...
New

There is a long, difficult road from vague, pie-in-the-sky ideas about what would be cool to have in a new programming language, to a rob...
New

Microsoft is trying to leapfrog competitors like Google and Amazon as they face record antitrust scrutiny.
The big picture: The deals ...
New

Pocketlang is a small (~3000 semicolons) and fast functional language written in C. It’s syntactically similar to Ruby and it can be lear...
New

Rocket is a web framework written in Rust. It provides a concise API and is opinionated and feature-rich beyond what you would typically ...
New

GitHub - audulus/rui: Experimental Rust UI library.
Experimental Rust UI library. Contribute to audulus/rui development by creating an a...
New

GitHub - mcobzarenco/zee: A modern text editor for the terminal written in Rust.
A modern text editor for the terminal written in Rust -...
New

GitHub - Shirakumo/trial: A fully-fledged Common Lisp game engine.
A fully-fledged Common Lisp game engine. Contribute to Shirakumo/tria...
New

GitHub - WhatsApp/waraft: An Erlang implementation of RAFT from WhatsApp.
An Erlang implementation of RAFT from WhatsApp. Contribute to ...
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
Other popular topics

A thread that every forum needs!
Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New

Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New

Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New

We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New

Think Again 50% Off Sale »
The theme of this sale is new perspectives on familiar topics.
Enter coupon code ThinkAgain2021 at checkout t...
New

Hi folks,
I don’t know if I saw this here but, here’s a new programming language, called Roc
Reminds me a bit of Elm and thus Haskell. ...
New

The overengineered Solution to my Pigeon Problem.
TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New

Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New

Large Language Models like ChatGPT say The Darnedest Things.
The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New

A Brief Review of the Minisforum V3 AMD Tablet.
Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /java
- /haskell
- /onivim
- /svelte
- /typescript
- /crystal
- /c-plus-plus
- /kotlin
- /tailwind
- /gleam
- /react
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /zig
- /scala
- /sublime-text
- /textmate
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /spring
- /manjaro
- /django
- /diversity
- /nodejs
- /lua
- /julia
- /slackware
- /c
- /markdown