learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread didlybom
I completely agree. The current situation is quite confusing.

File IO for the JS backend on node

2021-05-02 Thread enthus1ast
You can clone it, change the nimble file (lower the nim version number) then, "nimble develop" the repo and try to import it. I guess most people just leave the minimum nim requirements as nimble generates it on the module init

How to make Nim more popular

2021-05-02 Thread tedlavarias
Seeing how much IoT devices and "smart" home devices are getting so popular, Nim would be a far better option than Arduino's C/C++... I'm currently using MicroPython on a NodeMCU, primarily because it was easy to install with LOTS of documentation. I looked for Nim support first but the document

File IO for the JS backend on node

2021-05-02 Thread halloleo
Does your project _[really](https://forum.nim-lang.org/postActivity.xml#really) need at least Nim 1.4.4? I'm running Nim 1.3.5...

File IO for the JS backend on node

2021-05-02 Thread halloleo
Thanks @juancarlospaco! I'm checking it out.

File IO for the JS backend on node

2021-05-02 Thread juancarlospaco

File IO for the JS backend on node

2021-05-02 Thread halloleo
For the JS backend when running under nodejs, is there a module for File/Stream IO (maybe wrapping nodejs' [FS module](https://nodejs.org/docs/latest-v0.10.x/api/fs.html))? Sorry to ask this, maybe I overlooked something basic, but I couldn't find anything in the Nim doco about it...

Idiomatic way to run a process in the background and close it when appropriate?

2021-05-02 Thread codic12
Already looked at that. I'm just curious which function to use to be the most idiomatic as for what I described.

How does Nim ARC/ORC compare to Rust?

2021-05-02 Thread boia01
On the subject of "no refcount", I have a slightly tangential question... Strings and seqs in Nim are refs (with refcounts, albeit with copy semantics). As discussed in different threads, including [Multi-threaded features needed for Server](https://forum.nim-lang.org/t/7751) it is often desirab

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-05-02 Thread SerjEpatoff
> This is interresting, but plain wrong for major antivirus vendors. And > probably true for obscure antivirus vendors. Okay, not all AVs, but most of them. > When the compiler of a language if flagged as malware, it’s clear that the > signature used is pure crap. When the compiler of a langua

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-05-02 Thread SerjEpatoff
I guess the reason of these false-positives. Nim is rather popular among malware authors. Because it can produce very compact binary code, and because AST fully exposed via macros provides great code obfuscation capabilities to them. VirusTotal is a dumb piece of crap. All it does is just signa

There is no finish.exe in the NIM installation zip file

2021-05-02 Thread sekao
1.4.6 works fine for me on windows...but I don't run finish.exe. I just extract the zip and add the dir to my PATH.

Idiomatic way to run a process in the background and close it when appropriate?

2021-05-02 Thread juancarlospaco
CTRL+F for "Process" for its procedures.

Idiomatic way to run a process in the background and close it when appropriate?

2021-05-02 Thread codic12
I'd like to spawn a process and run it in the background. I'd also like it to be closed when and if the process finishes executing. I looked through osproc's functions, but I can't figure out what is the most idiomatic way to do this. Also, I'd like the call to block until it spawns the process,

Why async server fails with "Too many open files"?

2021-05-02 Thread alexeypetrushin
I have strange error, the server fails complaining too many files opened. import os, asyncdispatch, asynchttpserver, httpclient, httpcore proc run_server = proc handler(req: Request): Future[void] {.gcsafe.} = return req.respond(Http200, "ok") var server =

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread zetashift
In some way one could argue that strutils is one of the various alternatives for regex...but then we'd go into bikeshedding territory. > Standard library includes PCRE-based re and nre modules, as well as various > alternatives (ex. pegs (Parsing Expression Grammar matching), strscans, > parseu

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread juancarlospaco
I do not think you should open Bugs in Nim repo for Wikipedia.

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread ynfle
Maybe open an issue on github

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread lscrd
I think it would be inconsistent to mark `re` as deprecated and advise to use `regex` instead, while `re` is in the standard library and `regex` is not. If `regex` is now the right choice, the first thing to do is to add it in the standard library. Deprecation of `re` could follow.

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread masiarek2
yes, so what should be a correct comment on Wikipedia ?

regex

2021-05-02 Thread masiarek2
whoops - "re" and "regex" are different :-) ... read the manual ... : import regex match "uabyxabyzc", rex"ab.z": echo matches Run

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread juancarlospaco
But strutils is not Regular Expressions, jsre is Regular Expressions.

There is no finish.exe in the NIM installation zip file

2021-05-02 Thread Araq
1.4.6 is currently unusable on Windows, please use instead. No, it's not a real thread, it's just that anti virus software doesn't work.

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread alexeypetrushin
Maybe it would worth to add `UPDATE: deprecated, use regex instead" to the top of `std/re` and `std/nre` documentation pages.

regex

2021-05-02 Thread masiarek2
works fine: import re echo find("uabyxabyzc", re"ab.z") # found pattern "ab.z" at position 5 Run when I flip from re to regex: import regex # <== change "re" to "regex" echo find("uabyxabyzc", re"ab.z") # found pattern "ab.z" at position 5

There is no finish.exe in the NIM installation zip file

2021-05-02 Thread Arskeliss
I can't find the finish.exe file nowhere in the Nim install zip file. WHat should I do?

wikipedia: nim reference - regex engines - comparison

2021-05-02 Thread masiarek2
How I should update wiki page: * Currently the comment is: * Standard library includes PCRE-based re and nre modules, as well as various alternatives (ex. strutils, pegs (Parsing Expression Grammar matching), strsca

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread ynfle
stdlib means that it will be required to `import` it. only `system` module is automatically imported

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread masiarek2
@didlybom1h , what languages add regex to the core / stdlib? But I guess even if there are languages do this - the next question is - would it be the right thing to do? I was learning Ruby and Python before - they both must import regex... There is probably a good reason for this behavior.

Overridable operator precedence

2021-05-02 Thread mark
you can high up you rank in fortnite by using www.proboosting.net

How does Nim ARC/ORC compare to Rust?

2021-05-02 Thread Araq
> If I'm correct in this, ... Yes, you are. > it should be possible to add a minor "no refcount" pragma to Nim about a type > or piece of code, which will make that type or piece of code behave exactly > the way Rust does for those places where it's important (and possibly drop > the reference

Overridable operator precedence

2021-05-02 Thread mark
sadf

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread didlybom
@Araq, thanks for the clear answer. This is something I’ve wondered myself in the past too. Are there any plans to bring the regex into the stdlib?

How to make Nim more popular

2021-05-02 Thread linwaytin
I'm new to Nim, but I think one possible direction is microcontrollers. Nim has a unique feature: compiling to C. As far as I know only a few modern languages have this feature, and among them Nim is the most active one. People working on microcontrollers use assembly before, and they use C now

How to make Nim more popular

2021-05-02 Thread DavidKunz
Hi, As someone who just recently discovered Nim, I can recap what made me learn more about it: 1) Someone must mention it somewhere _outside_ its realm (Hacker News, Reddit, YouTube...). ✅ If no one talks about it, people will never know. It's important to write more blog posts, comment on va

How to make Nim more popular

2021-05-02 Thread lscrd
Yes, this is a long list, but these are mostly drafted tasks. I will look at them later. As regards old code, you are right, but I updated it and replaced it in some rare cases. For now, all examples in the main tasks run with Nim version 1.4, at least until letter Y (letter Z is in progress).

How to make Nim more popular

2021-05-02 Thread dom96
I believe the best way is to either: * Get your company to adopt Nim, once successful start paying the Nim "foundation" (as an aside it would be really nice if we could get a formal one like the Rust foundation) for support and write about why Nim helped your company profit. * Start a compa

How does Nim ARC/ORC compare to Rust?

2021-05-02 Thread cumulonimbus
I might be wrong here, please correct me if so, but: I think that equivalent code written in Rust and Nim would generally result in similar or even equivalent code that calls destructors and does not increase or decrease reference counts. Code that would actually modify reference counts in Nim

Overridable operator precedence

2021-05-02 Thread cumulonimbus
I know we're all used to operator precedence from elementary school and in programming languages, but beyond the very basic rules, most people find them very confusing -- especially with semantics vs syntax (e.g., many people assume << in C has the same precedence as * because they are both mult

CRC16 checksum calculation

2021-05-02 Thread takekikuchi
like this ? proc createCrcTableLeft(poly: uint16): array[0..255, uint16] = for i in 0..255: var crc = 0'u16 c: uint16 = uint16(i) shl 8 for j in 0..7: if ((crc xor c) and 0x8000) > 0: crc = (crc shl 1) xor poly

How to make Nim more popular

2021-05-02 Thread cblake
I don't know - This looks like a pretty long list, though:

Use proxy and ports httpclient

2021-05-02 Thread enthus1ast
Please try to also specify the scheme like: "http" or "https" for example: ""

How to make Nim more popular

2021-05-02 Thread Sixte
> Almost all tasks have now a Nim solution Do we already have a Datalog implementation there?

Why learn NIM

2021-05-02 Thread Sixte
> Does ARC/ORC work on the microsecond time scale or millisecond? Well, you can expect that ARC works on the nanosecond time scale because it acts strictly pointwise. However, the surrounding OS might have its own runtime, e.g. for handling of `malloc``and ``free`. This is independent of the la

How to make Nim more popular

2021-05-02 Thread alexeypetrushin
I think proving that languageX is mature and ready for real use is important. I see 2 ways to prove 1) killer app 2) rely on already proven tech. When I tried Nim, its ability to be converted to JavaScript was important check. As it gives the worst case guarantee. If Nim runtime works - great I'

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread Araq
You should use `regex`.

How does Nim ARC/ORC compare to Rust?

2021-05-02 Thread Araq
In reality Swift, C++, Nim and Rust all work very similarly. At the same time there are big differences in the details. Rust also uses a garbage collection system based on reference counting ... ;-) Yes, really. It uses 1-bit reference counts under the covers and full reference counts for `Rc`

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-05-02 Thread lscrd
I agree. When many AV software have exactly the same behavior on the same binaries at the same moment, this is highly suspicious. And the extraction of a signature from malware is clearly poorly done. No check has been done to insure that this signature is specific enough. When the compiler of

How to make Nim more popular

2021-05-02 Thread lscrd
Regarding Rosetta contributions, I’m afraid it’s too late. Almost all tasks have now a Nim solution. Of course, it is always possible to improve an existing solution, to replace it or to add a new solution, using another algorithm or another library. And there is still a lot of work to do on dr

How does Nim ARC/ORC compare to Rust?

2021-05-02 Thread DavidKunz
I talked about it on Hacker News the other day and withoutboats (Rust contributor, implemented async await in Rust) said: withoutboats2 43 days ago [–] "It is not at all like Rust; it is a garbage collection system based on reference counting, pretty similar to Swift. This is obscured by the d

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-05-02 Thread m33
> AV industry is totally degenerated and useless nowadays. They don't realize > what they actually do. They don't have detection engines. Just making money > from dumb wrappers around VirusTotal. This is interresting, but plain wrong for major antivirus vendors. And probably true for obscure an