Long string in source file

2023-04-23 Thread Over_score
Yes, fewer chars, but it isn't a matter of fewer chars…

Long string in source file

2023-04-23 Thread Araq
Well it's not like I'll change the language because you "don't find that very nice" so any further discussion is futile.

EU Cyber Resilience Act impact on Open Source community

2023-04-23 Thread Araq
The EU will fuck it up, as always. Like it did with all the crazy annoying enforced "danger zone: cookies used here" banners or the ban on drinking straws. Now that we don't use drinking straw made of plastic anymore the oceans are finally recovering. Sure, sure.

Small experiment with compiling the Nim compiler with PGO

2023-04-23 Thread Yardanico
Yeah, I wanted to try Nimbus, it doesn't work with devel, but I might just PGO Status' fork and see

Small experiment with compiling the Nim compiler with PGO

2023-04-23 Thread arnetheduck
Interesting - I wonder if the results hold up on slightly larger projects as well! Compiling Nimbus () now is creeping up into the minutes range, most of the time being spent in the garbage collector (see ) - th

Viability of a website generator using nim.

2023-04-23 Thread choltreppe
Yep its not that complicated, I have written a small library called [polyrpc](https://github.com/choltreppe/polyrpc) for doing that for different server/client pairs (including a simple way to define your own interface, if its not included). Its not in nimble yet because its not tested that ext

Small experiment with compiling the Nim compiler with PGO

2023-04-23 Thread Yardanico
I've made some code to automatically PGO the Nim compiler quite a long time ago, but never got to actually get something useful out of it until now :) If you don't know, PGO allows you to profile programs on real data and then feed that profile to the compiler (the C compiler in our case) so it

Viability of a website generator using nim.

2023-04-23 Thread Araq
> A pipe dream? Doesn't look that hard. Call the compiler twice, one time for the native code generation that produces the HTML so you need to run the binary, one time to produce JS code.

Viability of a website generator using nim.

2023-04-23 Thread JohnAD
@alexeypetrushin A good set of goals is a good thing! A website development tool that creates the content for two servers: A front-end with: 1. a clean mix of single-page-apps for reading (think live reading with ajax etc); each sub-app at a different URL for good bookmarking. Each sub app i

Viability of a website generator using nim.

2023-04-23 Thread JohnAD
I know of this type of thing: I covered it in one of my videos; IIRC. The catch is that you are not compiling to html/js; but compiling to an executable that, in turn, generates the html. Using the above file as an example.

Viability of a website generator using nim.

2023-04-23 Thread alexeypetrushin
It would be better to clearly specify the goal, what do you want from this wramework. Right now it sounds like good farmer tractor, that also should be good ennough for car racing. 1. interactive mobile/desktop web app b) classical web2.0 website like shopify e-commerce? etc. c) ...

Viability of a website generator using nim.

2023-04-23 Thread Araq
The Karax DSL can also be used in a native code setting to produce static websites. I'm sure the repo contains an example for that somewhere...

Viability of a website generator using nim.

2023-04-23 Thread JohnAD
The website generators written in nim tend to fall into two types: 1. An all-in-one website dynamic generator that is meant to build an actual web server. Think Karax and the like. 2. Static website-generators written in Nim but use generic text templating. The benefit of type #1 is that t

Viability of a website generator using nim.

2023-04-23 Thread JohnAD
For a double-bonus: have this generator framework also create the website's API server. So that at compile-time the front-end JS content is verified against the API server code.

Long string in source file

2023-04-23 Thread Araq
> It works with .replace(…), but I don't find that very nice So what, objectively it's fewer chars than in C.

wasMoved and =destroy does not cancel each other out

2023-04-23 Thread Araq
> a =destroy is removed if the object is (un|default|zero)initialized in all > paths leading to it Something similar is already done by the "cursor inference" and in practice the C(++) codegen can do the elisions too, they are usually obvious enough after inlining. Unless some benchmarks show b

Long string in source file

2023-04-23 Thread Over_score
It works with .replace(…), but I don't find that very nice

Long string in source file

2023-04-23 Thread Yardanico
Well, as I said you can still use it, you'd just have to do more work: const DoublePi = """ +6.2831853071795864769252867665590057683943387987502116419498891846156328125724179972560696506842341359 642961730265646132941876892191011644634507188162569622349005682054038770422

