-
I really like the Hylo language and think it's offering something unique through its simpler approach to memory safety. Is love to use it in a resource-constrained embedded system, so I'm wondering how it will support a few features/use cases.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @waydan, thanks for your interest!
There's no need for dynamic memory allocation, and I don't think the paper says there is. Yes, some form of RTTI is needed, but as far as I can tell there's no reason its performance needs to be non-deterministic, especially if you only catch primitive types and
We intend that all the basic language features, including error handling, are available to applications built with only the Core library and no standard library, where the Core library is suitable for resource-constrained embedded environments without generalized dynamic allocation. This is a goal, for sure, but we're still a long way from working out the details of how to achieve it. The success of that effort will require input and attention from domain experts like you, so I hope you'll stay engaged.
I think that's probably achievable in effect using library features layered on top of our basic translation of tuple types into LLVM record layout; if I'm right I'd prefer to handle this relatively niche requirement that way, rather than accepting the added complexity that comes with specific language features to support it. But again, we'll need to keep open an ongoing discussion with domain experts to make sure the design works for these niches.
I don't know much about them; I presume they are essentially global variables?
Depends what you mean by volatile. Do you mean the C++ meaning of the keyword (which IIRC has to do with signal handlers and is useful to almost nobody)?
It should be possible to create a pointer at compile time from the bit pattern of an integer constant, if that's what you mean. |
Beta Was this translation helpful? Give feedback.
-
Thank you for making this distinction. A common language core will, IMO, help adoption since many embedded system engineers mistakenly think memory will be dynamically allocated whenever a class is constructed and freed when destructed.
Spot on. Good architecture and hardware according layers can help localize modification to a thread. Some using Rust have tried modeling them as singletons and employed the borrow-checker to control access.
I mean that reads and writes would not be eliminated by an optimizer. It's necessary because the programming model doesn't account for hardware modifying or being modified by a value in a memory location. Sometimes stronger sequential execution guarantees are required and atomics are applicable, but such a strong guarantee is not always necessary. Thank you for all the feedback. I do hope I contribute to the language's development. |
Beta Was this translation helpful? Give feedback.
Hi @waydan, thanks for your interest!
There's no need for dynamic memory allocation, and I don't think the paper says there is. Yes, some form of RTTI is needed, but as far as I can tell there's no reason its performance needs to be non-deterministic, especially if you only catch primitive types and
final
classes. I do see that the paper says “today’s dynamic exception types violate the zero- overhead principle, and do not have statically boundable space and time costs,” which …