Doo: A Simple, Fast Programming Language Built on Rust and LLVM

15 points by nynrathod ↗ HN
Hey HN!

https://github.com/nynrathod/doolang

I'm Nayan, and I'm stoked to share Doo, my project turned side hustle for a lang that's dead simple to write but punches like Rust. Think clean syntax (inspired by Rust but less boilerplate), auto memory mgmt via ref counting (no GC pauses), rich types, and it spits out standalone native bins via LLVM/clang.

Why Doo? Coding should feel fun, not fighty. No more wrestling with lifetimes or macros just to get a "hello world" but still safe and speedy.

Quick tour (hello.doo):

fn main() { let msg = "Hey HN!"; print(msg); }

Static Type System: Compile-time type checking with type inference Automatic Memory Management: Reference counting for data types Rich Data Types: Integers, strings, booleans, arrays, maps, and tuples Module System: Organize code with a hierarchical import system Control Flow: Conditional statements, for loops, and range iteration Function System: First-class functions with parameter and return type annotations Native Compilation: Compiles to standalone executables using clang/lld

Repo: https://github.com/nynrathod/doolang (stars/pulls welcome!)

What do you think? Too Rust-y? Missing a killer feature?

11 comments

[ 5.5 ms ] story [ 26.4 ms ] thread
what are the kind of things you are building yourself with this?
The idea and syntax looks good for me. I like it's clean an minimalistic design. But still it's to early to say is it good or not. Because there is no obvious features. You should answer the question what's the goal of the language and find the auditory who is right for you.

Did you write it or generate? If the later, then it's could be even more impressive in some way.

Is it safe?

Does it require using traits everywhere, like Rust does?

Does it have proper references (C++ style)?

Algebraic data types please. When you programme in Haskell, you use them all time, and yet support is missing in so many languages. It's one of the things that makes Swift look attractive to me.
Hi, thanks for pointing this out. Yeah struct and enum are alredy in pipeline. memroy mgmt and codegen work pending for those 2. Planning to release in 0.3.0 but let me see if possible on next release of 0.2.0

Struct enums are base of any type safe language will surely add in upcoming releases.

Very cool. I'm always on the lookout for languages - especially beginner-friendly ones - that are good candidates for building Wasm Components (my use case is a fantasy console with Wasm game cartridges).

Have you given any thought to supporting Wasm Components as a build target?

Doolang i started for writing server and apis easily and simply, but you points make sense for Wasm components. Not planned as of now as this is just starting point, but surely would take you thought for my further roadmap. Honestly i'm not too much expert in such thing yet, but would appreciate if you have any other more recommendations and suggestions
Great start!

Just want to say, you did all the right things: Simple instructions, to the point and, and I can't stress this enough - examples. Like 9/10 when someone shares their language, they have little to no examples and it's the first thing people ask for.

I do think you could probably have a few more examples that are like the calculator and less of what's basically a one liner.

On the language: I like what's there so far. It's clean minimalist, and familiar.

The problem is that there's not really a USP that I can see. I get the rust but with reference counting, but I don't think that's even close to enough. There has to be a really really good reason for people to try and use a new programming language. And I don't really see the overall vision beyond a small hobby project (which is fine if that's what you were aiming for)

> Missing a killer feature?

Yes, very much so.

Thanks for valuable feedback. Yeah definitely will add more examples projects.

And really make sense your point to have usp or any unique or good feature doolang should have. As this is just starting point of doolang, and honestly i never started this as hobby project I want this to be mature over years not to replace any languge but to have simplicity for writing servers and apis. after few months I will definitely integrate this with my own production note taking app once i improve this language.

Reference counting i Introduce for auto memroy mgmt only, as rust ownership and borrow method will be extreme complex to implement as solo dev i feel.

But now im clear now language should have any special feature or target which is lacking, idk what to find for this, but it will be valuable if you can suggest, im also thinking to have new post to ask feedback from community what they want in such language. Any suggestion?

  > Doo provides a rich set of built-in types:
  >
  > Type  Description  Example
  > Int  32-bit signed integer  42, -10
  > Str  UTF-8 string  "Hello, World!"
  > Bool  Boolean value  true, false
32-bit signed integer is the only numeric type in that "rich" set?!?
Good point, will remove that word, btw will added unsigned float in upcoming release. Thanks for that comment.