Hello,
I'm a new Nimrod user. My first project is Dimrod, a library to handle measurement units and check them at compile time. The name comes from "dimensional analysis".
My first goal for this project is to learn Nimrod. I'm not even sure my approach on this code is the good one (generating too much code ?) but it works on the basic cases written in example/test_dimrod.nim.
I would be glad if I could have some opinions about how to improve this code. I hope the basic documentation in README is enough for now. I'll expand it if needed.
Not everything is easy but I enjoyed coding with Nimrod and intend to continue.
Code is available at https://github.com/ClementJnc/dimrod
Indeed it takes a while to compile. Using the master branch of the compiler it didn't like the ../dimrod include. Instead of using that you could use a nimrod configuration file to append the extra path switch for every compilation (also note the current patter is to name these files proj+.nimrod.cfg instead of proj+.cfg).
Looking through the example it looks like all the computations could be done correctly but one could still write the wrong unit in the final echo confusing users. Have you considered adding a proc to convert to a string the unit type of the variables in use?
Thanks you for these comments.
I've removed the ".." and added the path in a config file. It now works fine with "nimrod c -r example/test_dimrod.nim".
Have you considered adding a proc to convert to a string the unit type of the variables in use?
That's a good idea. I will modify "$" to be able to do it.
I'm very excited about this. I am trying to use Nimrod for practically everything, and I can see this as a beginning to replace my use of Frink - http://futureboy.us/frinkdocs/ Frink is a java app that handles unit conversions for dimensional calculations. It is also actually a sort of DSL in java. I am a dilettante coder, and Nimrod is proving to fill in all the gaps I happen upon. Thanks for this.
Rob
I can see this as a beginning to replace my use of Frink
Just a beginning then: if I remember well, Frink also brings "interval arithmetic" which Nimrod doesn't have..