-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi,
I'm interested in the "embedded targets" part of the roadmap. I think focusing on embedded development could make OtterLang a great choice for a huge community of developers. A language that's light enough for an MCU is also amazing for fast, efficient servers.
I just wanted to share a few feature ideas that would be nice to have to attract broader users and improve the development experience.
-
Strong Type Aliases
It would be great to have a simple way to create new types (like UserId or FileDescriptor) that the compiler won't mix up, even if they are just integers underneath. This would catch so many common bugs at compile time, like accidentally passing a UserId where a ProductId is expected. -
A defer Statement
A simple defer keyword (like in Go) would be amazing for guaranteeing that resources (like file handles or database connections) are always cleaned up, even if a function errors out. It feels like a very clean way to manage resources and simplifies error handling. -
Critical Section" Blocks
A built-in atomic block that ensures a section of code runs without interruption would make it safe and easy to update data structures shared between threads or coroutines. This would solve a huge source of concurrency bugs. -
Memory Section Control
It would be a huge quality-of-life win to have a simple syntax to tell the compiler where to place variables. For example, to explicitly place a large, constant lookup table into a read-only section instead of consuming valuable RAM. -
Cleaner Bit-Twiddling Syntax
The traditional way of setting bits (e.g., CONFIG_REGISTER |= (1 << 5)) is really hard to read and easy to get wrong. A clean, built-in syntax for this would make low-level code far more robust and readable.
6)A Thought on the Milestone 2 JIT
The "Julia-style JIT" is a cool idea! For performance-critical code, it might be even more powerful if it was manually controllable. That way, we could have predictable Ahead-of-Time speed for most of the application and still choose to use the JIT for specific, dynamic tasks like just-in-time compilation of a query or script.
This might be a large request, but these features can attract more developers towards the language and make it unique.
Anyway, these are just some ideas from an excited follower! Thanks for all your hard work on this—I'm really looking forward to seeing where the project goes.:-)