Hi all,
I am about to develop a runtime system on top of newlib for constrained targets (mono/multithreaded) Newlib/newlib-nano is the de facto standard for embedded systems; it's shipped with every toolchain. It's "almost" Posix compliant - the philosophy behind is: provide the basic functionality but give the user the ability to retarget almost every function if needed (for instance pthreads stuff is not implemented).
At the moment I am in a kind of "research phase" and playing around a little bit with newlib and the arm-none-eabi toolchain. Basic signal handling in Nim is running and it looks promising. Then I went to the time-related stuff but got stuck very soon.
Example:
import locks
var tlock : Lock
initLock(tlock)
then the linker complains about: "undefined reference to pthread_mutex_init " and that's fine for me. "Just" implement it.
Other modules are not so friendly; for instance os.nim and times.nim: "import os" gives me a instant "Error: OS module not ported to your operating system! "
And times.nim bails out with: " Error: undeclared identifier: 'Tm'. "
Well, Tm is imported in the "posix_<platformname>" kind of files.
At the moment it is more or less a "showstopper" to me and I am thinking about how to solve this. I think a solution could be to set the internal posix-flag if os:any is selected.
The basic philosophy should be analog to newlib: If modules are choosen it's the user's task to implement the required syscalls and the linker should complain and not the Nim compiler.
Any thoughts?