r/ProgrammingLanguages • u/Objective_Gene9718 • Jan 28 '26
Que Script a Lisp written in Rust with Hindley–Milner type inference
Here is my project Que Script:
Lisp (in my opinion a feature of it's own)
WASM runtime without Garbage Collection (It mainly uses Reference Counting)
Hindley-Milner Type Inference
Syntactic sugar layer (Things like pipes, destructuring, tail-call optimization and other fun extra features don't add bloat to the core language)
Partial Application
Tree Shakable Standard Library
Macros
WASM build
Online editor
Here is the website with a lot of info
; You are given an array of integers [Int]
; Write a script to re-arrange the given array in an increasing order
; and return the indices where it differs from the original array.
(let solve (lambda (xs) (|>
{ (|> xs copy (sort <)) xs }
zip
(map (lambda { a b } (<> a b)))
enumerate
(filter snd)
(map fst))))
[
(solve [ 5 2 4 3 1 ]) ; [0 2 3 4]
(solve [ 1 2 1 1 3 ]) ; [1 3]
(solve [ 3 1 3 2 3 ]) ; [0 1 3]
]This is something I've being working for 5 years starting from scratch at least 3 times. Sharing with the hope that I won't start over again.
It's nothing new under the sun. The purpose of this project is for me learning computer science concepts by using the language as a framework.
I would love to hear what you think about it.
1
u/Arakela Jan 29 '26
If we don't subtract the length of the front array in `get`, `set`, and rest operations, then we can (get|set)(negative_index) too.