Upcoming `Result` review - comments and thoughts welcome!

2023-04-06 Thread arnetheduck
> nim limitation that you need to manually re export Result to let users of > your library use the results of your functions? yes - it would actually be nice if one could mark functions transitively exported.. `**` maybe? > Is there any chance this might end up being integrated into the stdlib

State of HTTP Servers in Nim

2023-04-06 Thread termer
This feeds back into my general frustration over the fact that most people are building toys with Nim, rather than working on building production-ready libraries and applications. This problem can only compound because it drives away other people from being able to build real applications. Keep

State of HTTP Servers in Nim

2023-04-06 Thread termer
I've been using Nim for several years now. I mostly use it for small utilities and experimentation on things like microcontrollers. However, most of my time goes into other projects, mostly web-related, and thus I've wanted to integrate Nim into some of my web endeavors. To start working on this

Anyone tried GPT-4 for Nim?

2023-04-06 Thread jasonfi
The various ways you can prompt these text generators makes them really fun to interact with. It could indeed come up with its own programming language. The example I saw looked like a mix of Javascript and Python, but I didn't see the need for such a language. To be useful, the AI would then ne

Anyone tried GPT-4 for Nim?

2023-04-06 Thread jasonfi
Yes I meant the dataset.

asyncCheck break my function

2023-04-06 Thread gabbhack
`asyncCheck` does not wait for future completion, so your `asyncfunction` completes immediately. If you need to wait for more than one futures execution, use [all](https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D). import asyncdispatch proc run(

Anyone tried GPT-4 for Nim?

2023-04-06 Thread alexeypetrushin
I think in the long run, ML doesn't need human input and lots of examples for programming language understanding. As it can generate it by itself on the fly. It can give itself a task - say, paint a chess board, and then try to generate code that would do it. Validating the code with compiler an

Anyone tried GPT-4 for Nim?

2023-04-06 Thread Yardanico
The training of the models was actually sooner, and they underwent multiple rounds of additional training, because LLMs as of themselves can't actually chat normally, they just autocomplete existing text. I think you're referring to the fact that the dataset has information up to September 2021.

Anyone tried GPT-4 for Nim?

2023-04-06 Thread jasonfi
This is not something special that the Nim team has to do, except for continuing to publish more working Nim code. The GPT-like models are large statistical models that really only try to predict the next word when they generate text in response to a prompt. These models are trained on huge amo

Anyone tried GPT-4 for Nim?

2023-04-06 Thread Araq
In the long run it's a non-issue, AI gets smarter by the minute and will be able to easily understand the rules of the Nim programming language and come up with more correct answers. It could even ask the Nim playground to see if the proposed solution compiles and runs before handing out the ans

Anyone tried GPT-4 for Nim?

2023-04-06 Thread termer
My personal experience with this has been significantly worse code generation for Nim, but that's no surprise given the relatively small amount of code available for it. My concern is that over time, AI model support for languages will become expected. It's hard to see now, but you have to remem

How to disable highlighting in nim rstgen

2023-04-06 Thread Nlits
If there is no way is there a workaround?

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-06 Thread treeform
I have used socket.io maybe 15 years ago when browsers had support for WebSocket was just rolling out. I would not use socket.io today because browsers have had full support for WebSocket for like a decade. Just like people stopped using JQuery when browser support got good enough.

How to disable highlighting in nim rstgen

2023-04-06 Thread Araq
There is no way, I think.

asyncCheck break my function

2023-04-06 Thread MauriceLambert
I'm writting a little asynchronous port scan with Nim ([source code](https://github.com/mauricelambert/AsyncPortScanner/blob/main/AsyncPortScanner.nim)). I use `asyncCheck` for asynchronous parallelism, like in the [documentation](https://nim-lang.org/docs/asyncnet.html), and `asyncCheck` break

How to disable highlighting in nim rstgen

2023-04-06 Thread Nlits
Is there a config option that does this? I am switching over to client side highlight.js because in the nim version there was no way to configure class names and it does not support that many languages. I am only switching for the highlight, and am keeping nim for the normal rstgen, which led me

Upcoming `Result` review - comments and thoughts welcome!

2023-04-06 Thread shirleyquirk
I find myself overloading `valueOr` to work with `Result[void,E]` what's the reason for leaving that out? How much work would it be to avoid copies when possible? It feels very edgecasey, pattern matching whether `expr` in `?expr` is an nnkCall etc

Future of typing ?

2023-04-06 Thread Araq
> That would be nice to have, these cases don't require any extraordinary > compiler logic and won't slow down compilation. You need to prove that by submitting a pull request. :P

Is such HTML template possible?

2023-04-06 Thread alexeypetrushin
Would be better to write this proc toggle_all(e: ChangeEvent): void = self.items.each((item: TodoItem) => (item.completed = self.toggle_all)) Run as this proc toggle_all(e: ChangeEvent): void = self.items.each((item: TodoItem) => (item.comple

Is such HTML template possible?

2023-04-06 Thread alexeypetrushin
Final example, TodoMVC, all compiles import base, ../app, ../h # Model type TodoItemState = enum active, completed type TodoItem = ref object text: strin

Upcoming `Result` review - comments and thoughts welcome!

2023-04-06 Thread didlybom
I have only played with this a bit in some example code, but from the little I’ve used it I think this is great. I only have a couple of comments: * I guess it is a nim limitation that you need to manually re export Result to let users of your library use the results of your functions? * Is

Upcoming `Result` review - comments and thoughts welcome!

2023-04-06 Thread noah
If status moved directly to 2.0 that would be `yuge`

This month in Nim: March 2023

2023-04-06 Thread miran
Lots of interesting community projects! Check it out:

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-06 Thread pp
About websocket does Nim have support for `socket.io` with `C` backend? Do you use some kind of library or plain websockets where you put your implementation on top?