cpp2nim.py - c++ bindings

2020-12-09 Thread shashlick
Both c2nim and nimterop use the Nim compiler's renderer.nim to convert an AST into Nim code so there's no difference there. c2nim parses C++ itself, whereas nimterop uses tree-sitter but both generate Nim AST. My rationale for using tree-sitter and relying on the C preprocessor is documented in

Running fzf from nim (again)

2020-11-02 Thread shashlick
Check out [ff](https://github.com/genotrance/ff). I don't have a way to get the output from fzf but you could potentially write it to a file and read it back in Nim that way.

Nimble path and local packages list

2020-10-14 Thread shashlick
Nimble caches the package list locally in $nimbleDir. That's why you see `/home/user/.nimble/packages_localpackges.json`. See [here](https://github.com/nim-lang/nimble/blob/f4c818a046c2c3ceb1523c4c974e4b6e625d8ca3/src/nimblepkg/packageinfo.nim#L179). You can verify that this file is a copy of th

nimterop - sigjmp_buf

2020-09-30 Thread shashlick
It is mostly coming from [here](https://github.com/ArtifexSoftware/mupdf/blob/eac73e6732b8c649f4d3dc5b05ca782848325e8b/include/mupdf/fitz/context.h#L511). You can use `cOverride()` to define it as `type sigjmp_buf = object` if you don't intend using it. If you do, it will be better to `type sigj

how does `nimble develop` work?

2020-09-23 Thread shashlick
I don't agree with that - once a package is in develop mode, the version is treated as #head. It is up to the user to keep it up to date since they are actively developing that package. The package version is irrelevant after that point. Any package that requires that package will get #head unle

Pros vs. Cons Of Nim In The Large?

2020-09-17 Thread shashlick
There is experimental [code reordering](http://nim-lang.github.io/Nim/manual_experimental.html#code-reordering) to avoid forward declaration headaches.

How to compress a folder?

2020-09-14 Thread shashlick
There's also [nimarchive](https://github.com/genotrance/nimarchive). You could port the [compression](https://github.com/libarchive/libarchive/wiki/Examples#a-basic-write-example) example similar to how the [extraction](https://github.com/libarchive/libarchive/wiki/Examples#a-universal-decompre

Workaround for code reordering in nimterop?

2020-09-08 Thread shashlick
Instead of wrapping all of sys, either skip those symbols if possible, or use cOverride and map it to the right type.

Nimble package structure and interop changes

2020-09-08 Thread shashlick
Added two more issues related to the proposal. * *

Workaround for code reordering in nimterop?

2020-09-07 Thread shashlick
Hold on, it wasn't really broken on devel either, I mistook the missing socklen_t as the issue. `import wrap` works for me. What version of Nim are you using and which OS/distro?

Workaround for code reordering in nimterop?

2020-09-07 Thread shashlick
Looks like `{.experimental: "codeReordering".}` doesn't work on devel for some reason. I tried 1.2.6 and it worked fine. Might want to open a Nim defect on that. Meanwhile, since this is a simple case, you can also just do: static: cSkipSymbol(@["apr_size_t"]) type

Growth of popularity and Nim community

2020-09-05 Thread shashlick
It's very easy to add to the standard library but once added, it needs to be sustained forever, deprecation isn't trivial. People come and go so that responsibility falls on the core team. They are picky for a valid reason. Meanwhile, backwards compatibility is a huge issue that one cannot take

Nimble package structure and interop changes

2020-09-04 Thread shashlick
Big [discussion](https://irclogs.nim-lang.org/04-09-2020.html#13:56:01) on #nim today around this topic. If I summarize it correctly: * The global namespace issue is still being debated with push on one side to remove warnings in nimble, with the other side pushing for more enforcement by rai

Nimble package structure and interop changes

2020-09-03 Thread shashlick
@cblake \- this design is basically Araq's idea with all the consequences documented and mapped to the issues that will get resolved. As for using git worktrees and space efficiency, as interesting as it sounds, it does not seem warranted since it will require quite significant changes to how N

Nimble package structure and interop changes

2020-09-01 Thread shashlick
> The expectation is actually that whenever a package is reviewed for inclusion > in the package list, that it is installed and checked whether it abides by > the package structure rules. > > You're suggesting to give warnings when the package structure is wrong, which > is what we already do,

Nimble package structure and interop changes

2020-09-01 Thread shashlick
Interesting feature, but in this particular case, nimble clones to temp and when the repo is ready, post dep processing and build, copies it to nimbleDir. So worktree isn't appropriate.

Nimble package structure and interop changes

2020-08-31 Thread shashlick
Responding to some points raised by @zahary. Regarding package structure, I've added some info in the `nim.cfg interop` section detailing how multi-package repos can be handled with the same `nim.cfg` path mechanism. But the main motivation of these changes is to simply the lives of library wri

Nimble package structure and interop changes

2020-08-31 Thread shashlick
@Araq \- I've updated the wiki with a backwards compatibility section. Please review changes and let me know if you have any feedback.

Nimble package structure and interop changes

2020-08-27 Thread shashlick
Inviting review and feedback from the community on some Nimble changes that are being planned for the near future. The problem statement and changes are documented on the wiki so as to retain change history. Link: [Package structure and Interop](https://github.com/nim-lang/nimble/wiki/Package-s

New blog post: Ray tracing in Nim

2020-08-17 Thread shashlick
I recently converted my threadpool + async (asynctools) tool to use just threadpool or weave cause asynctools no longer builds for me. I notice that weave is certainly slower than threadpool - at least 20-30% slower. Build: git clone https://github.com/genotrance/autodup cd a

Problem building code on macos with nimble

2020-07-26 Thread shashlick
You need to add requires "ggplotnim >= x.x.x" in your nimble file.

embed DLL into EXE?

2020-07-20 Thread shashlick
Check out [nimdeps](https://github.com/genotrance/nimdeps) which makes this easier - of course, it doesn't load DLL from memory but simply writes it to a file on first start. This also means you have to manually load it with the dynlib module but seems like that's something you plan on doing any