Preview of coming attractions?

2021-12-01 Thread haxscramper
Maybe it makes sense to just admit fusion has absolutely no maintainers, and 
find someone who is willing to do the job? Think about enabling people to do 
the work for you instead of singling out me just because I happened to raise 
the problem. "you have to be patient" \- yes, and everyone using 1.6.0 and 
unable to compile basic example from the manual. (by the way, I said I'm not 
willing to shoulder the responsibility to make the API decision and 
self-approve them without any external review, this is different from being 
able to tag things. Latter one takes like five minutes at most, and does not 
have any major implications).


Advent of Nim 2021

2021-12-01 Thread al1ranger
My attempts at solving the problems using Nim can be found at 



Nimview - a lightweight UI helper

2021-12-01 Thread Dan
would love to see more of this, ie. tutorial from zero to hero


Nim at FOSDEM 2022 - CfP is open!

2021-12-01 Thread dom96
We're excited to announce that for FOSDEM 2022 there will be a Nim Programming 
Language developer room! This means we need talks and lots of them. The talks 
will be pre-recorded so it's a good opportunity for anyone who may not be 
confident speaking in front of a live audience.

For more details check out: 
.

Special thanks to @pietroppeter and @PMunch for pushing us to apply and for 
putting together the vast majority of the materials for our applications and 
CfP. It's awesome to see our community come together to make these kinds of 
events happen :)


Preview of coming attractions?

2021-12-01 Thread Araq
I could give you the rights so that you can fix and tag things on fusion. But 
you didn't want that so instead you have to be patient.


Will isValidSha1Hash in Nim 1.6's std/sha1 be backported to 1.2.x and 1.4.x?

2021-12-01 Thread Araq
We usually don't backport features so Nimble should emulate `isValidSha1Hash` 
for older versions. And right now not even 1.6.0 supports Nimble lock-files, 
once we support it we can backport the patch, yes.


Advent of Nim 2021

2021-12-01 Thread MichalMarsalek
I guess I'll put my repo here too:




nint128 - 128-bit integers

2021-12-01 Thread rockcavera
I've made some changes in nint128 to allow, when possible, to use the C 
extension of the GCC and CLANG compilers for 128-bit integers (`__int128` and 
`unsigned __int128`) or to use VCC compiler intrinsics. This adds the 
possibility of optimizations that compilers have for 128-bit operations.

For more information, visit 
[here](https://rockcavera.github.io/nim-nint128/nint128/nint128_cint128.html).


Read next string from stdin

2021-12-01 Thread Fire
This is something like that: 

 std/streams probably has a function for that though. For most IO tasks, you 
should probably use it.


Preview of coming attractions?

2021-12-01 Thread haxscramper
Main point was - two weeks after fusion is still not tagged and still breaks 
the code on 1.6, but since it is "not part of the plan" I guess this can be 
ignored. 


Read next string from stdin

2021-12-01 Thread nick14
Hello, I am new to Nim and I am trying to read a string similar to C++ 


string s;
cin >> s;


Run

So far, I have tried the following which is not correct: 


proc scanf(frmt: cstring) {.varargs, importc, header: "".}

var s: cstring # Not sure how to allocate it properly so that it is garbage 
collected
scanf("%s", s);


Run

Do you have any suggestions how to make this work or is there a better way to 
accomplish something like that? Thank you very much!


Read next string from stdin

2021-12-01 Thread Yardanico
You don't have to resort to C interop for this, Nim has basic IO functionality 
by default ;) 


let line = readLine()


Run


Read next string from stdin

2021-12-01 Thread nick14
Thank you for your reply! The stdin.readLine() is way better than what I was 
trying to do. Just out of curiosity, is it possible to not read the whole line, 
but read up to the next whitespace?


Preview of coming attractions?

2021-12-01 Thread Araq
> released roadmap does not even mention it

Fusion is not part of the plan. You want me to make decisions, I make 
decisions, and then I make the wrong ones. It's inevitable.

> nimble is briefly described as...

I could have linked to your RFC yes. Would it change anything? Would you be 
happy and not complain here? Exactly.


Will isValidSha1Hash in Nim 1.6's std/sha1 be backported to 1.2.x and 1.4.x?

2021-12-01 Thread brainproxy
`nimble >= 0.14.0` (i.e. `nimble install nimble@#head`) depends on 
`isValidSha1Hash` being supplied by `std/sha1`. So a related question/concern 
is whether the next gen `nimble` (lock files 🥳) will be compatible with future 
releases of Nim 1.2.x and 1.4.x?


Advent of Nim 2021

2021-12-01 Thread freeflow
Here are my efforts.




Preview of coming attractions?

2021-12-01 Thread haxscramper
I think I forgot to mention that `import fusion/btreetables` fails to compile 
on the 1.6 with `Error: undeclared identifier: ''` also because fusion is 
not properly tagged. 


This Month with Nim: November

2021-12-01 Thread xigoi
There's the online playground, but it's quite limited. If you really want to 
install xidoc without Nimble, you can manually do what Nimble does — install 
the dependencies and invoke the compiler.


This Month with Nim: November

2021-12-01 Thread kcvinu
Is it possible to play with xidoc without Nimble ? 


This Month with Nim: November

