Trying to make a lexer, stops if it hits an operator.

2023-01-15 Thread BombManYeeted
I've made a new lexer, since I had a hard time making a parser. Here it it: import std/strutils import std/os let file = readFile(paramStr(1)) type tokenName = enum default, unknown, ident, str, integer, double, keyword, operator, seperator

BigNum and BigInt timings on the Pollard Rho algorithm

2023-01-15 Thread mratsim
> A big frustration I have with extant languages is how most of the techniques > for manipulating the boundary between comptime and runtime -- generics, > static[], specialization of such, etc -- is invariably pretty limiting/buggy > to work with compared to what I think it could/should be. I've

Ttop - System monitoring service tool with tui and historical data

2023-01-15 Thread inv2004
@nasl I think that temp/throttling (IDK what is utilization) is very good idea, let me check how to do it

How to incrementally convert a C or C++ project?

2023-01-15 Thread elcritch
Nim can certainly handle incremental conversion of both C/C++ codebases. As @araq says if it's possible to rewrite, it can often be smaller and easier to do so. However, as you mention it's not always feasible. There's two main routes to take here: First route: treat your current C/C++ as a lib

How do I fix this?

2023-01-15 Thread Nlits
I’m trying to make a better alternative to nimpretty, but I think it is out of my scope for now, although I might try again later.

How do I fix this?

2023-01-15 Thread shirleyquirk
you could file an issue on @elcritch's github, but i'm pretty sure this never worked properly. to start with, it truncates the names of each node incorrectly, so you'll need to `s/substr(3)/substr(2)/` This is an instance of the same issue i liked before; a converter is defined that converts t

static assert fails

2023-01-15 Thread elcritch
In that case make sure you also use —cpu:arm64 as well. The static assert occurs when you’re telling Nim to compile for arm (32 bit) but the C compiler is using arm64 (64 but). Generally it’s best to not provide the —cpu option and just make sure you install the arm64 version from brew or elsew

How do I fix this?

2023-01-15 Thread Nlits
Code: import system except NimNode import compiler/macros2 import std/[os, strutils] type GoldConfig = ref object proc processFile(path: string, config: GoldConfig) = echo "Gold: ", path let data = readFile(path) echo data.parseStmt().astGen

Nim v2: what would you change?

2023-01-15 Thread yeabsira
i think there should be improvements at 1. gui libs, no usable lib nimx is almost no doc except git readme 2. there should be one one and obvoius way to do things rather than multiple way 3. there should be a dir() like function like python, to list describe about a module 4. promoting t

This Month with Nim: November and December 2022

2023-01-15 Thread yeabsira
thanks guys we developers are waiting even more from you, keep it up

How do I fix this?

2023-01-15 Thread shirleyquirk
There's something in the code that _[you](https://forum.nim-lang.org/postActivity.xml#you) wrote, probably something that calls astGenRepr from macros2, that triggers the bug. What's in `gold.nim`?

How to incrementally convert a C or C++ project?

2023-01-15 Thread ggibson
@Araq thanks for the response and reasoning. I think what you suggest may hold true for C projects, but what about C++? I admit I should have made my demonstration in C++ because that's actually the situation I'm more curious about, but I made C more out of habit for simplicity. Yes you're righ

static assert fails

2023-01-15 Thread ecarl42
A few things I can think of to verify. Check the `nim` binary: file `which nim` Run and will output something similar to: /opt/homebrew/bin/nim: Mach-O 64-bit executable arm64 Run then test the binary that was created by `nim`: file

How do I fix this?

2023-01-15 Thread Nlits
That would be nice, but I can’t seem to reproduce it. I tried here: but it works fine

BigNum and BigInt timings on the Pollard Rho algorithm

2023-01-15 Thread pietroppeter
> for division, expect days of debugging, everyone gets it wrong, even Google > in Go and JavaScript Incidentally, it was recently found out that bigints has a bug in its division implementation:

BigNum and BigInt timings on the Pollard Rho algorithm

2023-01-15 Thread fsh
Heya mratsim! When I first got into Nim, you're the person that kept coming up time and time again for the stuff I was searching--including feature requests--so I think we have a lot of overlapping interests (even go, judging by your github picture). > But it is doable, for example for size sui

static assert fails

2023-01-15 Thread bw98
I did install via choosenim but I also tried installing it through brew which does install the arm version and made sure to specifically invoke that one when compiling and it still gives me a static assert error on a single echo statement nim file.

How do I fix this?

2023-01-15 Thread shirleyquirk
The best thing would be a minimal example that, when compiled, gives the same error. That means, enough code for someone else to be able to compile on their machine and get the same error, but as short as possible.

Every month you hope the cash flow goes the right direction

2023-01-15 Thread rimu
We preach it every week. Attract the right kind of traffic by creating exceptional content. Engage your audience so they know, like, and trust you. Let them know you’re the likable expert who’s going to give them the information (and eventually the products and services) that won’t let them dow