Long string in source file

2023-04-23 Thread Over_score
Yardanico is right. With the triple double quote string, the string contains newlines…

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

2023-04-23 Thread lf_araujo
Also there is nimsh, a shell in Nim:

Is there still interest to develop INim or are there better Nim REPL?

2023-04-23 Thread lf_araujo
Yes, fork away! I wanted to like in, but it often misses the indentation, even if typed correctly. Also hot code reloading would be a massive improvement.

Long string in source file

2023-04-23 Thread Yardanico
Just don't forget that with the solutions above the string will have newlines where you have a newline, so you should remove them afterwards, e.g. with replace. Since your variable is static you could do all that in a const.

Article on wrapping C libraries in Nim

2023-04-23 Thread adokitkat
Hi! I necessarily don't want to create a new separate project if you're open to change up nesper. I was not aware of `cimporter` either. I don't quite like that futhark bundles everything to one file as well. To be fair I just experimented with futhark and I'll try cimporter next. Maybe we could

Long string in source file

2023-04-23 Thread blackmius
var a: string = """ +6.2831853071795864769252867665590057683943387987502116419498891846156328125724179972560696506842341359 642961730265646132941876892191011644634507188162569622349005682054038770422928924589790986076392

Long string in source file

2023-04-23 Thread planetis
Hi, you might want to check out:

Is there still interest to develop INim or are there better Nim REPL?

2023-04-23 Thread auxym
This is just my opinion, but if the maintainers are unresponsive, or even if your opinion just diverges from the maintainers', then its perfectly reasonable to fork the project (with a name change) to continue development. That's what open source is for! Most discussion happens either here or i

Long string in source file

2023-04-23 Thread Over_score
Hello all, I'm new to Nim (but not to C) In C I can write: char *twoPi = "+6.2831853071795864769252867665590057683943387987502116419498891846156328125724179972560696506842341359" // 101 "642961730265646132941876892191011644634507188162569622349005682054038770

wasMoved and =destroy does not cancel each other out

2023-04-23 Thread Sentmoraap2
What do you think about generalizing the destructor removal rule like this: * a `=destroy` is removed if the object is (un|default|zero)initialized in all paths leading to it * a (zero|default)-initialization is removed if it's not used (including `=destroy` calls) until it's assigned. AFAIK

Is there still interest to develop INim or are there better Nim REPL?

2023-04-23 Thread davidf
Hi Noah, thanks for the answer. Maybe it was not clear from my post, my question was just like, if I wanted to develop that library further, can I just fork it and go my way? The authors are not answering on github and I would like to get in touch with them, also to ask few things about the cod

Pass generic proc object different sub-types

2023-04-23 Thread cmc
Thank you very much! Now considering if using typedesc params might be a smoother UI but maybe `f.deriveDifferentFoo[: string, float]()` is fine.

Pass generic proc object different sub-types

2023-04-23 Thread xigoi
This is basically the same problem as the “turbofish” in Rust.

EU Cyber Resilience Act impact on Open Source community

2023-04-23 Thread tcheran
I was asking if someone had read about those concerns, the "papers" I've posted are much more approachable than the EU regulation text, likely not for the laymen (or boring to death...) Rules are important... think about how software licences like GPL (and later more liberal ones like BSD and M

Pass generic proc object different sub-types

2023-04-23 Thread ElegantBeef
https://nim-lang.org/docs/manual.html#procedures-method-call-syntax

Why nim discord library is slower than python's discord library?

2023-04-23 Thread Luethlee
Thank you, I was not doing `-d:release`. I am going to check that!

Pass generic proc object different sub-types

2023-04-23 Thread noah
do yo have a link in the documentation for the `:x` syntax ?

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-23 Thread termer
Interesting, I'll look into those methods. You bring up a good point about file descriptions, I ran into a similar issue when using file descriptors to create tiny, frequent events.

Pass generic proc object different sub-types

2023-04-23 Thread ElegantBeef
`f.doThing[x]` is interpreted as `[](f.doThing, x)` as such you need to use the `f.doThing[:x]()` syntax ala: type Foo[A, B] = object a: A b: B x: int proc initFoo[A, B](x: int): Foo[A, B] = result.x = x proc deriveFoo[A, B](f: Fo