2021-12-01 Thread xigoi
Thanks to the curators for approving my article about xidoc, and to 
@pietroppeter for your kind words! If you'd like to turn my wrappers around 
KaTeX and Prism into a library, you're welcome to do so. Just keep in mind that 
they're quite rudimentary and made with only xidoc in mind, so you'll need to 
make some improvements.


Making a distinct type slightly less distinct

2021-12-01 Thread argl
Thanks, I was indeed missing a space. Fixed now. :)


Making a distinct type slightly less distinct

2021-12-01 Thread PMunch
You seem to be struggling with creating code blocks. What you are creating are 
in fact quote blocks which is why comments get turned into headers and the 
other errors you describe. If you scroll down to the "code block" section here: 
 you can see how to create a proper code 
block that even supports code highlighting.


This Month with Nim: November

2021-12-01 Thread pietroppeter
Good job @xigoi on xidoc. It looks very nice!

An interesting side project to extract from that would be to make some self 
standing wrappers for katex and prism (which thanks to duktape they could be 
usable with C backend). I would probably be using such libraries in nimib (a 
nice to have, not really a priority since I can always use them directly as JS 
libraries).


Making a distinct type slightly less distinct

2021-12-01 Thread argl
Thank you, this looks indeed helpful.

Regarding code blocks, yeah, I tried to apply them, but got tripped up because 
I wrote "..code-block:: nim" instead of ".. code-block:: nim". 


Making a distinct type slightly less distinct

2021-12-01 Thread argl
(This question is mostly about whether this approach makes sense or if there is 
a vastly easier way.)

For example, when working with 2-dimensional coordinates, I might define:

> type
>
>> X = distinct int
>> 
>> Y = distinct int

So that I can't mix up the types by accident, which could happen, if `X` and 
`Y` were just plain `int`.

So far, so good. But often I'd also like to conveniently do math with such 
types. So that these lines work:

> let
>
>> a : X = X(40)+X(2)
>> 
>> b : X = X(40)+2
> 
> assert a == X(42)
> 
> assert b == X(42)

(Side-note; should have been a comment in the previous code block, but it seems 
the forum interprets the leading # as instruction to print the comment as a 
LARGE TITLE): This must not compile: let c : X = 40 + 2

Currently I achieve this by creating overloads via template.

All the generated procs follow this pattern

  * convert parameters to base type if not of `distinctType`
  * pass converted parameters to `usedProc`
  * convert that result to `distinctType`



> template genImplicitUpconversion*(distinctType, usedProc) =
>
>> type
>>
>>> D = distinctType
>>> 
>>> T = D.distinctBase
>> 
>> proc usedProc (d0, d1: D): D = D(usedProc(T(d0), T(d1)))
>> 
>> proc usedProc (t: T; d: D): D = D(usedProc(t, T(d)))
>> 
>> proc usedProc (d: D; t: T): D = D(usedProc(T(d), t))

(Side-note; inside the template usedProc should be `usedProc`. But that causes 
an error about "Message needs to be valid RST! Error: input(49, 38) Error: '`' 
expected", so I left them out.)

This template is used again in another template that overloads all appropriate 
symbols (like +,-,*,div or /, ...), so that finally all that is required is:

> X.enableImplicitDistinctUpconversion()

My current implementation works but is less flexible than I would like. Before 
I dig in and make a proper macro out of all this, I wanted to make sure I'm not 
missing a relevant language mechanism or feature.

Does this approach makes sense or is there an easier way? 


Making a distinct type slightly less distinct

2021-12-01 Thread Yardanico
You can `{.borrow.}` operators for your distinct types, see 
 (when it gets to 
"The pragma borrow has been designed to solve this problem; in principle, it 
generates the above trivial implementations").


Advent of Nim 2021

2021-12-01 Thread hamidrb80
i put my solutions here: 
/

i also put Persian Translation here: 



This Month with Nim: November

2021-12-01 Thread miran


If you want to include your project for the next month (it doesn't have to be a 
new project), follow the instructions 
[here](https://github.com/beef331/website).


Preview of coming attractions?

2021-12-01 Thread haxscramper
Almost two weeks later, fusion is not tagged (surely it was hard to do), 
released roadmap does not even mention it, nimble is briefly described as "We 
hope to be able to ship a new Nimble with the 2.0 release but we are happy to 
ship it whenever it's ready."

So I think that

> I'm really sorry for your bad experience and I hope you'll come back

Pretty much amounts to "I will pretend I care, but I really don't, and this is 
certainly not something worth mentioning on the readme"

* * *

Reply prompted by review on the  (I 
haven't unsubscribed from notifications) - well, looks like it takes about a 
year to get someone to review stuff. I should've waited more, damn these slow 
email services.


Advent of Nim 2021

2021-12-01 Thread pietroppeter
> a generous Nim user who can share the contents of their nim based .vscode 
> directory

I do not have any special set up for vs code. I have used Saem extension 
instead of Konstatin's but both should be fine.

> This year I'm looking forward to using the new and exciting VBA replacement - 
> twinbasic. However, I'd also like to try translating my twinBasic solutions 
> to Nim

welcome and happy Advent of Code!


Advent of Nim 2021

2021-12-01 Thread sotolf
So I'm trying this for the first time, so this is probably very naive, but at 
least it works :) As simple as it gets with no optimisations.