Pros vs. Cons Of Nim In The Large?

2021-07-01 Thread ElegantBeef
"no wide adoption behind it to prove it's design decisions are correct" this comment meanwhile JS is the language that powers the web is a bit comical to say the least. Adoption does not mean the design decisions are correct, cause having correct design decisions are purely subjective, and just

Pros vs. Cons Of Nim In The Large?

2021-07-01 Thread Scotpip
It's quite well known in the finance industry in London. At least one recent survey showed that F# developers have the highest average salary of any language - so you may be missing out on something :-) It's basically a modern ML with an expressive algebraic type system. It's cross-platform, op

Help for Sending Input Data To REPL

2021-07-01 Thread ynfle
Do you have this POC hosted somewhere?

nim-ws - websockets for Nim

2021-07-01 Thread dom96
I don't think that specific line of code you linked is problematic, consider the same code with synchronous sockets: the exception would bubble up until a point where it's caught where you'd have access to the socket and would then close it (or preferably have a `defer` set up to close it). If y

Help for Sending Input Data To REPL

2021-07-01 Thread timothee
I've developed a similar tool to implement a CAAS (compiler as a service) to implement a REPL (unlike inim, it doesn't recompile everything on each cmd; unlike nim secret, it can use c backend), it uses a client server architecture with a cmdline frontend for the REPL that talks to a backend in

Help for Sending Input Data To REPL

2021-07-01 Thread ynfle
2 ideas, flushing and sending line endings (`'\l'` in nim) are you using readline?

Help for Sending Input Data To REPL

2021-07-01 Thread Niminem
Hey guys, I'm working on a browser-based IDE for Nim that uses either `nim secret` or `inim` as the REPL. What I'd like to do is send scripts to the REPL's stdin and receive responses via its stdout for printing it out in the browser. I've tried building a quick demo with a few different exampl

Use cstring for C binding

2021-07-01 Thread arnetheduck
Careful though, it's easy to create dangling references with `cstring` \- it doesn't keep memory alive: proc f(i: int): cstring = cstring($i) let x= f(42) echo x GC_fullcollect() let y = newSeq[char](10) echo x Run

Use cstring for C binding

2021-07-01 Thread PMunch
There is a way, but it's very hacky (basically cast the object to something with the same memory layout, yuck!). Someone opened a RFC to add this functionality: , but I haven't heard any more about that.

NimConf 2021: Saturday, June 26th 2021

2021-07-01 Thread rahulp411
This is a great point, however, before Western Europe could rise up they had to go through some of the toughest parts of history. Riddled with plague and civil wars Western Europe in this period was nicknamed the 'Dark Ages' for a reason. Meanwhile, the Middle-East and Byzantium were having a 'G

Sega Genesis

2021-07-01 Thread jaybill
I've written some very basic Sega Genesis games in C before, using the [marsdev toolchain](https://github.com/andwn/marsdev) . Does anyone have any idea what the feasibility of getting Nim to generate C code that would compile with this might be? If I were interested in writing/contributing such

Bit of a rough experience registering to the forum

2021-07-01 Thread Fire
is the place where the forum is kept. I have also noticed that the submit button does not change the site's look in Chrome until after a reload. I just switched to Firefox, but still.

Bit of a rough experience registering to the forum

2021-07-01 Thread argl
First post here, so hello everyone! I want to give a bit of feedback regarding my experience with registering on this forum, in the hope it helps improving the process. I signed up today but did not check my emails for some hours. When I followed the confirmation link I got an error saying the

Pros vs. Cons Of Nim In The Large?

2021-07-01 Thread alexeypetrushin
I checked F# on github, the [most popular project has 2.8k stars](https://github.com/search?q=stars%3A%3E1000+language%3AF%23&type=Repositories&ref=advsearch&l=F%23&l=). Maybe I'm missing something, I never heard about any production usage of F#, especially in finance industry...

Pros vs. Cons Of Nim In The Large?

2021-07-01 Thread reversem3
Whoa this is cool, I wish you could translate from oil to bash for production work though.

Setting up Nim Dev environment in Visual Studio on M1 Mac (with macOS Big Sur)

2021-07-01 Thread ranedk
# Install Nim Assuming that xcode is installed on your machine already. `choosenim` doesn't currently support M1 Mac. So you will need to build it. git clone https://github.com/nim-lang/nim.git nim git clone -q --depth 1 https://github.com/nim-lang/csources_v1.git csources c

nim-ws - websockets for Nim

2021-07-01 Thread arnetheduck
> Can you elaborate on how that code would result in fd leaks? By not handling exceptions, which in turn means `close` is not called on the socket. Also, using `asyncCheck` causes the exception that `send` raises to pop out of the `poll` call instead at which point the context for the exception

This Month with Nim: June 2021

2021-07-01 Thread miran
If you want to include your project for the next month (it doesn't have to be a new project), follow the instructions [here](https://github.com/beef331/website).

Use cstring for C binding

2021-07-01 Thread mildred
`str.len` is the actual length of the string. it's equal to its capacity when allocated with `newString(cap)` but after it has been used, and more specifically after `str.setLen()` has been called, it does no longer contains the capacity. It's just that I'd prefer to rewrite: cons

Use cstring for C binding

2021-07-01 Thread Clonk
The capacity is the size of the memory allocated, the length is the number of `char` that are not 0x00 . Basically : a.len() # Maximum number of char you can write in the string memory a.cstring.len() # Number of char before the first char(0) character Run That i

Use cstring for C binding

2021-07-01 Thread mildred
Thank you very much for the detailed information. I just learnt that strings could have a capacity different from their length (might be useful for mutable strings). Is there a way to access this capacity from the code?

nim-ws - websockets for Nim

2021-07-01 Thread dom96
Can you elaborate on how that code would result in fd leaks?

Use cstring for C binding

2021-07-01 Thread Clonk
> Would that actually work? it does not feel good to allocate a string to > convert it to a cstring. What's the best way to do here? Allocating a string and callind `cstring` does work for passing string. What I usually do is make a lightweight wrapper on proc like these so I can pass string di

Use cstring for C binding

2021-07-01 Thread PMunch
To answer these questions it helps to understand what a string in C actually is. `char *` simply means a pointer to a character. In C this is all that a string is, a pointer to a character. Then it is assumed that the rest of the string follows after the first character byte-by-byte, until a NUL

Use cstring for C binding

2021-07-01 Thread mildred
Hello, I'm trying to bind to C code, and I have various questions around C strings (cstring) As I understand, cstring is suitable for both const strings in C (`const char*`) as well as mutable strings (`char *`, as long as the length is respected). Now, I need to pass a string buffer to a C fun

Pros vs. Cons Of Nim In The Large?

2021-07-01 Thread Scotpip
On the circular imports issue, I'm coming from f#, where the lack of circular imports is seen as a feature rather than a bug. It encourages (even forces) a good onion design with the pure code at the centre of the project and the impure code (files/databases/networks) on the periphery. Given th

nim-ws - websockets for Nim

2021-07-01 Thread arnetheduck
Nice beginning for a socks library! This a a problem often encountered with asyncdispatch and the Nim std library itself, but if you want to use it for production projects, I'd recommend you audit the code for leaks and error handling in general - code like

Compile Error when trying to compile docx and xlsx modules

2021-07-01 Thread WhyDee86
After adding the zlib.h, the error above is changing to link error. You can try it yourself; all you need to do is install nim 1.4.8 using finish.exe or choosenim and add zlib.h to the compiler folder. After that, try to compile the xlsx module. But I didn't know how to fix the link error, so I