Re: My experience with nim so far

2018-12-26 Thread Jehan
> Latest Nim is not that dumb for literals: This is not new. NIm has been able to handle these implicit conversions since pretty much forever (I checked 0.11.0 to be sure). Where problems come into play are constants in complex types, such as ranges, tuples, and arrays. For example, the

Re: My experience with nim so far

2018-12-25 Thread miran
> var x: uint16 = 5.uint16 var x = 5'u16

Re: My experience with nim so far

2018-12-25 Thread moerm
> Latest Nim is not that dumb for literals: _(example)_ Works fine, even the x > / 2! Excellent news, thank you. > The fact that Nim does not do that many automatic type conversions is good > for safety and performance ... And as Dom said, lenientOps exists now, but I > think I will generally

Re: My experience with nim so far

2018-12-25 Thread Stefan_Salewski
> Yes, sometimes Nim is (still) a bit dumb. When I for example assign 5 to a > uint16 var it feels a bit strange to still have to write 5.uint16. Latest Nim is not that dumb for literals: var a: uint16 a = 5 echo a var x: float x = 10 x = x / 2 echo x

Re: My experience with nim so far

2018-12-24 Thread moerm
> 1) When you work on very platform dependent code, you have to manually add a > bunch of constants and so on. My current solution: a single -d:[platform] switch and an include file with some `when` logic. Probably by far not the smartest way but simple and working 2) Too picky with variables

Re: My experience with nim so far

2018-12-24 Thread dom96
> 2) Too picky with variables types. I ended up casting so much in my code (or > pending my values with ".intx" it is not even funny anymore. You type a lot. I am also bitten by this far too much. There is a certain trade-off to be made here though between safety and convenience. I think the

Re: My experience with nim so far

2018-12-24 Thread MarcL
I will tomorrow. But it will be and excerpt because the library cannot be published..

Re: My experience with nim so far

2018-12-24 Thread juancarlospaco
If you type a lot, then you need Macros and Templates. You checked `byte` type?, up to 255, can be useful. Check the docs about defining compile variables, like `-d:somethingCustom` then `when defined(somethingCustom): # code here`.

Re: My experience with nim so far

2018-12-24 Thread cdome
Please provide samples of code for 2 and 3

My experience with nim so far

2018-12-24 Thread MarcL
Hi, Nim is a great tool. but: 1) When you work on very platform dependent code, you have to manually add a bunch of constants and so on. Maybe the situation could be improved by using commands of the like "gcc -v -x c -E /dev/null" (or similar with other major compilers) to parse the default