Re: Cannot Install Nim

2019-11-06 Thread Hideki
Hi joe_04_04, How about checking this thread? [https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave](https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave)

Re: compiling to typescript

2019-11-06 Thread Araq
It is **not** "generated semi-obfuscated code" it's just generated code. And producing more "human-like" code is _more_ effort, not less. > They also support newer versions of javascript like es2015, which are more > concise. So what? We don't need new JS features, we **compile to**

Re: Using Shared Libraries written in Nim via FFI

2019-11-06 Thread kaushalmodi
I have ended up with the same set of questions today. Hopefully someone can answer.

Cannot Install Nim

2019-11-06 Thread joe_04_04
A little bit of background. I'm running macOS 10.14.6 currently. I have had Nim installed in the past as well, but I don't recall the version number. I did manually remove Him at one point, deleting .choosenim and .nimble from my Mac home directory. Now, I'm trying to reinstall Nim using; curl

Re: Why is Seq.reverse() not part of the standard lib?

2019-11-06 Thread keyle
Thanks for the responses. Bringing it back to the original post, as a user, I fully expect the language or the standard lib of a high level language to do stuff like reverse() on a dynamic array out of the box. Odd and Even stuff is really easy with modulo support but I'd expect reversing

Re: Macro for creating ‘hooks’?

2019-11-06 Thread mratsim
the identifiers doesn't need to be valid/existing but it prevents passing a whole statement or parenthesis or brackets. It's really optional, just an extra check.

Re: compiling to typescript

2019-11-06 Thread mratsim
But we can already use Google Closure compiler. Also Nim is already readable and can already target WASM. I expect going to WASM through C or directly via LLVM is much more efficient. Javascript and Typescript probably lose all relevant type information, especially for integers and arrays. I

Re: compiling to typescript

2019-11-06 Thread kobi
instead of this generated semi-obfuscated code, you get idiomatic and readable code in the other language, and leave it to their compiler to make optimized js, perhaps they will have other targets like wasm in the future, so you can reuse their efforts/work-force advantage/features.

Re: compiling to typescript

2019-11-06 Thread SolitudeSF
whats the point? code produced by nim is not supposed to be read, unless for some edge case debugging.

compiling to typescript

2019-11-06 Thread kobi
Hello, I don't know if it has been asked before: nowadays, there are a few languages whose specialty is compiling to javascript, while at the same time are much closer to Nim in terms of semantics and features, notably typescript, and others like dart. typescript is backed by microsoft. Now

Re: Can themutually recursive types be written separately?

2019-11-06 Thread Stefan_Salewski
I guess not much has changed in the last six months: [https://forum.nim-lang.org/t/4745#29616](https://forum.nim-lang.org/t/4745#29616)

Re: Why is Seq.reverse() not part of the standard lib?

2019-11-06 Thread Stefan_Salewski
I just remembered that we had a similar discussion some months ago: [https://forum.nim-lang.org/t/5068#31836](https://forum.nim-lang.org/t/5068#31836)

Can themutually recursive types be written separately?

2019-11-06 Thread javinyang
in nim manual Type sections A type section begins with the type keyword. It contains multiple type definitions. A type definition binds a type to a name. Type definitions can be recursive or even mutually recursive. Mutually recursive types are only possible within a single type section.

Re: How to uninstall Nim so i can install it in another folder

2019-11-06 Thread Levlan
I have done it already.

Re: How to uninstall Nim so i can install it in another folder

2019-11-06 Thread Araq
Install it to where you need and remove the Nim in your Downloads folder.

How to uninstall Nim so i can install it in another folder

2019-11-06 Thread Levlan
I'm a new programmer I installed Nim, but installed it from the Downloads folder( i didn't read that i need to extract it into wanted destination folder). I want to uninstall it from the Downloads folder and move it to C:directory. What is the process to do it? ( no uninstall in control

[Talk] What FP Can Learn From Static Introspection. (features Nim heavily)

2019-11-06 Thread deech
I just gave a talk at Lambda World about static introspection ([https://www.youtube.com/watch?v=ElHi2h9Ho6M](https://www.youtube.com/watch?v=ElHi2h9Ho6M)) that uses Nim quite a bit to make it's arguments. Hope you enjoy, feedback welcome!

Re: I'd like to offer some suggestions re: Nim documentation. Github? This forum?

2019-11-06 Thread edu500ac
I run on the same problems you listed in your intervention. What I did was to create a group for writing a book on Nim. Here is our github page: [https://github.com/FemtoEmacs/nimacros](https://github.com/FemtoEmacs/nimacros) If you want to collaborate with proofreading or even writing a

Re: Macro for creating ‘hooks’?

2019-11-06 Thread Hlaaftana
For some reason the "parameter constraints" section of what was once in the Nim manual was moved to the experimental features manual along with term rewriting macros, even though it is an independent feature from them.

Re: Function overloading based on object.kind

2019-11-06 Thread drkameleon
That's exactly what I was looking for! Thanks!

Re: Disabling unused import warning locally

2019-11-06 Thread yglukhov
Another way is to fix the unused warning, so that it pops up whenever no symbols are used from the imported module **and** the imported module has no global code with side effects (and it should be a recursive check).

Re: let & const on C backend

2019-11-06 Thread dom96
You can always workaround this by creating a nice macro which will generate something like: {.emit: """ const int a[] = {1,2,3}; """.} Run

Http Server code to download a file

2019-11-06 Thread akbarbs
Hi, I just happened to explore nim. I wanted to know how can I implement a server side code to handle get/post request to download a file. Used cherrypy and server sends as chunk. But the wsgi process consumes whole memory of the file during the whole cycle of download unlike decrease in size

Re: Function overloading based on object.kind

2019-11-06 Thread SolitudeSF
[https://github.com/alehander92/poly](https://github.com/alehander92/poly) there is a macro for that

Re: Starting A Podcast: Anyone Interested?

2019-11-06 Thread Araq
How about a Nim related topic? ;-)

Re: Function overloading based on object.kind

2019-11-06 Thread Araq
Maybe this is useful: type TypeAObj = object s: string TypeBObj = object i: int MyObj* = ref object case kind*: ObjKind of typeA: a: TypeAObj of typeB: b: TypeBObj proc

Function overloading based on object.kind

2019-11-06 Thread drkameleon
OK, let me explain what I'm trying to do. Let's say we have a function that takes a (ref) object as an argument. Like this: proc myProc(x: MyObj) = # do sth Run and and object like this: type MyObj* = ref object case

Re: undeclared identifier: 'PGenericSeq' when using '--seqsv2:on'

2019-11-06 Thread drkameleon
Thanks a lot for the thorough explanation!

Re: undeclared identifier: 'PGenericSeq' when using '--seqsv2:on'

2019-11-06 Thread GordonBGood
@drkameleon: "\--seqsv2" is a "future feature" that is a recent development that has come about because of experimental work done with "\--gc:destructors" and "\--newruntime", for which two uses (and --gc:hooks, which is a special adaptation of --gc:destructors) it is a hard-coded prerequisite