Upcoming "Nim for Pythonistas" talk at PyCon Italy

2024-05-27 Thread pietroppeter
thanks @PMunch, @Niminem, @moigagoo, @thegraynode :)

here is a link with the timestamp for better ease of finding it: 
[https://www.youtube.com/live/fDN2iJri7W0?si=uKysPLyCofnYT3Ky=17037](https://www.youtube.com/live/fDN2iJri7W0?si=uKysPLyCofnYT3Ky=17037)

Sometime in the future (my guess as of now would be in about 3 months), there 
should be a self standing video, hopefully with a better audio. As much as I 
dislike rewatching myself speak ;), I have listened again to the first few 
minutes and audio is definitely not great but it does not seem too terrible. 
Maybe the edited version might have improvements (or not, no clue if they do 
some processing).


Upcoming "Nim for Pythonistas" talk at PyCon Italy

2024-05-24 Thread pietroppeter
For those curious you can already access the talk in the full stream of the day 
<https://www.youtube.com/live/fDN2iJri7W0?si=t3xV3clPshKlCcbc> (Starts at 
4:43:57, did not find a way to add timestamp from mobile).

Slides are here: <https://github.com/pietroppeter/nim-for-pythonistas>


Where does the complexity of quote from the manual comes from

2024-05-24 Thread pietroppeter
To give a bit more context to my question in case someone is interested, I was 
attending this interesting talk 
 (slides here: 
) and an amusing reference the speaker 
gave is about the complexity clock: 


Oddly enough that last blogpost somehow finds DSLs as a later step of 
degradation of software but reading more actually one of the reason they 
struggle with DSLs is that they are tough to debug, not checked… almost like 
DSLs could benefit from a language particularly apt at generating them :)


Where does the complexity of quote from the manual comes from

2024-05-24 Thread pietroppeter
Thanks Yard! That’s really excellent detective work. I just skimmed through 
that old thread and it is definitely a gem (there is even Matz from Ruby 
popping in at one point). And Ran Talbott seem to have written books on 
Commodore and Vic-20…


Where does the complexity of quote from the manual comes from

2024-05-24 Thread pietroppeter
> "Complexity" seems to be a lot like "energy": you can transfer it from the 
> end-user to one/some of the other players, but the total amount seems to 
> remain pretty much constant for a given task. -- Ran

I really like it but I have no idea where it comes from, who is Ran and what’s 
the backstory there (if any).

Did a quick attempt at googling but failed to get answers. Does someone knows 
more about it? Thanks!


Upcoming "Nim for Pythonistas" talk at PyCon Italy

