Initial OS porting experience

2022-11-26 Thread sls1005
> it outputs several C and object files with for humans unpredictable file > names. It's predictable, if you know how to. For a module named `test1.nim`, it generates `~/.cache/nim/test1_d/@mtest1.nim.c`, and for `../../path/to/test1.nim` it generates `@m..@..@path@t...@test1.nim.c`, so it jus

Initial OS porting experience

2022-11-26 Thread elcritch
Thanks for the writeup! I've ported Nim to two operating systems with pretty similar results. Though I can add a few notes. While importing `os` brings in a lot, Nim will skip the parts of a module you don't use. You might still need to ensure the posix constants are defined or faked. In a few

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread AllNatural
One of the best posts for people like you and me who are struggling to escape the language decision analysis-paralysis!

Initial OS porting experience

2022-11-26 Thread elcritch
Also, at work I've had to learn a lot of cmake recently at work. I do think theres a few ways to make Nim play a bit nicer with cmake. A simple route would be to include the `nimcache/myproject.json` as an input that cmake knows about. Then if the json list of C files changes, cmake builder bac

Initial OS porting experience

2022-11-26 Thread RodSteward
> Did you look into our os.nim refactorings? It's now split up into different > topics. No, what are these and how do I obtain the information about this?

Initial OS porting experience

2022-11-26 Thread RodSteward
> A simple route would be to include the nimcache/myproject.json as an input > that cmake knows >about. Then if the json list of C files changes, cmake > builder backends can trigger a cmake >reconfigure stage. I'm confident this > will work for at least the Ninja outputs from cmake. Its actuall

Any libraries for dictionary coding (compression) of array structures ?

