Get the latest tech news

A Mathematica interpreter in Typescript


on GitHub: https://github.com/coffeemug/ts-wolfram I’ve been using Mathematica to help with learning math (and using math to help learn Mathematica). Too often my Mathematica code has surprising behavior, which means I don’t really understand the language or how it’s evaluated.

Second, write a toy Mathematica interpreter in Typescript that’s good enough to correctly run my custom differentiation code. I first implemented basic parsing of integers, symbols, forms, and arithmetic operators using ts-parsec(which I wrote for this project). This would be easy to fix by adding the rule Times[Minus[x_], Minus[y_]]=x y, but (a) Times is implemented in typescript, and the interpreter doesn’t currently support mixing kernel and userspace rules, and (b) extending the system to simplify algebraic expressions feels like a different undertaking.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of TypeScript

TypeScript

Related news:

News photo

Civet: A Superset of TypeScript

News photo

Zod: TypeScript-first schema validation with static type inference

News photo

Show HN: The most comprehensive authentication library for TypeScript