Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread xigoi
Quoting you: > Which kind of a table do you need for your use-case? What are the benefits of > using this over other collection types? When shouldn't you use tables over > other types available? How slow are the basic operations? These are questions anyone who knows what a hash table is should

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread xioren
As someone who has spent the last half year learning Nim and used the docs heavily, I'm 100% for adding more examples and explanations. I'm of the opinion that a strong accessible standard library is of very high importance to a language. Yes third part libraries are important too but third part

Proposed table changes - get and getOrDefault

2021-06-12 Thread Stefan_Salewski
> It would be useful to have a get proc that returned an Option instead Can you tell us how big the overhead of Options is, for code size and performance? As Options are not a core element of the Nim language, I generally avoided their use in the last seven years. I used a special marker instea

gcc does not find paths generated by os module on Windows

2021-06-12 Thread demotomohiro
You can see parameters passed from Nim to gcc by adding `--listcmd` option when you run Nim. You can echo a value of `RaylibSrcPath` or `CurrentDirectory` at compile time by using static statement. That might help for debug. For example, add static statement like this to src/nimraylib_now/rayl

gcc does not find paths generated by os module on Windows

2021-06-12 Thread greenfork
There are errors with gcc.exe not able to find the required paths (original issue : gcc.exe: error: User.nimble\pkgs\nimraylib_now-0.13.1\csources\raylib_mangled: No such file or directory Run where this path is

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread shirleyquirk
cheers, that makes the 'lower' and 'upper' make sense too. cool, got it!

Proposed table changes - get and getOrDefault

2021-06-12 Thread Prestige
I'd like to gather opinions on changes I want to propose for the tables module. Please leave any thoughts or suggestions you may have. ### getOrDefault Example: import tables let table = {1: "one", 2: "two"}.toTable proc creat

How to add something before a C declaration?

2021-06-12 Thread xigoi
`wasmrt` looks promising! Unfortunately, I'm getting a weird error: `wasm-ld: error: unknown file type: /lib/libm.a`

How to add something before a C declaration?

2021-06-12 Thread yglukhov
Also worth looking at [jsbind](https://github.com/yglukhov/jsbind) and [wasmrt](https://github.com/yglukhov/wasmrt)

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread cblake
> Both statements seem to be true, but now i've even less of an intuition about > how these work. The idea is very sensitive to allowing duplicates: import algorithm # |- insert here echo lowerBound([1, 2, 2, 3], 2) # 1 echo upperBound([1, 2, 2, 3], 2)

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread lscrd
Thanks. So, it was found before and correction is in the pipe. Fine!

How to add something before a C declaration?

2021-06-12 Thread shirleyquirk
you can use .codeGenDecl but iirc you need to double check the output i remember it being a tad buggy a year or so ago when i was using it.

How to add something before a C declaration?

2021-06-12 Thread xigoi
I'm trying to make a WebAssemly library module using `emcc`. To export a function from C into the calling JavaScript, the following syntax is used: #include EMSCRIPTEN_KEEPALIVE int triple(int n) { return 3 * n; } Run How do I make the Nim compiler annot

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread shirleyquirk
previous discussion:

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread lscrd
When trying to use these functions I got a behavior not consistent with the documentation. Here is an example: import algorithm let a = [2, 4, 6, 8] echo a.lowerBound(4) # display 1 echo a.upperBound(4) # display 2 Run The documentation for`lowe

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Zoom
Thanks for your replies here. This thread grew completely out of proportions, to be honest. I'll try my best to contribute according to the level of my expertise, however small it is.

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Araq
> Do you think it would be undesirable to expand the docs in this manner where > appropriate? No, it would be desirable. But assuming everybody has finite time, there might be more worthwhile points to address. Where is the evidence that the people who use Rust need this explanation on hash tab

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Zoom
> For people who have never heard about hash maps or who are interested in > background and implementations it is better to write a book or at least a > blog post. It's not either/or. No one here actually proposed explaining what a hash map is, this is a strawman people keep resorting to, which

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Stefan_Salewski
> Because it's interesting? I think this thread was about the Nim API documentation. For people who have never heard about hash maps or who are interested in background and implementations it is better to write a book or at least a blog post. Indeed I gave a short introduction for the kids in m

An simple nrpl for nim

2021-06-12 Thread shirleyquirk
`findNimStdLib` also doesn't work for me on linux(choosenim), and i'm not sure it's even a good idea to do this at runtime, right? Don't you need to use the same stdlib at runtime you used to compile against? changing that line to `findNimStdLibCompileTime` makes it run, at least, but not work,

Accessing object in seq of parent type

2021-06-12 Thread saltbayfour
Thanks for sharing, it helped me a lot.

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Zoom
An aside on `tables` impl: > > What is the addressing scheme? > > Why do you need to know? It's an implementation detail. Because it's interesting? Because I may have some expectations on how different implementations behave under a given workload? > > Why is it open-addressed and how doe

An simple nrpl for nim

2021-06-12 Thread HJarausch
A dumb question: How to use nims? I don't get output of echo nor does 'quit' work. For the record, on my Gentoo Linux system, I had to do these changes import "/opt/nimble/pkgs/compiler-1.5.1/compiler" / [ast, astalgo, modules, passes, condsyms, ... proc main() = var

Detect keyboard input

2021-06-12 Thread cblake
@Stefan_Salewski is right - `terminal.getch` does abstract over OSes after all, though only (Windows & posix it looks like). So this code should work: import terminal echo """What do you want to do? 1) Do something 2) Exit""" case getch(): of '1': echo "Ch

Detect keyboard input

2021-06-12 Thread Stefan_Salewski
Maybe or

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread zetashift
> So finally, please help our 3rd party libraries with their documentation! I > bet no matter if it's a UI library or an ORM or scientific computing -- they > could all need serious help for their documentation. I agree with this sentiment! I'd say Nim docs are pretty solid now and a good start

Detect keyboard input

2021-06-12 Thread cblake
I believe the Unix & similar way to do this is "CBREAK mode" on the terminal/tty device, but under Windows there is a totally different mechanism. I do not believe the Nim stdlib abstracts over these possibilities. So, sorry to answer your question with a question, but I believe the answer to y

Detect keyboard input

2021-06-12 Thread talaing
Hello, is there any way to detect keyboard input using Nim? Something like this: echo "What do you want to do?" echo "1) Do something" echo "2) Exit" echo "Press '1' or '2' on your keyboard" Run I don't want to have to press ENTER after entering my choice

An simple nrpl for nim

2021-06-12 Thread slangmgh
You need libffi if you compile with -d:nimHasLibFFI, input followin command to install libffi: nimble install libffi Run You can disable libffi to compile without option "-d:nimHasLibFFI".

Improving the documentation: Roadmap, community engagement.

2021-06-12 Thread Zoom
@h3rald: > problem in an absolute sense Is there such a thing? ;) > I don't think the average user of the language needs to know about > implementation details and have in-depth discussions about performance and > why things work in a certain way. I don't think it's wise to decide what people

Release candidates for 1.4.8 and 1.2.14

2021-06-12 Thread StrangeBug
I still have the issue with Defender. nimble, nimgrep and vccexe flagged as Win32/Uwamson.A!ml. I ended up building nim from source (using clang 12) which was easy (kudos on that one). Sorry I can't provide any useful information. On the plus side, building from source demonstrate that nim compi