Re: Module logging: how to create the right Logger(s) in a library?

2018-02-13 Thread Araq
The main reason logging is pervasive in the Java world is because of its checked exceptions that force you to handle exceptions in places where you don't know what to do, so you log the error instead. Horrible, fragile practice. Then the process dies and you can look into the log to see

Re: shorthand for literal type annotations?

2018-02-13 Thread Arrrrrrrrr
i'd really like to be able to define arrays like this: let myArray: array[auto, float32] = [1, 2, 3, 4]

Re: Module logging: how to create the right Logger(s) in a library?

2018-02-13 Thread monster
@andrea Coming from the JVM myself, I know exactly how it is. But, IMHO, the only way around that is to have a super powerful/flexible logging system as part of the system library, so that no one gets the idea of implementing their own instead. By the time Java added their own standard logging

Re: Module logging: how to create the right Logger(s) in a library?

2018-02-13 Thread andrea
Unfortunately, as common as this is, it is also an endless source of frustration. Not least, because each library will choose a different logging library, leading to a nightmare of integrating all of them. I still struggle every time I have to decide whether to use log4j-over-slf4j or

Re: Module logging: how to create the right Logger(s) in a library?

2018-02-13 Thread federico3
Logging in libraries is pretty common across different languages. It's not invasive as long as libraries do not explicitly configure loggers to create files and so on. The application is at the root of a hierarchy of loggers and can set verbosity and backends for all imported libraries.

Re: shorthand for literal type annotations?

2018-02-13 Thread pqflx3
Alternatively, there was discussion for an 'asArray' macro. [https://github.com/nim-lang/Nim/issues/6563](https://github.com/nim-lang/Nim/issues/6563) [https://github.com/nim-lang/Nim/pull/6640](https://github.com/nim-lang/Nim/pull/6640)

Re: nimble question

2018-02-13 Thread jackmott
thank you, that is handy

Re: shorthand for literal type annotations?

2018-02-13 Thread jackmott
yes! that is it, thanks!

Re: shorthand for literal type annotations?

2018-02-13 Thread pqflx3
You can specify just the first term and the others are inferred. var gradZ = [ 0'f32, 0, 0, 0, 1, 1,-1,-1, 1, 1,-1,-1]

Re: nimble question

2018-02-13 Thread jackmott
what is the distinction between using nimble install, and nimble develop?

Re: nimble question

2018-02-13 Thread dom96
This explains it well (I hope): [https://github.com/nim-lang/nimble#nimble-develop](https://github.com/nim-lang/nimble#nimble-develop)

Re: The experience of using nim as js language

2018-02-13 Thread yglukhov
Low-level code with pointers and memory may not work in JS as you would expect. IO in js is different. Closure iterators are not available in js, but they are pretty specific to their use-cases. Other than that the code is pretty cross-platform. [nimx](https://github.com/yglukhov/nimx) is one

shorthand for literal type annotations?

2018-02-13 Thread jackmott
I have a vague memory of someone tweeting me a way to avoid having to put a type annotation on every field in an array like so: var gradZ = [ 0'f32, 0'f32, 0'f32, 0'f32, 1'f32, 1'f32,-1'f32,-1'f32, 1'f32, 1'f32,-1'f32,-1'f32] But I can't remember,

Re: nimble question

2018-02-13 Thread dom96
Run `nimble develop` in your library's directory, then simply add a `requires` in your new project for that library.

nimble question

2018-02-13 Thread jackmott
I am familiar with how to use 'requires' to pull in a library that is in package manager. What if I have my own library that is on my filesystem, and I'm starting a new project and I want to use it, how do I use my nimble file to point at it?

Re: nimble question

2018-02-13 Thread jackmott
I think I have figured it out: use 'nimble install' on the library then you can just refer to it by name with 'requires'

The experience of using nim as js language

2018-02-13 Thread refobj
Hi. I am a nim beginner. I am considering that nim as my js language. I wonder that the forum members' experience for the nim backend. How much code share is possible between plain nim and js nim code?