2022-11-26 Thread cblake
Since gzip is lz77 + huffman coding and lz77 is basically a [sliding window dictionary coder](https://en.wikipedia.org/wiki/LZ77_and_LZ78), and since zippy is a pure Nim re-write of gzip algos, you might be able to extract/adapt relevant parts of . I'm not sure it

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread monster
A few years back, I've spent a while coding some libraries with Nim, for a personal project. Eventually I stopped, bc I gave up on that project. The biggest issue I had with Nim then was "undecipherable" error messages/traces, both at compile time and at run-time. I wanted "amateur/junior coders

Weird ICE

2022-11-26 Thread japplegame
It looks like a bug caused by a combination of a `var` parameter assignment , a `case` expression, a `noreturn` procedure, and CTFE: # test.nim proc raiseError(msg: string) {.noreturn.} = raise newException(Defect, msg) proc change(v: var int, s: string) = v =

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread bet3lgeuse
Thanks for the kind words, Araq. Would be my pleasure if you chose to do so. I probably have a few mistakes to iron out; will give it a scan.

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread RodSteward
While in Nim has in general a pleasant syntax, if there is one obvious area it can improve then it is the tagged enum syntax. Right now it is kind of complicated and goes against the ethos of Nim which is concise syntax. This post explains it quite well.

Weird ICE

2022-11-26 Thread sls1005
It mentioned `rkNode`, so it seems to be an internal error, a compiler bug. However, I don't think the code is valid. v = case s: of "A": 11 else: raiseError("invalid value") Run As `raiseError` doesn't return `int`, the compiler will think that y

Weird ICE

2022-11-26 Thread japplegame
> It mentioned rkNode, so it seems to be an internal error, a compiler bug. And > that's why I used the abbreviation ICE (internal compiler error). > However, > I don't think the code is valid. I do not think so. `raiseError` is marked > with the pragma `noreturn', so the compiler should correct

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread SolitudeSF
> Have error messages/traces readability improved, or do you still need to look > at the generated C code, and mentally map it back to the original Nim code, > to understand what the compiler is trying to tell you? they improved, but you're overdramatising.

Open XML Spreadsheet (Excel) Library for Nim

2022-11-26 Thread bobd
@Ward \- Is it compatible with the JS backend? Or could it be made compatible? Would be nice to have this running in the browser.

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread 0atman
Agreed, I've never experienced such a problem in Nim, I started coding with it in 2020

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread 0atman
The only knock that static languages like nim/rust/go is in data science, I think - a fat, long-running runtime is actually an asset not a liability there - but don't forget about interactive use with ! Nimble's integration with inim is still much ahead of whe

Weird ICE

2022-11-26 Thread sls1005
Then it's a bug of the compile-time VM. It should have checked for `{.noreturn.}` but it didn't.

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread Hlaaftana
This seems way too opinionated to post on the Nim website IMO

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread Hlaaftana
Before someone gives the stock answer of "you can just use macros": I agree that this stuff should be easier to write. And there is no popular or standard macro library that lets you do this, despite not being very hard to implement. However the existing way of doing it in the language should re

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread Araq
I don't mind the syntax of case objects and it works better than Rust's and Swift's solutions, all things considered. A macro could be added to `sugar.nim` for the people who disagree and want more sugar. I'm not a fan of a macro for this because my code simply contains too few object cases fo

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread moigagoo
It's a real-life story, those can't be unopionated. This shouldn't be posted as a official statement on behalf of the Nim team, sure. But as a person sharing there experience, this is a legitimately good story IMHO.

Electron in nim like Tarui and Wails v2

2022-11-26 Thread alexeypetrushin
Ok, I see. It's a **low-level bridge** between WebView and Nim. It can be used to build simple forms etc. But can't be used for complex UI, as it would require some sort of higher level framework, like Karax etc.

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread jasonfi
It's more of a blog article. But either way, it could still be posted on the site.

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread ricky222
> The JVM is an easy target but it is a brilliant feat of engineering and > solves very different problems than what Nim solves. It will be around for a > very long time. Computer history codger here. JVM stood on the shoulders of Forth and UCSD Pascal (among others) The Forth world explored di

Electron in nim like Tarui and Wails v2

2022-11-26 Thread juancarlospaco
Any UI that targets JS can be used, including Karax, JS vanilla, SVG, Nim stdlib nimf, Nimx, canvas, Latex MathML, NodeJS UIs, etc.

Weird ICE

2022-11-26 Thread japplegame
> It should have checked for `{.noreturn.}` but it didn't. Not exactly. This compiles well: # test.nim proc raiseError(msg: string) {.noreturn.} = raise newException(Defect, msg) proc change(v: var int, s: string) = let tmp =

Electron in nim like Tarui and Wails v2

2022-11-26 Thread alexeypetrushin
[quote]Any UI that targets JS can be used[/quote]Hmmm, then what's the point of using webgui? If you target JS (with Karax), you can use Electron or any other WebView libs, you don't need any integration with Nim.

How can nimqml being used with docker?

2022-11-26 Thread filcuc
again what do you mean? 1. do you mean compile an app through docker? this is done by the CI so look at the code in the github actions 2. DOtherSide doesn't take long to compileit could take long if you have pre i5/i7 cpu otherwise it may take a minute or two. But againif you compil

Weird ICE

2022-11-26 Thread Araq
Report it on github please.

Atomic ARC option?

2022-11-26 Thread boia01
The concurrency model that I'd like to see better supported in Nim is something along the lines of persistent data structures that support multiple-readers and a single-writer: * Imagine an isolated graph of objects (refs). * This graph is be accessed through something like `SharedPtr[ref T]

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread radekm
I'm mostly Kotlin and F# programmer and one of the biggest advantages of Nim over those languages is deterministic performance and super easy FFI with C.

Atomic ARC option?

2022-11-26 Thread Araq
Reminds me of something that is called "ballon types" but maybe I misremember and I cannot find the paper on it anymore either.

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread elcritch
I'm generally satisfied with patty macro. Its in the first nimble query you gave and provides both the declaration and a match syntax: variant Shape: Circle(r: float) Rectangle(w: float, h: float)

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread RodSteward
Patty looks pretty nice. Is there a chance that this can get into the standard sugar library?

Choosing Nim out of a crowded market for systems programming languages

2022-11-26 Thread sekao
Sorry, hombre, but your reply wasn't even remotely coherent. I have no clue what point you are trying to make.

Without Having to Buy Ads Creating An App

2022-11-26 Thread pappusseeobd
Because copyright laws exist Using someone else's image even if it contains your own product The owner is still the person in the picture. Therefore they have the right to allow you to use the images or not. The safest way is to ask permission Very give creit. Which today we will present a metho

What do I need to study a safety course at work

2022-11-26 Thread Rumi15
Have you undergone several technical trainings and are you considered excellent professionals who know how to combine their technical skills with the needs of every system you come into contact with? Why don't you take a maintenance managers course and expand your abilities to the areas of manag

imported C++ type naming

2022-11-26 Thread sls1005
For an imported C++ type whose name conflicts with an existing Nim type (like `std::string`), should it be prefixed with `C` or `CPP`? or should it be imported as `String`?

`cast` broken?

2022-11-26 Thread yrashk
This should work, though (as @amadan pointed out, `int` in Nim is not of the same size as `int` in C): assert cast[cint](a) == 10 Run

`cast` broken?

2022-11-26 Thread sls1005
Oops... I can only `cast` variables with the same size, right?

Plans for improving tagged enum (ADT) syntax?

2022-11-26 Thread xigoi
I'd prefer something that can integrate with the existing syntax instead of requiring a standalone block. type Foo {.variant.} = object case kind of Alpha: i: int of Beta: f: float of oamma: s: string Run

Do you have to use 'ref' for the field types within ref objects?

2022-11-26 Thread Niminem
Consider this: import tables, strtabs, lists type KnowledgeGraph = ref object nodes: TableRef[string, StringTableRef] links: TableRef[string, seq[SinglyLinkedNode[string]]] Run Is it necessary to use `TableRef`s and other `r

Do you have to use 'ref' for the field types within ref objects?

2022-11-26 Thread Niminem
Thanks for the feedback. And I had no idea that Nim automatically passes by reference when it's faster either, do not remember coming across this in the docs.. but that's pretty cool!

Do you have to use 'ref' for the field types within ref objects?

2022-11-26 Thread ElegantBeef
Nim automatically passes by reference when it's faster than passing by copy, so no you do not need to always use `ref`. Given how much `ref` issues come up it really seems someone really needs to make a good doc to refer to. You use `ref` if you want reference semantics otherwise you do not need