Converting Python/Swift to Nim

2020-04-10 Thread chrisheller
/), into Nim. The code is posted here, [https://github.com/chrisheller/experiments/tree/master/swift-python-performance](https://github.com/chrisheller/experiments/tree/master/swift-python-performance), and just walks through doing the same changes that the original author makes to convert

Re: Newbie - trying to compile for macos from windows

2020-02-16 Thread chrisheller
You can try using this Docker image. It supports cross compiling directly, but you can also look at how the Docker image is setup to get more info about how you might do it yourself. [https://forum.nim-lang.org/t/5569](https://forum.nim-lang.org/t/5569)

Docgen for macro generated code

2020-01-04 Thread chrisheller
We have a bunch of Nim types/procs that get generated based on some external data. That all works well, including pulling in the doc comments when running nimdoc. The main issue with the generated doc is that it is all in the same file as whatever module that runs the macro to load the external

Re: Docker image for cross compiling

2019-12-01 Thread chrisheller
Isn't that just building Nim itself on different platforms? I didn't see anything in the official Docker images that are posted, [https://hub.docker.com/r/nimlang/nim](https://hub.docker.com/r/nimlang/nim), about being able to cross-compile your own Nim code.

Re: Docker image for cross compiling

2019-12-01 Thread chrisheller
This is now bumped to Nim version 1.0.4

Docker image for cross compiling

2019-11-20 Thread chrisheller
https://hub.docker.com/r/chrishellerappsian/docker-nim-cross](https://hub.docker.com/r/chrishellerappsian/docker-nim-cross) [https://github.com/chrisheller/docker-nim-cross](https://github.com/chrisheller/docker-nim-cross)

Re: nim users in San Francisco / bay area?

2019-09-06 Thread chrisheller
I'd probably be up for that.

Re: Example implementing SQLite extension in Nim

2019-04-18 Thread chrisheller
I've been testing this with a similar setup to yours, but maybe we have different options for the SQLite library we're testing against. The default SQLite install on my Mac didn't have loadable extension support compiled in, so I tested with a separate SQLite amalgamation. Its the same version o

Re: Example implementing SQLite extension in Nim

2019-04-17 Thread chrisheller
I did just post a more cleaned up version of this on Github as nim-sqliteext, [https://github.com/chrisheller/nim-sqliteext](https://github.com/chrisheller/nim-sqliteext). That uses some macro code to inspect a Nim proc and setup the glue code so that your function can be more Nim focused. It is

Example implementing SQLite extension in Nim

2019-04-12 Thread chrisheller
I was playing around with making a SQLite extension in Nim the other day. Here's a simple example of how to do this. This example defines a _hello_ function in SQL that takes one parameter and returns "Hello ". With a bit more effort you can do things like create virtual tables, etc.

Re: Initializing inherited types in Nim VM

2019-03-20 Thread chrisheller
By the way, this is now working properly on devel builds. # test of initializing inherited types in VM type SomeBaseObj {.inheritable.} = object of RootObj txt : string InheritedFromBase = object of SomeBaseObj other : string proc initB

Initializing inherited types in Nim VM

2019-01-06 Thread chrisheller
This is a boiled down test from another thread about using the pegs module at compile time. I thought I would throw this out there since there seems to be some general CTFE interest going on right now. I poked around in the VM code to see if I could figure out why the inherited type initializati

Re: PEG.js-like API for the pegs module

2018-12-27 Thread chrisheller
By the way, here is a little more detail on one of the issues that I encountered. In pegs.nim (0.19.2 and devel), in the parsePeg proc, the PegParser var that is created seems to get re-initialized after the init call returns when running in the VM at compile time. The existing code looks like

Re: PEG.js-like API for the pegs module

2018-12-26 Thread chrisheller
I was just playing around with this recently. I was experimenting with walking the parsed grammar in a macro and checking for 'handlers' for the rules defined in the grammar. The macro would then map any found handlers into the existing event loop code. Part of the reason for doing it that way

Re: Compile-time type reflection API?

2018-03-16 Thread chrisheller
Keep in mind that you can write some of your own compile time methods if (for example) you're regularly checking for something in the AST.

Re: The cint == int != int trap

2017-11-16 Thread chrisheller
You can run something like nim check --cpu:i386 mynimfile.nim and target different architectures, etc without actually having nim run the C compiler. I have done that before to catch Windows bugs when I was on a Mac that was not setup for cross-compiling. See [https://nim-lang.o

Re: Hey , nim compile --run helloworld.nim

2016-12-12 Thread chrisheller
Yes, the --run (or -r) will run after compiling helloworld.nim. nim --run helloworld.nim won't just run your script.

Re: ARM compiler 6

2016-12-12 Thread chrisheller
Yes, there are several posts about how to set things up for using Nim with ARM (either on the device or cross-compiling). Search the forum for ARM and take a look at some of those posts.

Re: Cross compile to OS X

2016-12-09 Thread chrisheller
I just tried the libui examples with the cross-compiling setup. Seemed to work just fine.

Cross compile to OS X

2016-12-07 Thread chrisheller
et "Hello from Nim" printed to your console. chrisheller@Chriss-MBP:~$ uname Darwin chrisheller@Chriss-MBP:~$ ./ntest Hello from Nim chrisheller@Chriss-MBP:~$ Haven't gone beyond just the Hello World example yet, but wanted to share.