2024-05-22 Thread pietroppeter
Hi everyone, this Friday (after lunch) I will be giving a talk titled [Nim for 
Pythonistas](https://2024.pycon.it/it/event/nim-for-pythonistas) at PyCon Italy 
in Florence. It will be streamed live (on the "Spaghetti" stream for Friday in 
[Python Italia Youtube](https://www.youtube.com/@PythonItalia/featured)) and 
later will be made available as its own video. I hope you find it interesting, 
enjoy!

And of course if anyone at the conference is curious about Nim, come say hi!


Rex - The starting point of a ReactiveX implementation

2024-05-06 Thread pietroppeter
TIL 

Looks interesting, thanks for sharing!


Anonymous chat service, powered by Nim

2024-05-03 Thread pietroppeter
> Messaged you. Did you get it?

no but I imagine I should be connected to receive it right? I tried now but 
what I see is that as soon as I send the message it is not even recorded on my 
side. is that because you did not receive it and so the message is not recorded 
in the conversation?

very cool work @moigagoo!


Anonymous chat service, powered by Nim

2024-05-02 Thread pietroppeter
 
[https://app.cannon-chat.online/#/newcontact?deviceId=gently-pastel-eshanosaurus-3579=pietroppeter](https://app.cannon-chat.online/#/newcontact?deviceId=gently-pastel-eshanosaurus-3579=pietroppeter)


NailIt — a literate programming tool

2024-05-01 Thread pietroppeter
Hi, cool to see a new tool for literate programming, it looks very nice, 
congrats!

Thanks @Vindaar for sharing info about Nimib. Me and @hugogranstrom are being 
very quiet in the forum but we are progressing on various fronts (with the 
usual slowness) and we have a number of interesting things going on (we also 
report about those in our monthly speaking hours for those cuorious). Hopefully 
they will reach a more "shareable" point in the future.

Inspired by the tool I made a new post that implements an out of order api for 
nimib: 

I could see (with more effort and macros) how an api and output like the one in 
NailIt could be replicated in Nimib, but I would defintely not the one doing it 
(and it might not even be a good idea, NailIt looks nice as it is!).


Dynamic Typing in Nim

2024-01-13 Thread pietroppeter
Somewhat relevant to the discussion, a nice presentation by Richard Feldman: 
[Why Static Typing came back](https://youtu.be/Tml94je2edk?si=nMQfJa7_JJT4mQPF)


Niklaus Wirth has died

2024-01-04 Thread pietroppeter
there is a very nice and long interview here (from 4 years ago): 


Would be very much interested in understanding more on how his work impacted 
Nim, I never studied Wirth's work, I only know what is generic knowledge 
acquired through following Nim. From the top of my head:

  * `*` export operator from Oberon (probably the more visible thing, possibly 
the one with least impact)
  * compiler is fast and efficient and Wirth's book of compilers had a big 
impact on Nim's compiler development



To this I would probably add a quote from the end of the interview, answering 
the question: "What was the unifying theme of all your projects?": > Make 
things as regular and as well-structured and as simple as they can be without 
losing sight of their purpose. Undue complexity is a bad thing. And it's 
unnecessary. (Except in the modern commercial world, it's often used to hide 
inadequacies. If something is intransparent, it's much harder to copy)


Advent of Nim 2023

2023-12-02 Thread pietroppeter
Not using my usual repo this year, using this since I plan to do it in Nim but 
also in other languages: <https://github.com/pietroppeter/adventofcode2023/>


Enu 0.2

2023-11-30 Thread pietroppeter
Awesome!

it could be fun to use it for some advent of code visualizations :)


nim birthday?

2023-08-19 Thread pietroppeter
> The birthday should be the day the first bootstrapping was done. But I don't 
> know when that was. :-)

according to [this old (2014) archive page of nim 
website](https://web.archive.org/web/20140921121402/http://nim-lang.org/news.html)
 first bootstrapping was with version 0.6 which was released on **August, 22nd 
2008** :

> 2008-08-22 Version 0.6.0 released
> 
> Nimrod version 0.6.0 has been released! This is the first version of the 
> compiler that is able to compile itself!

this means Nim's 25th birthday is in 3 days, next Tuesday!

btw, I imagine nim website came later than 2008, how was the existence of nim 
first shared with others? is there some public message somewhere?


A few (perhaps naive) questions

2023-08-08 Thread pietroppeter
> Hello to all! > I am a newcomer in the Nim programming language.

Hi and welcome to Nim Forum!

> nim-lang/bigints does not support division for the moment

I assume you are referring to this bug in division: 


While I agree that it is bad and we should do something about it (the eternal 
"when I have time, I want to look into it..."), it is likely that it is a bug 
that happens once every 2^32 (from what I understand). This makes it unusable 
for critical or production stuff but for learning/playing with it, you can 
still use it.

> So I forked it and fixed it... Hopefully lol. "bignum" now works

Nice there is a fix, thanks! Note that the version that users get with `nimble 
install bignum` is  (and I think a PR would 
be welcome) and the gmp wrapper installed with nimble is 
 (and if that is not actively maintained 
- meaning a PR for the fix is not accepted - we should thinking of changing the 
link in nimble).


nimiSlides  Create beautiful slideshows in Nim 

2023-06-29 Thread pietroppeter
Yh, NimConf 2023! 拾


how to make a dll in nim-lang?

2023-06-19 Thread pietroppeter
you could use genny to generate a c dll (will not support GC): 



Is there any utility to output a graphical representation of a Nim Abstract Syntax Tree?

2023-06-12 Thread pietroppeter
another option would be to use 
[mermaid.js](https://mermaid.js.org/syntax/flowchart.html). here is an example 
of using mermaid.js with nimib: 
 (this will 
be made some point available as a library)

picking a simpler AST like the one generated by this:


import macros

dumpTree:
  if 0 == 1:
echo "路"


Run

which is:


StmtList
  IfStmt
ElifBranch
  Infix
Ident "=="
IntLit 0
IntLit 1
  StmtList
Command
  Ident "echo"
  StrLit "路"


Run

and translating to the following mermaid specification:


---
title: Nim AST
---
flowchart TB
  id0[StmtList] --> IfStmt
  IfStmt --> ElifBranch
  ElifBranch --> Infix
  Infix --> id1["Ident #quot;==#quot;"]
  Infix --> id2[IntLit 0]
  Infix --> id3[IntLit 1]
  ElifBranch --> id4[StmtList]
  id4 --> Command
  Command --> id5["Ident #quot;echo#quot;"]
  Command --> id6["StrLit #quot;路#quot;"]


Run

(you need to be careful about generating ids and escaping quotes)

the output would be:

see also in [live 
editor](https://mermaid.live/edit#pako:eNptkk1OwzAQha9iDdukyo-dpEFFosCiErAJK-ourNghlmK7pI5oqXoWNtyBa3EE8tOqtLDyzHvf2M-Wt5AbLiAF13WpttJWIkWPUqHr7InqXiwq85aXrLboaYqoRkhyb55ZZe_lyi6Q616hWdH1nTdUvXhXyWJaM52XnXHshgldyHU_0BW9JLk_pzDjQlt08doYezmZDCuFxTkazGe6DWCR98cKD5a_-OdgyfEx_HAb3Bs3RimmeSftyz1PzlKJvDQnuU7xqMUzW3cBBur74_PrFw8OKFErJnn76ttunoIthRIU0rbkomBNZSlQvWtR1liTbXQOqa0b4UCz5MyKW8leaqYgLVi1atUl08_GqAPUtpBuYQ2pH4SjyMPJmHiBFxCSYAc2kMZ4RHAUkhgHSeTj0N858N5v4I3iOA6jsYd94pNgnMQOCC6tqR-Gf9J_l90PJmax9w)

(nodes can be styled so you could have terminal nodes of a different color)


debugEcho to stderr ? osproc.startProcess debugging...

2023-06-12 Thread pietroppeter
you can create your own `debugEcho` that writes to `stderr` lying to the 
compiler and telling it has no side effects:


proc debugEchoStderr*(x: varargs[string, `$`]) =
  {. cast(noSideEffect) .}:
stderr.writeLine x


func add(a, b: int): int =
  debugEchoStderr a + b
  return a + b

let c = add(1, 2) # outputs 3


Run

  * 
  * 




What is the meaning of () after an enumeration symbol?

2023-06-03 Thread pietroppeter
`GridDir` is the index of the array (which I assume is a two valued enum)


What is the meaning of () after an enumeration symbol?

2023-06-01 Thread pietroppeter
I think it is this proc defined in cssgrid: 



“NIM” backronyms

2023-05-23 Thread pietroppeter
**Nimi Ilo Musi** : which in [Toki 
Pona](https://en.wikipedia.org/wiki/Toki_Pona) should be something like: "Funny 
Name of Tool"


Are any of you as excited about the Zed editer

2023-05-11 Thread pietroppeter
from what I can tell this seems to me a sincere (and somewhat enthusiastic) 
post and not advertising (hard to tell if ChatGPT generated or just ChatGPT 
helped here or neither of those are true - which is what I would guess). It 
might be slightly off-topic, I personally found it interesting (I did not know 
about this editor) and went looking for more info.

The people behind this effort (see their [about page](https://zed.dev/about)) 
seem to be people who were behind Atom, Electron and Tree-sitter. A number of 
other information can be gathered from the [faq page](https://zed.dev/faq) 
including the fact that:

  * it should be eventually open sourced with some open core model (it seems it 
is coded in Rust),
  * it should eventually be ported also to Linux and Windows,
  * there is plan to make it extensible through WebAssembly,
  * there is a plan to make it support any language server (and that should 
allow Nim support).



None of this has a definite plan and priority seems to be to identify the 
minimal subset of features that allows to validate their business model ("We 
plan to monetize optional network-based services integrated into the editor. 
The editor itself will be free to use.")

You will find your usual share of comments and criticism on the [orange 
site](https://news.ycombinator.com/item?id=35171689).


Can't import compiler/* anymore

2023-05-11 Thread pietroppeter
a similar issue was raised some time ago by a nimib user (nimib uses module 
`pathutils` which is under compiler's namespace): 
<https://github.com/pietroppeter/nimib/issues/62>

in that case the problem was that nim was installed on archlinux through 
distro's package manager

related nim's repo issue: <https://github.com/nim-lang/Nim/issues/14040>


Clearer copyright license for Nim logos and assets

2023-05-11 Thread pietroppeter
> 1\. Who is the original creator?

>From an issue in the repo it appears PhilipWitte graciously donated the arts 
>and rights to relicense: 

(a delayed thanks from me Philip!)


Good Languages Borrow, Great Languages Nim

2023-05-05 Thread pietroppeter
> There's even a mathematical stealing-game called "Nim"

image from 
 which 
covers the subject of [nim game](https://en.wikipedia.org/wiki/Nim) in 
considerable depth (next paragraph is "Get Nimble with Nimbers" :D)


Compiler limitation or wrong usage/expectation on my part?

2023-04-27 Thread pietroppeter
> the $ code fails silently

the code is not failing, in `system` (automatically imported) is defined a 
generic `$` that is used by `echo` (and it would be overriden by the more 
specific `$` in `token.nim` if imported).

I would say this behaviour is expected and there is nothing wrong about it.


Writing a wrapper for ML libraries how-to

2023-04-20 Thread pietroppeter
> it seems highly interesting for data science

I agree :)

> is there any comprehensive tutorial or documentation (with best practices 
> etc.), how-to write a wrapper for ML libraries, which otherwise expose a C++ 
> API?

not that I know of.

For xgboost there is already a wrapper, from what I can tell it binds the dll, 
not sure how the wrapper was generated: 



Future of typing ?

2023-04-05 Thread pietroppeter
> Overloading plus Hindley-Milner like type inference is NP-complete and Nim 
> focuses on overloading. I have never regretted this decision in my life. ;-)

very interesting

> Is there a paper/resource you can link where the relationship is explained in 
> more detail?

>From a very quick google search I was able to find this (there might be better 
>references): 

They prove that overloading for an example language (some type of lambda 
calculus, that in particular has pretty extensive type inference from what I 
can tell) overloading is NPI complete. In a language like Java where you can 
infer type statically (and for this context, I think it applies also to Nim) 
they have an informal proof that overloading becomes polynomial. And they 
mention in the end that the the case of ML and Haskell (Hindley-Miller 
polymorphism whatever that is) the type system becomes undecidable.


Example of simple parser?

2023-03-15 Thread pietroppeter
[nim-markdown](https://github.com/soasme/nim-markdown) might qualify for your 
reuqirements. It has a [dev 
guide](https://enqueuezero.com/markdown-parser.html) that gives you a simple 
example on how to write a parser. Also it is pretty flexible in the sense that 
you might be able to customize Nim markdown itself for your scope. A markdown 
parser is configure with a number of block parsers and online parser and you 
might need only to customize those, see for example this definition of GitHub 
flavored markdown parser: 



Moderator updates

2023-03-15 Thread pietroppeter
Thanks @pmunch and thanks for the good work done so far to Nim team and 
moderators ❤️! Happy and excited to be serving the community in a more official 
capacity (still a volunteer and still doing this in my free time ;)). Looking 
forward to work together with other moderators and present and future 
contributors. Bright Nim days ahead! ☀️


The Algorithms In Nim

2023-03-11 Thread pietroppeter
Great news @dlesnoff! I think this is a great way to showcase Nim and it could 
be a good opportunity for beginners to start practicing Nim.

As far as organization goes I say you already have work done here: 
 and I guess you will be 
transferring that to the new repo correct? Should we wait for you to do that 
before contributing to the official repo?

I will definitely contribute something!


Why does this code using 'concepts' fail?

2023-03-07 Thread pietroppeter
here is a variation on the theme:


import std/[random]

randomize()

type
  SomeDie = concept d
d.num_sides is int
  
  Die = object
num_sides: int
  
  ColoredDie = object
blue_sides: int
red_sides: int

proc roll(d: SomeDie) : int =
  rand(1..(d.num_sides))

proc roll_two(d: SomeDie) : int =
  d.roll() + d.roll()

let six_sided = Die(num_sides: 6)
echo roll_two six_sided

func num_sides(d: ColoredDie): int = d.blue_sides + d.red_sides

let color_sided = ColoredDie(blue_sides: 2, red_sides: 7)
echo roll_two color_sided


Run


Why does this code using 'concepts' fail?

2023-03-07 Thread pietroppeter
this works:


import std/[random]

randomize()

type
  Distribution = concept dist
dist.num_sides is int
  
  Die = object
num_sides: int

proc sample_dist( dist: Distribution ) : int =
  rand(1..(dist.num_sides))

proc roll_dice( d: Die ) : int =
  d.sample_dist() + d.sample_dist()

let six_sided = Die(num_sides: 6)
echo roll_dice six_sided


Run

I think the main reason with your snippet is that you are using as a concept 
constraint (`dist.sample_dist is int`) something that you cannot check 
statically without infinite recursion. I think the check happens with the 
`roll_dice` call and goes like this:

  * is `sample_dist` defined and `int` for `Die`? yes if `Die` is a 
`Distribution`
  * is `Die` a `Distribution`? yes if `sample_dist` is defined and `int` for 
`Die`
  * is `sample_dist` defined and `int` for `Die`? yes if `Die` is a 
`Distribution`
  * ...



note that in the snippet above the checks go like this:

  * is `sample_dist` defined and `int` for `Die`? yes if `Die` is a 
`Distribution`
  * is `Die` a `Distribution`? yes if `num_sides` is defined and `int` for `Die`
  * oh, I can look at `Die` and it has indeed a `num_sides` field which happens 
to be a `int`, all good proceed




This month with Nim - February 2023

2023-03-02 Thread pietroppeter
happy to be there (me and @hugoGranstrom) with **news from nimib-land** ️! 
Feel free to ask questions here or elsewhere, have a great day everyone!


My Nim Progress tracking everyday

2023-02-28 Thread pietroppeter
thanks, it is very nice to see this getting more and more structured :)

I particularly appreciate the [list of contribution-friendly 
issues](https://github.com/orgs/nim-lang/projects/8/views/1), I think it is 
particularly useful for newcomers, especially those who never did a github PR. 
The two ones left as far as I can tell really require very little effort but 
they are definitely meaningful. Indeed if no one wants to pick them up in the 
next few days I would be happy to do them myself :)


Difference {.importcpp.} vs {.importjs.}

2023-02-21 Thread pietroppeter
My naive expectation was that `importjs` and `importcpp` are exactly the same 
and the only difference is that `importjs` came later (to feel more natural 
when wrapping js) so in some places there is still `importccp` used but it 
could be safely changed to `importjs`. And that their use case is to support 
method call syntax in contrast to `importc` (where `c` stands for compatible 
with backend and not C as in the language) that supports the standard function 
call syntax:


proc method(obj: var MyJsObject, arg: string) {. importjs .}
# translates to obj.method(arg) in js

proc foo(a: string, b: int) {. importc .}
# translates to foo(a, b) in js


Run

Next thing I now is that for more complex use case you can emit js code.

After seeing some of the links provided by @juancarlospaco I see there is nice 
syntax supported by `imports` that I though previously would require an emit. 
And I am not very sure my naive expectation is true. Also I am surprised to see 
very little use of `importc` in nodejs package, so I guess it is not that much 
needed.

I have done very little js wrapping but I have not found a lot of documentation 
around, the best resources are usually looking at code and trying things out 
(and the advice is to compile to js with `-d:danger` to see reduced noise). 
Would very much welcome more explanations on this or pointers to resources. :)


nim birthday?

2023-02-20 Thread pietroppeter
I found out that today is Python's 32nd birthday, as it was February 20th, 1991 
the day Guido Van Rossum shared python on a usenet forum (see refs below) and I 
was wondering about a potential date for Nim's birthday.

I know from  that Nim 
was officially released in 2008 after @araq started development in 2005. I was 
wondering if there is an actual day that could be considered Nim's birthday for 
that and if there was some traceable initial message. Closest I could find is 
to track the first commits available from github repo and picked actually 
second commit done on **June 23rd 2008** 
()
 where the message is "initial release" (note that it actually says "Copyright 
(c) 2004-2008 Andreas Rumpf.")

So @araq what's the story there (if there is one)?

Btw, I also tracked the first commit not from Araq, which is by @dom96 and 
dates to March 10th, 2022 (less than a couple of years later): 


refs:

  * 

  * 



note: I know it is quite a stretch to apply this birthday concept to a 
programming language but it still is a fun thing to think about...


My Nim Development Progress Weekly

2023-02-20 Thread pietroppeter
Thanks for the write up and for the great work you have been doing! Btw, 
@ringabout did not mention it, but we have the golden opportunity of being part 
of their effort by sponsoring them!  Let's not miss 
out! ;)


Nim vs the 6 languages I learned before it

2023-02-13 Thread pietroppeter
Great article, thanks for sharing!

For those wondering how could @moigagoo have read it already... it was feature 
on HN:  ;)


Wanted libraries wishlist?

2023-02-13 Thread pietroppeter
> Apache Arrow?

there is a work-in-progress started by arkanoid87 
 (but progress stalled last year and indeed 
author was consider archiving it: 
).

I think it would be very useful a pure nim implementation of Apache Arrow (but 
also bindings would be nice, they would be useful also to check the pure 
implementation). The existence of a pure Rust Arrow implementation 
() is a key ingredient for the very 
succesful dataframe implementation polars (I am considering replacing pandas 
with polars in my python use cases): 


Wanted libraries wishlist?

2023-02-13 Thread pietroppeter
> but I would like a repository equivalent to this educational repository : 
> 

I think that is an interesting repo/project. For those who do not know it, the 
project ["The Algorithms"](https://the-algorithms.com/) is similar to Rosetta 
Code but it has all its implementations on github by language. The python repo 
for the project is one of the most starred on github (ranked #19 according to 
this: ).

I did ask in the past (October 2021), how does one add a language and the reply 
is that you can suggest a new language in #general-suggestion channel on their 
discord, see: 


I think the best way to go for such a suggestion to be successful would be to 
create a repo with the same structure as the algorithms and start adding some 
stuff before actually asking there (I did not have time to go in this direction 
at the time). I think this needs a lead to gather start working on it and 
gathering contributors, are you volunteering @dlesnoff (I would be happy to 
contribute)? ;)

My interest at the time was also because I thought it could have been a useful 
use case for nimib. The project itself has a website (linked above) that 
showcases the implementations in all languages, but the repo could also have 
its independent nimib website showing the algorithms.

> Most of the examples could be extracted from our SciNim packages and 
> illustrated with plotly (or directly rendered in the browser with JS 
> bindings).

It could be indeed very nice to have some way to show the algorithms in the 
browser using Js backend, but I do not think we should use SciNim packages. I 
think the idea is that the implementation should be as far as possible with 
minimal dependencies. The goal is not to have algorithm's implementation that 
are performant or can be used as a dependency but implementation that are 
simple to understand and educational. I may be wrong on this, I have not 
investigated enough...

Unrelated but an interesting coincidence, one of the most active contributes on 
The Algorithm's project (Panquesito7) has recently opened a PR on Nim website 
(), so maybe he might even read 
this and give us more suggestions...


working towards a Nim Devroom at FOSDEM 2023 (physical event)

2023-02-09 Thread pietroppeter
btw, for those who went, how was it? interesting talks to watch when the video 
will be available (or are they already)?

I was able to (sort of) watch a couple of interesting talks:

  * [What I learned about leading a healthy project from speaking to 50+ 
maintainers](https://fosdem.org/2023/schedule/event/learned_leading_healthy_project/)
 from Community Devroom. Community is something I want to work on this year and 
that talk provided some good examples and inspiration.
  * [How Pydantic V2 leverages Rust's Superpowers - Using Rust to build Python 
extensions](https://fosdem.org/2023/schedule/event/rust_how_pydantic_v2_leverages_rusts_superpowers/)
 from Rust devroom. I do think that Nim really could play a good role in this 
niche of python extensions and I think we should try to provide Rust some 
competition there.




working towards a Nim Devroom at FOSDEM 2023 (physical event)

2023-02-09 Thread pietroppeter
> Out of curiosity, the devroom wasn't approved?

to expand a little on @dlesnoff correct assessment (and partly using some 
answers I did provide in nim telegram channel, I was planning to update this 
thread but forgot, thanks for the reminder! :)).

Yes, the devroom was not accepted. I think I can safely quote from their mail

> I'm sorry to inform you that we declined your devroom proposal for this 
> edition of FOSDEM.
> 
> We received far more proposals (88) than we can accommodate, so unfortunately 
> we had to leave out a number of good proposals, including from some teams who 
> had a well organized devroom in one of the previous (online and/or physical 
> editions).
> 
> Note that this mail only informs you that we will skip this edition, and does 
> not mean we will not reconsider the room for next year.
> 
> Fortunately, there are other ways to participate in FOSDEM too
> 
> \- have a stand at FOSDEM [1]: apply before November 15
> 
> \- hold a talk in the main tracks or lightning talks track
> 
> \- speak in one of the other devrooms.
> 
> CfP for the main tracks/lightning talks and other devrooms will be opened 
> soon, keep an eye on the website.
> 
> We did accept a "Declarative and Minimalistic Computing" devroom, you may 
> want to get in touch with the organisers.

To be honest, I can understand their decision given the constraints. They had 
to leave something out and our track record (of some talks in past editions 
plus an online nim devroom that I would judge as well organized ;)) was good 
but it is possible they had to leave out devrooms with a better track record. 
They do indeed mention receiving 88 proposals and the [public list of accepted 
devrooms](https://fosdem.org/2023/news/2022-11-07-accepted-developer-rooms/) 
lists 53 of them, so they did have to reject 35 devrooms. From what I can tell 
most if not all the accepted devrooms are on topics which have a long tradition 
being at FOSDEM. Furthermore, we had many options (listed in the mail) to still 
have Nim featured in Fosdem (in particular the minimalistic etc devroom 
mentioned nim specifically in their 
[cfp](https://lists.fosdem.org/pipermail/fosdem/2022q4/003446.html)).

> This was so sad :( I was looking forward for this year's FOSDEM with a Nim 
> devroom :(

ah yeah, definitely shared the feeling of sadness and really wanted to make it 
happen. It is also a pity that there were no submissions from the community for 
the other options but the rejection for sure did not help (I was considering 
submitting a lightning talk but in the end could not be sure to commit and 
indeed I did not go). Now I take this as a challenge to make their decision 
more difficult for next year (while still preparing to submit something 
elsewhere just in case). :)


Quill - A nim js library for making text editors

2023-02-07 Thread pietroppeter
> I just checked the function from nimib, and that file is not compatible with 
> nim js,

Huh that is weird, I was expecting code there to be fairly tame and the imports 
too (from stdlib) I was expecting them to work in js


Quill - A nim js library for making text editors

2023-02-07 Thread pietroppeter
This looks pretty cool, thanks for making it and sharing!

I cannot find the nim code to generate the behaviour in the [live 
demo](https://thatrandomperson5.github.io/Quill/example) (I even searched for 
"newline" in the repo), is it anywhere in the repo?

It would be cool to have a demo where the editor highlight correctly nim code. 
One could use a function from nimib that takes nim code and returns it with 
highlight.js compatible span classes, see: 
<https://github.com/pietroppeter/nimib/blob/2e0c2223cef10423fc43fc3be9626890a6bb4779/src/nimib/highlight.nim#L73>


Nimword - A simple interface for password-hashing implemented by other packages

2023-02-02 Thread pietroppeter
Nice! I guess every time you validate a pbkdf2 hash you could also replace it 
with the argon2 hash…


Why I stopped programming in Nim

2023-01-31 Thread pietroppeter
it is tricky to really get nim repos by star, but using [this other 
search](https://github.com/search?q=stars%3A%22%3E+100%22+language%3ANim=Repositories=advsearch=Nim=)
 you can see that nitter and vim cubed are actually on the podium. You do still 
get OffensiveNim at 4th place, 2 other "offensive" repos in the top 30 and many 
others in the 192 repos with more than 100 stars and marked as done with nim 
language.

on a funny note I discovered this repo that I did not know about: 



Why I stopped programming in Nim

2023-01-28 Thread pietroppeter
Hi and welcome to the forum (although I guess the message looks more like a 
bye-bye )!

Unfortunately this is a known issue that presents occasionally and where we 
have struggled to find a solution. I do not think we were able to ever get in 
contact with anti malware software, the most decisive action that it was taken 
was to set up a virus checker which checks nim compiler and uploads binary to 
virus total, see annoucement:  and repo: 


that is a partial solution and also it only takes into account compiler 
executables. in the repo above is linked a list to contact vendors 
() but I do not see [the one 
you mention](https://www.vmware.com/it/products/carbon-black-cloud.html).

I guess one option is to see if there is a way to whitelist or exclude your 
executable in your specific anti virus software. One possible helpful thread 
that I could find was this: 


some previous threads:

  * (Dec 22): 
* there is a link to a specific case where flagging was linked to a 
specific feature, later removed: 
  * (Aug 22): 
  * (Apr 21 + May 22): 



it seems one option that was mentioned and not tested yet was to try and write 
a blogpost to attract a bit of attention and possibly establish a communication 
channel. I guess this is still something that we could try. The option to try 
and contact vendor directly I guess is also an option, although there seems to 
be quite a few... Anyway I think people should keep reporting these kind of 
issues, so thanks for caring enough to do that!


Numerical libraries for data science

2023-01-24 Thread pietroppeter
Do you have some examples to share?


Numerical libraries for data science

2023-01-21 Thread pietroppeter
that is Arraymancer's Tensor, not a concept. There is though this open 
issue/dsicussion by @Vindaar which is definitely relevant: 



Numerical libraries for data science

2023-01-21 Thread pietroppeter
> Nim would be a good option to produce fast python packages?

I think it has the potential to be a great option to produce fast python 
packages for scientific computing! But to be fair I have not seen that realized 
too much (at least in the open, in the data science context, the only lib for 
python in nim I know of is 
<https://github.com/juancarlospaco/faster-than-csv>). I guess the best option 
should be using [nimporter](https://github.com/Pebaz/nimporter) which has the 
great advantage that users of a packaged library do not need to have a 
dependency on Nim (this relies on built binary called wheels, I see a recent 
version being worked one is adding the possibility of having source 
distributions which I guess should have more advantages).

The more I think about it, the more I am convinced that nim could be an ideal 
language for researchers publishing the algorithms if we manage to build 
tooling to make it effortless to build bindings not only in Python but also in 
other languages (R, Julia, Javascript, C, C++, ...). And it makes sense to 
focus a bit on Python which is the biggest target around in this context and 
also the most ready.

I plan to try and work on this topic this year. Today (partly motivated by this 
thread) I have started an implementation of a clustering algorithm (affinity 
propagation) and the plan is to see how easy it is to make it available in 
python through nimporter and how it compares with respect to sklearn 
implementation (the real prize would be to implement some more recent and more 
scalable versions). For the moment there is not much work being done and the 
repo is a mess but I'll leave it here for curious people: 
<https://github.com/pietroppeter/affprop> I will update when there is something 
more.

>From what I can see at the moment, the first thing I noticed lacking is an 
>easy interoperability with numpy arrays (although I see @Clonk has started 
>some work in <https://github.com/SciNim/scinim> ) and in general it would be 
>nice to be able to have an api that takes as inputs a `MatrixLike` or 
>`ArrayLike` abstract type. I guess I should start exploring concepts... but 
>first, I want to have the algorithms work with simple sequences (and I am 
>intentionally reimplementing some basic matrix types to make sure I am able to 
>use it on js backend). Already basic sequences and being finally free to use 
>for loops should be enough to have good performance wrt python w NumPy (as 
>apahl's gist linked above shows).


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: 


This Month with Nim: November and December 2022

2023-01-11 Thread pietroppeter
new post on nim blog! 

### [This Month with Nim: November and December 
2022](https://nim-lang.org/blog/2023/01/11/this-month-with-nim.html)

 Cliche, WebRTC, Nimrun Action and p5nim

 **reminder** : to have your activity showcased in the monthly blogpost just 
add an issue here: 


everybody is much welcome to add their stuff, flood us with content so that we 
will want to automate this! ;)


Workaround if you are curious about “couldn’t render historic post”

2023-01-10 Thread pietroppeter
> Nice, bookmarked. Let's hope this one doesn't turn into “couldn’t render 
> historic post”

my hope is that your bookmark (and this post) would be soon obsolete :)


Workaround if you are curious about “couldn’t render historic post”

2023-01-10 Thread pietroppeter
had to check what [ib4](https://www.urbandictionary.com/define.php?term=ib4) 
means... so, I will ask something different. who has the power right now to 
deploy a new version of the forum? It seems that is the main point of friction 
currently. I can see @ringabout has now the power to merge, which is great news 
(thanks for all your work)! ❤️

And since search is not great, I will link last relevant discussion we had on 
the forum (Jan 22, one year ago, time of last forum update): 



Workaround if you are curious about “couldn’t render historic post”

2023-01-09 Thread pietroppeter
In case you run into some of those “couldn’t render historic post”, a 
workaround to know the content is to take advantage of nimforum api, for 
example:  shows the source of the 
post that opens this thread: 

more example on non renderable posts can be found searching for historic post 
site:forum.nim-lang.org

GitHub issue for this bug: 


A seasoned programmer's take on Nim's docs

2023-01-07 Thread pietroppeter
> > Add a page navigation section with links to the headings on the page
> 
> That is more difficult than you think to do it right with Nimib currently.

Indeed it is not straightforward right now, but recently I more or less settled 
on an api, so it should not be too difficult to do (if someone wants to give it 
a go; otherwise sooner or later I will get to it). Relevant issue is 
<https://github.com/pietroppeter/nimib/issues/58>

Btw this is an issue which is also present in Nim blog (no linkable headers nor 
an easy way to make a toc; I imagine there should be a Jekyll plugin or 
something to have that available).

> @pietroppeter made this example (link to toc_mustache)

A better example is the cheat sheet one: 
<https://pietroppeter.github.io/nimib/cheatsheet.html>

The link you report was an exercise in trying to do a toc in mustache which is 
harder than in other template systems since you do not have control flows. In 
the end it is not what was used in nimibook (and in that case it was a toc for 
site navigation, not for page navigation), so not particularly relevant anymore.

Also regarding the dark theme, indeed the current default (taken from 
water.css) has some issues like the ones pointed out by @ingo, I am open to 
improvements. Personally I do not find it that bad, so it has not been a 
priority for me.


A seasoned programmer's take on Nim's docs

2023-01-05 Thread pietroppeter
trying to be synthetic, but I have enjoyed the exchange, there is material to 
untangle in multiple threads here. :)

  * on concepts: looking forward to your write up!
  * on compiler errors: yep, they can get bad, with some experience they become 
better to navigate, still could definitely be an area of improvement. an howto 
guide on compiler errors should be much welcome.
  * on nimcrypto: ok, now if I can see where you come from and the gist of the 
criticism. maybe some of your remarks could end up in issue in the repo. how to 
use crypto is definitely more difficult and require special expertise than how 
to implement crypto.
  * on making random a secure call: I guess one of the advantages of current 
call to random is that is fast and a secure version would necessarily be 
slower. current one is based on some variations of xoroshiro that aims for 
speed and statistical quality and still would be the one to use for example in 
monte carlo simulation in a scientific context. whether the default is the fast 
or the secure one I guess it could be up to debate (and not sure I am sold on 
this) and an alterantive could be provided: secure_random or fast_random. 
pretty sure that for nim 2.0 the ship is already sailed though (it is frozen 
and only bugfix mode).
  * developer onboarding/slimming stdlib: I also would tend to prefer a fat 
stdlib instead of a slim one but I think the hard argument there is that there 
is not enough manpower currently and I think this is a lesson hard learned by 
core devs, so it seems a fair choice for this 2.0 iteration. the theme on 
trying to ship some nim distribution of libraries is something that has come up 
and fusion is indeed recognized as a failed experiment (unfortunately). 
centralizing stdlib like iface and others (e.g. pattern matching) I think is 
not feasible until those libraries get a decent amount of usage as nimble 
package (and yes, with such a young ecosystem it is hard to avoid the risk of 
having to rewrite because of obsolete dependencies).
  * on foundation: no progress that I know of. this is a topic that I think 
would advance better with a group of people in the same room (and some prep 
work). of course a new thread on that topic would not hurt. nice to hear about 
the expert connections, they might turn useful! thanks for the availability!




Delete items in a seq while iterating over it?

2023-01-05 Thread pietroppeter
TIL del vs delete: 


A seasoned programmer's take on Nim's docs

2023-01-04 Thread pietroppeter
as far as some of the additional questions asked:

> 1\. Is driving more adoption of Nim a meaningful goal?

that's an easy yes, but it I guess it is a rethorical question :)

> 2\. If so, what are the biggest hurdles?

For me the number one priority is working on **building the community** , in 
particular empowering the community to do more (as core devs can only do so 
much, but an empowered community can do a lot). From the community it comes the 
ecosystem and an improved narrative about what nim is about.

> 3\. Is there a way to overcome them?

Along those lines some specific actions that I think would be promising would 
be:

  * working towards a nim foundation (see [previous 
discussion](https://forum.nim-lang.org/t/8525)). A foundation could foster the 
creation of specific official working groups on various matters (documentation, 
ecosystem, funding, ...) and it would allow more involved people to be 
officially invested by the community to tackle specific topics.
  * planning for in person meetings (both global and local): online is nice and 
useful and all, but I think meeting a lot of nim folks in person could 
accelerate change and help smooth out occasional frictions. I was trying to 
work on having [an occasion at fosdem with a nim 
devroom](https://forum.nim-lang.org/t/9534#62633), didn't work out (we were not 
accepted), will try again (and still considering going to connect to some of 
the nim people who plan anyway to go there). On local side a plan I still have 
is to start a meet up in Milan.



also, I try to make an effort to show up here and elsewhere and be welcoming to 
newcomers. often is easy to just leave a like but I guess a few more words can 
help. it helps also to be present on socials (twitter, fosstodon) and other 
places (e.g. ask and answer questions on stack overflow).

> I'm going to shut up about it all now, unless someone actually wants to have 
> a real discussion about what can improve adoption. "Write docs" doesn't 
> address the issue I raised, but as I said, if there's some sort of sanctioned 
> Wiki, I probably will, despite the fact that I certainly don't feel welcome.

I hope you will keep up the discussion and I would definitely would not want 
for you to feel unwelcome here or on the wiki. You are most welcome!


A seasoned programmer's take on Nim's docs

2023-01-04 Thread pietroppeter
 if it would be worth the effort of doing 
again something similar but it is a great example of past work in documentation.

> For instance, one member of my team tried to get the VSCode integration 
> working, installed one of the major lldb integrations, and yet for whatever 
> reason, none of his set breakpoints would ever fire. He couldn't find any FAQ 
> or README to help quickly, and that was the final straw, he went back to Go. 
> Maybe he was just doing something wrong, but he knows how to use a debugger 
> w/ VSCode (whereas I'm just a unix grey beard using emacs as my IDE).

I would say this is another known pain points of nim. Debugger is not a 
widespread or straightforward practice.

> All in all, two months in, Nim's my favorite language of all time (and over 
> the last 25 years I've taught both programming languages and compilers plenty 
> of times). I do feel like it should be a lot more popular than it is.

this is very nice to hear and I think we all share the fact that we **feel like 
it should be a lot more popular than it is.**

indeed this leads to what was indeed the main topic of the thread: how can we 
drive Nim's adoption? and I gather a partial answer you give in this thread is:

> If the ecosystem were bigger, maybe the docs would be sufficient. But I 
> believe the ecosystem can't grow fast enough for that, unless the docs are 
> even better than they already are, by a lot.

the topic of how do we make nim successful is also a topic that is occasionally 
discussed here in the forum (that might excuse some of the rudeness of other 
commenters ;)), but it sure is not a topic that is going to go out of fashion 
too soon (alas!). it is a very broad topic. I am still not convinced by this 
discussion that _reference_ docs are the most important thing to focus on, but 
I have always believed that more _general_ documents (as @mratsim reminds us: 
how to, tutorials, explanation) should definitely be a priority! (my number one 
priority is community building)

In my spare limited spare time, I have started 
[nimib](https://github.com/pietroppeter/nimib) project with the explicit goal 
of producing more of this kind of nim documentation (I think last year I have 
produced over 20 single documents using this on various nim topics, in 
[nblog](https://pietroppeter.github.io/nblog/) and elsewhere - unfortunately 
discoverability is rather bad yet). Incidentally there is also a ongoing very 
welcome effort to translating the [wiki to 
nimib(ook)](https://github.com/nim-lang/wiki/pull/2), which might help with 
wiki.

Apart from this type of documentation, I think a very welcome type of nim 
related content from experienced newcomers such as yourself is some kind of 
formal or informal essay on why they find nim great (given their background). 
There has been a recent example [shared in the 
forum](https://forum.nim-lang.org/t/9655) which made some waves also on HN and 
given your background I think it an extended essay would be very much welcome 
(here on forum but possibly also as a guest blogpost).

Finally, there are enough breadcrumbs in your replies to make me guess (without 
being afraid of an unintended reveal ;)) that your identity is [John 
Viega](https://twitter.com/viega), correct? It is very nice to see an 
established industry player approach Nim and share their perspective. I 
particularly enjoyed reading a recent write up of yours: 
<https://blog.crashoverride.com/a-personal-history-of-the-appsec-industry>


Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread pietroppeter
ChatGPT is delightful and lots of fun (and might even be useful), but 
technically speaking is [still a bullshit 
generator](https://aisnakeoil.substack.com/p/chatgpt-is-a-bullshit-generator-but),
 in the sense that it has absolutely [no concern about the 
truth](https://twitter.com/carnage4life/status/1599715584392167425?lang=en). As 
a side effect, the cost of generating long texts that look reasonable are going 
[down to zero](https://twitter.com/aaronclauset/status/1599788621581934592) 
(well at the moment is VC money keeping up the service for free), while the 
cost of making a insightful critique and pointing out mistakes are still very 
high (possibly higher in terms of chatgpt generated text, since there has been 
no self censoring editing to be friendly towards to a reader). The relevant 
part of your questions is:

> So I was looking for a language in which i could verify the logical 
> properties of it's own code. And since Nim is a relatively easy language, I 
> would love to use it, but I didn't know if this was possible to for example 
> use Coq or some other proof assistant to do so

This has been answered by @auxym (DrNim indeed provides that functionality; it 
seems to be very little used as far as I can see, but is where one would start 
working in the direction of proving code). The specific theorem prover it uses 
is [z3](https://en.wikipedia.org/wiki/Z3_Theorem_Prover) which is very nice in 
itself ([z3nim 
examples](https://pietroppeter.github.io/nblog/drafts/z3_examples.html)). 
Another interesting project in that area is [forematics by 
treeform](https://forum.nim-lang.org/t/8691).

The rest of text consisting of chatgpt conversation I am not going to comment 
for reasons explained above. ;)


Tutorial for nim pixie graphics?

2022-12-21 Thread pietroppeter
ggplotnim did get recently a [pixie 
backend](https://github.com/Vindaar/ginger/pull/28) (ginger is ggplotnim main 
backend engine) thanks to @zetashift. To activate it, according to changelog, 
you need to add a backend parameter when calling ggsave: 



Tutorial for nim pixie graphics?

2022-12-20 Thread pietroppeter
> Can pixie react to clicks on a figure

no, not by itself. for that I would use p5nim: 
<https://github.com/pietroppeter/p5nim>

examples of implementation of tic tac toe in p5js that could be ported to p5nim:

  * <https://openprocessing.org/sketch/1712070>
  * <https://editor.p5js.org/cs4all/sketches/Bk3TOJzlE>
  * <https://editor.p5js.org/ssmkhrj/sketches/JzpBW6cxO>
  * ... 




Tutorial for nim pixie graphics?

2022-12-20 Thread pietroppeter
and as far as example goes, this is the most complex thing I did with pixie 
(likely not good style, iirc I was mixing the two styles of api available in 
pixie): reproducing a wordle-like logo (for an Italian version of wordle) with 
pixie  (that pixie-created 
image has been seen by a few million people)

could be nice if we use this thread to share stuff done with pixie, which is 
awesome!


Tutorial for nim pixie graphics?

2022-12-20 Thread pietroppeter
btw, I think readme of  (old repo for 
subset of font functionalities now in pixie) contains still useful stuff for 
fonts and typography that, last time I checked was not yet ported to pixie or 
pixiebook. probably it could be useful to port it in one of the two places.


Generic parameters

2022-12-14 Thread pietroppeter
a notable example of usage of static int parameters used for dimensions of 
matrix is the usage in 



Advent of Nim 2022

2022-12-02 Thread pietroppeter
There was a fix made in May to allow moderators to edit posts but I guess it is 
not in production: 

Admins should always be able to edit posts, even not their own, from what I can 
tell

(it would be nice to have somewhere accessible a ref to version/commit of Nim 
forum)


Advent of Nim 2022

2022-12-02 Thread pietroppeter
indeed, when I posted my solution yesterday I found only two other people. 
haven't yet the chance to post mine today...

unfortunately also the website that was able to show you all solutions in 
megathread by language is not active anymore: 



Nim 1.6.10 released

2022-12-01 Thread pietroppeter
updating with choosenim from 1.6.6 to 1.6.10 on my Windows throws error due to 
antivirus (updating to 1.6.8 goes fine):


C:\Users\ppeterlongo>choosenim update stable
   Updating stable
Downloading Nim 1.6.10 from nim-lang.org
[##] 100.0% 0kb/s
 Extracting nim-1.6.10_x64.zip
D:\a\choosenim\choosenim\src\choosenim.nim(350) choosenim
D:\a\choosenim\choosenim\src\choosenim.nim(332) performAction
D:\a\choosenim\choosenim\src\choosenim.nim(198) update
D:\a\choosenim\choosenim\src\choosenim.nim(31) installVersion
D:\a\choosenim\choosenim\src\choosenimpkg\utils.nim(103) extract
C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.6\lib\pure\os.nim(2588) 
copyDir
C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.6\lib\pure\os.nim(2590) 
copyDir
C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.6\lib\pure\os.nim(1861) 
copyFile

C:\Users\runneradmin\.choosenim\toolchains\nim-1.6.6\lib\pure\includes\oserr.nim(95)
 raiseOSError
Error: unhandled exception: Operation did not complete successfully because 
the file contains a virus or potentially unwanted software.
Additional info: 
("C:\\Users\\PPETER~1\\AppData\\Local\\Temp\\choosenim-extraction\\nim-1.6.10\\bin\\nimgrab.exe",
 
"C:\\Users\\ppeterlongo\\.choosenim\\toolchains\\nim-1.6.10\\bin\\nimgrab.exe") 
[OSError]


Run


Advent of Nim 2022

2022-11-30 Thread pietroppeter
ye, it's advent of nim time! that time of the year where I am 
miraculously excited to get out of a bed at 6 am!  I plan to blog about my 
solutions in nim in my usual repo here: 
<https://github.com/pietroppeter/adventofnim>

I also plan to share the link to my solutions in reddit daily threads and 
likely on twitter, it is a good way to have some interests in nim from 
outsiders. The adventofcode reddit is definitely worth it during advent of 
code, lots of people sharing fun or impressing stuff (often both)!

hopefully I will also improve the site, but the main goal for this year is to 
have fun doing visualizations with <https://github.com/pietroppeter/p5nim>

p5nim is a wrapper of [p5.js](https://p5js.org/), a great library (+ 
ecosystem + community) to visualize and animate stuff, mostly targeting 
beginners, designers, artists. I picked up some old bindings which were not 
working, fixed them, adding features (added support for saving a gif that came 
with a recent p5js release, that will come handy to share on twitter), started 
adding some examples (love 
[this](https://pietroppeter.github.io/p5nim/okazz_220919a.html)) and improving 
the api from nim point of view (some great work has been done recently by 
@vindaar on instance mode that I plan to use to have multiple p5 instances in 
the same page). There are still a few rough edges and missing stuff, the idea 
is that using it in advent of code will help me clean this up and make a proper 
release.

@PMunch, your streams are great, glad you keep them up!

some generic useful refs:

  * search solutions by language: 
[https://aocweb.yulrizka.com/?year=2021=1=Nim](https://aocweb.yulrizka.com/?year=2021=1=Nim)
  * jittered scatterplot of leaderboard times: 
<http://www.maurits.vdschee.nl/scatterplot/>
  * (new!) a recent nice reddit thread in r/adventofcode has all past problems 
categorized (comes with a csv!): 
<https://pietroppeter.github.io/p5nim/okazz_220919a.html>




nimble master

2022-11-28 Thread pietroppeter
ah ok, than I think this is a bug. You could open an issue in nimble repo. 
Actually the fix is probably as easy as changing to `doCmd("git init 
--initial-branch=" & defaultBranch)` this line: 


(disclaimer: git option taken from this SO answer, I did not test it... 
)


nimble master

2022-11-28 Thread pietroppeter
ah ok. But why the local branch of  is 
main? you changed it yourself?


nimble master

2022-11-28 Thread pietroppeter
I never run into this and I do have published packages with default branch 
`main`.

I did check the [code of `nimble 
publish`](https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/publish.nim#L164)
 and indeed it does assume a `defaultBranch` of `master` but this refers to the 
default branch name of repo  which is 
indeed master so that is correct. I do not think that nimble needs to know 
default branch of your git repo when publishing (it just needs to know the url 
of repo; in some cases you can add a url to doc or web which might contain the 
branch name, but this is likley something that you provide).

Are you sure the issue you are experiencing with nimble publish is due to the 
branch name of your git repo? can you give more info about the issue you ran 
into (error messages or whatever)?

I guess this request might be related to this PR (but maybe not and that PR was 
done manually):  Note that 
there is a change requested there to approve it (for some reason there are some 
empty tags).


Looking for a pair programming partner / coach

2022-11-25 Thread pietroppeter
> I will contact each of them to find what schedule works best for both of us 
> and would like to thank everyone for all the hearts on this posts. I'm so 
> impressed with the passion within this group.

How cool would it be if we organized this as a community? you ask for a nim 
mentor/coach/... and we provide!


Why I enjoy using the Nim programming language at Reddit.

2022-11-18 Thread pietroppeter
On the subject of yaml I like the not so well known approach taken by Python 
library strictyaml: 

Basically they remove a lot of yaml functionality (including type inference). 
What is left is a very simple format that I think is one of the best way to 
provide manually generate data for complex configurations (while json is best 
for machine generated data, and toml better for simple configuration).

An interesting library that goes in this direction (simplifying yaml) is nyml 
by @georgelemon: 


Why I enjoy using the Nim programming language at Reddit.

2022-11-15 Thread pietroppeter
that's a great post thanks for sharing! in particular I liked a lot this 
initial part:

> I have worked at Reddit for five years and have used Nim nearly every day 
> during that time. The internal data tool I am working on is written primarily 
> in Nim. I have developed a tiny but powerful data querying language similar 
> to SQL but that is way easier to use for non technical people. I also have 
> written my own visualizations library that supports a variety of charts, 
> graphs, funnels and word clouds. Everything is wrapped with a custom reactive 
> UI layer that uses websockets to communicate with the cluster of data 
> processing nodes on the backend. Everything is 100% Nim.

I guess that the libraries that we get are a small part of the great stuff you 
do there! :)

can you tell us more how did you start in reddit and how you proposed/got 
accepted to work with nim? from your linkedin I saw you are (were?) working for 
a pushbullet company that you co-founded, was this acquired by reddit or you 
are still working on that? was that company also using Nim? I mean now you got 
me real curious... ;) 


Nim 1.6.10 RC2

2022-11-15 Thread pietroppeter
I need to try again and use choosenim on the Mac M1 so that is easy to switch 
versions. Did anyone succeed in having it work?


This Month with Nim: October 2022

2022-11-13 Thread pietroppeter
An update on the "Public Analytics" item reported in this blogpost. We have now 
completed the import of Google Analytics data in plausible, you can see the 
full history of view since March 2014

(for GA data we do not have details of sources, pages, ...; also I still need 
to check if we are tracking the same stuff or we are still missing something 
that we tracked in GA and we do not yet in plausible)

next steps: 


How to edit the wiki?

2022-11-04 Thread pietroppeter
> It is a known bug regarding Karax if you are using LanguageTool or Grammarly 
> tools which change the vnode or something.

I guess you are referring to this issue: 


I create an issue also in karax so that people using karax are aware (and it is 
also the place where it should be fixed): 



How to edit the wiki?

2022-11-04 Thread pietroppeter
> I will change to Nimibook and add the table of contents but you should be 
> aware that Nimibook does not support all functionality Nimib provides. I 
> tried to plot a graph with Plotly show_plotly but the macro nbShow 
> (doc.partials) was not working due to some distinction in the HTML header 
> generation made by Nimib and made by Nimibook.

that is a bug and should be fixed, can you open an issue on nimibook with some 
details?

> It would be nice if the wiki markdowns could be rendered from the Github 
> repository. It would replace the edit button with the PR system of Github.

one thing that you can do yourself is activate github pages on your fork while 
you make your changes (to see them you have to merge in the branch you use for 
pages, either main or gh-pages, usually). then at some point you can do a PR to 
nim repo and github pages could be activated there as well. ideally it would 
also be nice to use a PR preview system like the one is setup in 
scinim/getting-started, nimib and nimibook but that takes a minimum of setup 
(and a netlify account...)


youtube video Nim in 100 seconds from Fireship

2022-11-03 Thread pietroppeter
impressive that he was able to fit in 100 seconds also a non trivial example of 
macro ([playground](https://play.nim-lang.org/#ix=4eQu)):


import macros

macro timesTwo(statements: untyped): untyped =
  result = statements
  for s in statements:
for node in s:
  if node.kind == nnkIntLit:
node.intVal = node.intVal*2

timesTwo:
  echo 1 # 2
  echo 2 # 4
  echo 3 # 6


Run


How to edit the wiki?

2022-11-03 Thread pietroppeter
> Sorry for the inconvenience. No, I simply disabled contributing to the wiki 
> for a few times.

ah ok, good to know. and thanks for the work protecting it from.

> I would rather the wiki can be transferred into a separate repo

yep, this seems a solution that could work

> I have generated 60 Nimibs from the wikis MDs

wow, nice work @dlesnoff !

> Maybe a better idea for the wiki would be using nimibook?

agree, nimib for the moment has very limited functionality for building a site 
and nimibook is currently the only available option to have a nice toc.

I am working on a SSG for nimib, hopefully we will have (soon?) more options 
(for a blog or general purpose site). 


How to edit the wiki?

2022-11-02 Thread pietroppeter
this has been brought up a couple of times in unrelated threads, so it is worth 
making its own thread. Hopefully someone that knows the details will answer.

  * 
  * 



some open questions:

  * to edit the wiki you need to be a contributor, correct?
  * what does it mean to be a contributor? having a merged PR is enough? how 
old should the PR be?
  * when was this enforced?



once we have the answers we could update the wiki


Idea: Marketing Nim to Organizations

2022-11-02 Thread pietroppeter
the edit button is not visible for everyone, I think there is some setting that 
makes it visible only to (somewhat recent) contributors. I recently started 
seeing it after a documentation PR was made.

Someone with more knowledge than me (when was this changed? I do remember this 
setup was different) should comment on the details (or correct me if I am 
wrong). Also we should probably put this info in the wiki itself.


Evolving the GUI definition

2022-10-28 Thread pietroppeter
Haha, you are perfectly right! I will try to update the document! Thanks for 
the remark, this looks like it is driving the original point home :)


Evolving the GUI definition

2022-10-28 Thread pietroppeter
hey, wait, it seems that there is an easy to reach fix (update blogpost):


nbKaraxCode:
  const
helloId = "helloId"
inputId = "inputId"
  var
hello = "welcome to the hello program"
name = ""
exited = false
  karaxHtml:
if exited:
  p:
text "Thanks for playing!"
else:
  p(id=helloId):
text hello
  label:
text "enter a name or the word 'exit':"
  input(id = inputId, `type` = "text"):
text name
  button:
text "Enter"
proc onClick() =
  name = $getVNodeById(inputId).getInputText
  if name == "exit":
echo "exiting"
exited = true
  else:
hello = "Hello, " & name


Run


Evolving the GUI definition

2022-10-28 Thread pietroppeter
> try converting the following imperative script even by hand:

interesting challenge!

this is my solution using nimib's `nbKaraxCode` (karax without boilerplate):


nbKaraxCode:
  const
helloId = "helloId"
inputId = "inputId"
  var
hello = "welcome to the hello program"
name = ""
  karaxHtml:
p(id=helloId):
  text hello
label:
  text "enter a name or the word 'exit':"
input(id = inputId, `type` = "text"):
  text name
button:
  text "Enter"
  proc onClick() =
name = $getVNodeById(inputId).getInputText
hello = "Hello, " & name


Run

you can see it in action here: 


it did not require any particular reasoning, it is a pretty straightforward 
translation. it could possibly benefit from some [karax 
widgets](https://forum.nim-lang.org/postActivity.xml) to simplify even further. 
also I guess I could avoid the button, but I do not know how to do it.

it does not seem too different from the original but I guess state is indeed 
managed somewhere, would be interested in hearing your thoughts about it :)


NimConf 2022 - Saturday, October 22nd

2022-10-24 Thread pietroppeter
> there are multiple reports (check #nimconf channel on discord) of Tim Sweeney 
> congratuling Juan Gomez in the Unreal talk!

nope, it was not Tim: 
[https://twitter.com/_jmgomez_/status/1584653131346247681?s=20=EjoTFQwqlXr_M39L7DvmBg](https://twitter.com/_jmgomez_/status/1584653131346247681?s=20=EjoTFQwqlXr_M39L7DvmBg)


NimConf 2022 - Saturday, October 22nd

2022-10-23 Thread pietroppeter
Had time to catch up with the talks I had not yet watched, and it was a great 
nimconf. Thanks to Nim team for organizing and to all other speakers to produce 
such great content!

And although I was not there, there are multiple reports (check #nimconf 
channel on discord) of Tim Sweeney congratuling Juan Gomez in the Unreal talk! 勞

Likely unrelated, but it seems he (Tim) is also working with Simon Peyton Jones 
to create a new language (Verse): 

So Tim, is there anything you want to tell us? 


NimConf 2022 - Saturday, October 22nd

2022-10-22 Thread pietroppeter
here are the slides of our talk (me and @hugogranstrom): 
<https://pietroppeter.github.io/nimconf22-nimib/>

and here is the repo with the source code: 
<https://github.com/pietroppeter/nimconf22-nimib>


NimConf 2022 - Saturday, October 22nd

2022-10-21 Thread pietroppeter
Happy and excited about the upcoming NimConf!拾 

Very curious about all the talks but I gotta ask: @treeform what does "Scratch 
built games" mean? Games built from scratch? Does it has anything to do with 
<https://scratch.mit.edu/> ?

Me and @hugogranstrom probably overdid it a bit in terms of talk duration (it 
was not easy doing the talk together but it was definitely fun and would do it 
again!), but we packed a lot of content, including some new stuff and an 
announcement at the very end, so I hope you will be able to stick around, and 
we plan anyway to be there to answer questions or tell more stuff about 
[nimib](https://github.com/pietroppeter/nimib).


working towards a Nim Devroom at FOSDEM 2023 (physical event)

2022-10-17 Thread pietroppeter
ah btw, talks for last year (virtual) Nim Devroom at FOSDEM are still available 
here: 


working towards a Nim Devroom at FOSDEM 2023 (physical event)

2022-10-17 Thread pietroppeter
Hi all ,

I know we are all eagerly awaiting for NimConf2022 (this Saturday!) schedule to 
be announced...

but in the meantime me and @PMunch are working towards next Nim event, a Nim 
Devroom at [FOSDEM 2023](https://fosdem.org/2023/)!

 [FOSDEM 2023](https://fosdem.org/2023/) will be **in person** ✨ in 
Brussels, Belgium on **February 4th and 5th** (a weekend).

The deadline for submitting a devroom is tomorrow (Tue Oct 18th), but since we 
did it also last year we have most of the material ready (see [repo 
nim-fosdem](https://github.com/pietroppeter/nim-fosdem)). The nice thing about 
this year is that - being a physical event - it could be the first event in 
some time for Nim enthusiasts to meet in person. If you want to ask us stuff, 
discussion about this event is in #fosdem channel on Discord/Matrix.

**If** we get the devroom accepted (we should know by October 31st), then we 
will need you to submit talks (we are targeting half a day of content), so 
start thinking about what you can present (deadline for presentation will 
likely be beginning of December) and make plans to be in Brussels. I know this 
will be of interest mostly to EU-based Nimsters (who wants to organize a 
similar events in other continents?), but I am pretty excited about the 
prospect!

So who would consider coming? Would you consider submitting a talk?

I am in for both!


Some Strange Error When running a simple code

2022-10-11 Thread pietroppeter
> do not enable to use html directly if I am not mistaken

you can with `nbRawHtml` since 3.0 (actually 3.1, in 3.0 was named 
`nbRawOutput`)

wiki I think also uses markdown but powered up by Github and nimib's markdown 
engine (nim-markdown) is likely not supporting them all.

> We might discuss this in another forum post.

yep it would be probably better


Unexpected compile error with implicit generics code

2022-10-11 Thread pietroppeter
> If you want, I can make a nimib for that, I just do not have a blog/webserver 
> to publish and share it.

the simplest way would be to just create a github repo, commit the html and 
publish with github pages (like in 
[nblog](https://github.com/pietroppeter/nblog)), better but more complex would 
be to use [nimibook](https://github.com/pietroppeter/nimibook) (like in 
[scinim/getting-started](https://github.com/SciNim/getting-started) and the 
nice thing is to have CI build docs and deploy preview, but it takes more 
effort). I do plan to improve the state of blogging with nimib (my next 
priority for nimib activities). 


Some Strange Error When running a simple code

2022-10-11 Thread pietroppeter
it might be indeed a bit complicated to convert to nimib but one can try (we 
will likely discover features are missing and some stuff it will be hard to 
reproduce). it would be fun anyway to do similar projects in nim with nimib 
(e.g. scraping rosetta code and running with nimib or creating a nim version 
for [the algorithms](https://github.com/TheAlgorithms))

btw shouldn't I see some button to edit the wiki or this is restricted in some 
way?


nimiSlides  Create beautiful slideshows in Nim 

2022-09-27 Thread pietroppeter
Love the release name (“let it slide, let it slide, let it slide”) which 
already puts you in a festive mood! 


  1   2   3   4   >