How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread shirleyquirk
Works for me. You forgot the 'e'

State of HTTP Servers in Nim

2023-04-16 Thread Araq
> For instance, this will copy in some cases ... It doesn't with copy arc/orc. And frankly, it's not all that hard to write fast parsers in Nim. It helps if you benchmark but if you don't, how do you end up with "fast" HTTP servers anyway?

State of HTTP Servers in Nim

2023-04-16 Thread termer
Yeah, it's a real problem. Basically anywhere I touch strings I get poor performance. Unrelated to that, but I'd like to hear your thoughts (and anyone else's), what do you think of having HTTP server context instances be thread-local for multithreading purposes? You'd need to set up a server c

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
hmm didnt work for me $ cat .git/hooks/pre-commit #!/usr/bin/env -S nim --hints:off echo "123" $ ./.git/hooks/pre-commit Error: invalid command: ./.git/hooks/pre-commit Run @PMunch nimcr maybe the missing piece of the puzzle

State of HTTP Servers in Nim

2023-04-16 Thread pwernersbach
Makes sense. The lack of non-experimental compiler supported string views makes it really easy to write string parsing code that makes unnecessary temporary copies. For instance, this will copy in some cases: var readOnlyObject = ObjectType(readOnlyString: “foobar”) … let re

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread Smintheus98
I've done something like this before. I wrote a nimscript program and for any strange reason I don't remember anymore I wanted it to have no file extension. (Though usualy I prefer file extensions for the same reasons Araq mentioned.) I just looked it up and tested it once more. For me works:

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread PMunch
Be that as it may, they're fairly common, so supporting them in something like nimcr would be welcome.

execProgram() - Managing encoding outputs / indentation

2023-04-16 Thread Oecophylla
Hi, I am using the proc execProgram in order to execute simple windows commands like ipconfig, netstat etc. However, I stucked with encoding outputs I get from the proc ExecProgram(). For example the line execProgram("ipconfig /all") would return a string without any indentation and unprintabl

What GPT-4 knows and thinks about Nim

2023-04-16 Thread kobi
one last note, some people have gone much further. If you're interested, you can read here: I think the potential is skyrocketing, and the implications of how it might change society are worrying to say the least. I am unsure what to think abo

What GPT-4 knows and thinks about Nim

2023-04-16 Thread ElegantBeef
I also agree with @Zoom. Using LLMs to generate documentation is fine assuming one proofreads, edits, and validates. Which means you are just using it as a fancy writing aid instead of relying on it being right. Especially given I have seen multiple people act like LLMs are gospel and ask questi

What GPT-4 knows and thinks about Nim

2023-04-16 Thread kobi
me: If we want this to be a gui program, what options do we have in Nim? Nim has several options for creating GUI programs. Here are some of the most popular ones: > NimQT - a binding for the Qt GUI framework. > > Nimx - a widget toolkit for creating GUIs. > > GTK+ bindings for Nim - a binding

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread Araq
Filenames without extensions are a big misfeature of Unix anyway. It's like a "dynamically typed" variable, pure obfuscation.

What GPT-4 knows and thinks about Nim

2023-04-16 Thread kobi
Here is a sample output (this is with chatgpt), note that you can write specific details about the app or lib in question. In any case, it helps to get a roadmap of tasks going. me: A winzip clone Sure, here's what I intend to do: Purpose: The purpose of th

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread PMunch
I guess nimcr could be updated to add a `.nim` extension to files if they don't have one.

What GPT-4 knows and thinks about Nim

2023-04-16 Thread kobi
Well, to get back to examining working with GPT4 as a software developer, I recently tried, with gpt3.5 the following prompt. Can you try this in GPT4? I don't have ready access yet. Hello, I would like to understand and gauge how much AI's are accelerating work in society. For tha

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
yea my heuristic is nim is to nimscript as nimscript is to bash moving up the ladder makes sense depending on the context, but ideally im hoping to sunset bash unless necessary (e.g. the git hook thing)

What GPT-4 knows and thinks about Nim

2023-04-16 Thread termer
I was unaware this thread would end up being about the `Computer Programming with the Nim Programming Language` book, I also didn't make the connection that the author of that book is also this thread's OP. I recommended that book to my friend who I'm trying to get into Nim. I think it's very we

State of HTTP Servers in Nim

2023-04-16 Thread termer
I'm sure they get could a performance boost from it. When I was working on httpx, I noticed that in Valgrind it was reporting that a header parsing proc was the slowest of any. That tends to be the biggest pain point for performance in Nim, string handling. I think a lot could be done to improve

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread alexeypetrushin
> This is a bit different though, since you'll be running Nim code, and not > NimScript code. I consider this way as superior to NimScripts, as NimScript has some limitation, I don't remember exactly the problem, but my program didn't compiled when I run it as NimScript. And, I have feeling th

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
> In your case this can be solved that by creating a "wrapper" Git hook that > actually executes Nim to run your NimScript file with an extension. yeah i went with #!/bin/sh echo "executing nim tests" echo nim e .github/scripts/test.nims | while IFS= read

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread alexeypetrushin
#!/usr/bin/env nim r echo "hi" Run chmod +x hello.nim Run There's the problem though, nim refuses to run `hello` without the nim extension.

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread Yardanico
This is a bit different though, since you'll be running Nim code, and not NimScript code. For Nim specifically there's

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
ahh on the docs it clearly states > On Unix, you can also use the shebang #!/usr/bin/env nim, as long as your > filename ends with .nims: is there anyway to get around this? git hooks cannot have file extensions

noob question exception and await

2023-04-16 Thread noah
you should check the [asyncdispatch docs](https://nim-lang.org/docs/asyncdispatch.html) for async logic its recommended to use yield / asyncCheck instead of discard / try, except per your specific question, asyncCheck should be preferred

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Zoom
> The expression being imprecise can feel offensive. It's a very common term and usually implies the strength of economy, as measured by GDP. However, the fact is, you'd be hard pressed to find some other general economy criterion by which an average African country, for example, would lead com

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Stefan_Salewski
> This Co2 thing maybe ? Not really. I think they hate me from the beginning, that is spring 2014. Maybe because I said that I would like tabs for indentation. Well they have been unfriendly from the beginning, but not only to me, so I took it not too serious. Then maybe two years ago, just aft

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
i want to setup a git pre commit hook entirely in nimscript this means I cant execute the file with `nim e somefile` e.g. this file ## .git/hooks/nimprecommit #!/usr/bin/env nim echo "123" Run if executed $ chmod +x .git/hooks

Writing a wrapper for ML libraries how-to

2023-04-16 Thread Araq
Copy the headers to some file you feel free to edit, run c2nim over it, use options like `--nep1` and clean up/edit the headers until c2nim's result is good enough for Nim to compile. Then post your results here and ask for a more ideomatic Nim API.

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Zoom
I personally think your removing of the license was very preposterous. This things need to gain some momentum. MIT is not suitable for a book, I think you need some kind of copyleft license (possibly with a clause) so you still hold the right to publish and sell the book regardless of contribut

State of HTTP Servers in Nim

2023-04-16 Thread pwernersbach
The interesting thing is microasynchttpserver doesn't do anything substantial itself; it just reads the header data from an AsyncSocket, passes the header data to picohttpparser, and schedules the application callback with the data, to be completed via asyncdispatch. So you're essentially benchm

What GPT-4 knows and thinks about Nim

2023-04-16 Thread dlesnoff
> It is not easy to write a moderate reply... They do not deserve an answer and even less praise. I am shocked to see a moderator or "Community Manager" being so provocative. I am not understanding where exactly this anger comes from. [This Co2 thing maybe ?](https://github.com/StefanSalewski/N

What GPT-4 knows and thinks about Nim

2023-04-16 Thread tcheran
Hi to all, I seldomly write on this forum, but I read it and I still like Nim language and its community very much. The argument of this thread is intriguing and broad. I liked @Zoom thoughts/comments. I've played myself a bit with ChatGPT-3 and my feelings are mixed about it. I think is a signi

Writing a wrapper for ML libraries how-to

2023-04-16 Thread StrDev
Hi All, I am very new to Nim, but it seems highly interesting for data science. My nooby question is that is there any comprehensive tutorial or documentation (with best practices etc.), how-to write a wrapper for ML libraries, which otherwise expose a C++ API? E.g. XGBoost:

What GPT-4 knows and thinks about Nim

2023-04-16 Thread moigagoo
> I think your initial wording "misleading and dangerous" was not that good. I didn't even write that 😒 I couldn't be more neutral, honestly. It is misinformation because it's inaccurate and it is dangerous because it has to do with a very sensitive topic with regard to programming languages: s

Mono UI, high productivity, simple and clean code

2023-04-16 Thread alexeypetrushin
Thanks for the advice about `Karax DSL`, there are some reasons I use `h`, I'm going to finish some app, and then see what templating going to be the best option, right now I'm not sure. If someone would like to use `Karax DSL` it's possible, what matters is to return `HtmlElement or seq[HtmlEl

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Stefan_Salewski
> How does "Computer Programming with the Nim Programming Language" by some > dude qualify as a book? It is neither in print nor it does have a PDF/ebook > variant, from what I can tell. (While some other resources have those, and > are qualified as tutorials) It is not easy to write a moderate

Mono UI, high productivity, simple and clean code

2023-04-16 Thread Araq
I don't like the "stringly" typed code and unary pluses. Please just copy the DSL from Karax. ;-)

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Stefan_Salewski
> It's misinformation nonetheless. Yes, I will fix it. I just pasted in the unfiltered text first, to allow people to see the actual true GPT quality. And I was a bit tired, had some trouble with the doks theme of Hugo, its documentation it not that great, and its author currently focussed on u

What GPT-4 knows and thinks about Nim

2023-04-16 Thread moigagoo
> We used to have a phrase for that, the phrase was "that's wrong". Sorry, I'm not following your point. Are you unhappy with the word misinformation? Or dangerous? I just meant that since this is a publically available source of information about Nim, it's pretty harmful to the Nim image to te

Mono UI, high productivity, simple and clean code

2023-04-16 Thread Yardanico
Since the example link is broken, [here it is](https://github.com/al6x/nim/blob/main/mono/examples/todo.nim)

Mono UI, high productivity, simple and clean code

2023-04-16 Thread alexeypetrushin
Hi, I made UI for Nim, checkout [Video Demo](https://www.youtube.com/watch?v=vjj0mZOh5h4). **High productivity, simple and clean code** are main priorities. Checkout the [Todo](https://forum.nim-lang.org/\[examples/todo.nim\]\(https:/github.com/al6x/nim/blob/main/mono/examples/todo.nim\)) exam

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Araq
> I initially intended to remove that page again, as I did not want to further > split the community. But after Miram's nice comment, it will stay. So you really do want to split the community? Not sure how to read it in any other way. But spare me an explanation. Time to save lots of Co2 again,

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Stefan_Salewski
Actually, my feeling is, that it is good to ask GPT precise, single questions. First I tried to be clever and asked a lot, but the answer was marketing bullshit, so I ignored it: For a promotion and advertising website we need three short statements, that explains why the Nim programming langua

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Stefan_Salewski
I initially intended to remove that page again, as I did not want to further split the community. But after Miram's nice comment, it will stay. But he is correct, the short comment for my own book is not generated by GPT, but by me, as GPT said it does not know my book. And most of the links in

Nimforms - A simple GUI library for Windows

2023-04-16 Thread kcvinu
> doesn't work for me Any error messages ? Or any images ? It will be easy to understand what the problem is. What you said about GUI libraries is quite amateurish. I had similar thoughts in the beginning. I sent a mail to the creator of Python in 2010. Asking if a language without a visual GU

Nimforms - A simple GUI library for Windows

2023-04-16 Thread kcvinu
@mx1990, manifest file added to the repo. Just download it and place on your exe location. But remember one thing. The name of the manifest fie and exe file must match. For example, if your exe file's name is `app.exe`, then your manifest file must be `app.exe.manifest`. Otherwise it won't work.

Nimforms - A simple GUI library for Windows

2023-04-16 Thread kcvinu
Now i found the issue. You need the manifest file in your exe's location. I will upload the manifest file in my repo. You just need to place it near your exe file.

What GPT-4 knows and thinks about Nim

2023-04-16 Thread dlesnoff
I am curious, is the `main` function appearing in the code snippets something ChatGPT-4 proposed on its own or is it something you asked specifically for ? I am surprised the "Hello, world!" example is so much verbose: # Import the necessary modules import std/[strutils, os]

What GPT-4 knows and thinks about Nim

2023-04-16 Thread ElegantBeef
> How does "Computer Programming with the Nim Programming Language" by some > dude qualify as a book. It is neither in print nor it does have a PDF/ebook > variant, from what I can tell.? Wow so just saving a webpage as a PDF you too can own a book, the future of book making is now! Really thou

What GPT-4 knows and thinks about Nim

2023-04-16 Thread dlesnoff
@miran please, don't write this. You do not have to. You can still edit your message. Please chill.