Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 03 2017 15:52
    @dom96 banned @Octopoda7
  • Feb 12 2017 23:57
    @dom96 banned @zzz125
  • Dec 23 2016 19:43
    @dom96 banned @Izrab
Kaushal Modi
@kaushalmodi
shashlick: @timotheecour helped me sort it out
the problem was that I needed that include/search path to stay static to the dir containing that nim file regardless of from where I imported it
From IRC (bridge bot)
@FromIRC
<shashlick> i don't know why you need that cause my tsoloud.nim works fine with relative paths
<shashlick> okay i see - if you import the nim wrapper, it stops working cause you are now elsewhere
Kaushal Modi
@kaushalmodi
that eggx.h has include with <foo.h>
so I need to add the same path to cInclude too
Timothee Cour
@timotheecour
i’m now using abs paths and makes code simpler
From IRC (bridge bot)
@FromIRC
<shashlick> @kaushalmodi - i used sourcepath in the tree-sitter wrapper too - https://github.com/genotrance/nimterop/blob/master/nimterop/treesitter/runtime.nim
Kaushal Modi
@kaushalmodi
shashlick: It's just that I discovered currentSourcePath() today :)
From IRC (bridge bot)
@FromIRC
<shashlick> ya that was a big one even in nimgen days
<shashlick> feel free to join https://gitter.im/nimgen/Lobby to chat about nimterop
Kaushal Modi
@kaushalmodi
will do, thanks
btw can someone point out why that second import line doesn't work? https://ptpb.pw/ObL6/nim
b/bar.nim(2, 31) Error: undeclared identifier: 'currentSourcePath'
Timothee Cour
@timotheecour
because of this:
[0 ] lib/system.nim:3978:10 |template currentSourcePath*: string = instantiationInfo(-1, true).filename
it’s defined in system.nim :)
Kaushal Modi
@kaushalmodi
sorry, I need to sleep it seems
I visited the manual like 5 times, but didn't spot that I was opening system.html
and thank you
Timothee Cour
@timotheecour
np
From IRC (bridge bot)
@FromIRC
<shashlick> how's the actual nim render
<shashlick> with nimterop? is the wrapper working?
Kaushal Modi
@kaushalmodi
@timotheecour a minimal example showing the path differences:
km²~/sandbox/:nim/paths> ls --tree                                                   01/27 11:18pm
./
└── a/
   ├── b/
   │  └── bar.nim
   └── foo.nim
km²~/sandbox/:nim/paths> cat a/foo.nim                                               01/27 11:18pm
import b/bar
km²~/sandbox/:nim/paths> cat a/b/bar.nim                                             01/27 11:18pm
from macros import getProjectPath
from os import getCurrentDir, parentDir # doesn't work

const
  sDir = currentSourcePath.parentDir()
  pDir = getProjectPath()
let
  cDir = getCurrentDir()

echo "Source path = ", sDir
echo "Project path = ", pDir
echo "Current path = ", cDir
shashlick: if that question was for me, I just got that wrapper to compile
now working on translating some C code to Nim in that wrapper
Timothee Cour
@timotheecour
@kaushalmodi please report all issues u encounter in the bug tracker (after checking they’re not dups :)
Kaushal Modi
@kaushalmodi
will send a PR for this to an appropriate place in the manual
(that "doesn't work" in the comment is old, doesn't apply any more)
Timothee Cour
@timotheecour
ya that example (prettified a bit and with doAssert instead of echo) would be fine in doc (not runnableExamples but as code block)
From IRC (bridge bot)
@FromIRC
<yunfan> hi i was on alpinelinux v3.8.1, and i met a problem while installing nim using choosenim script
<yunfan> the downloaded file exsts at /tmp directory and i had gave it executing permission, but still gave me file not exist while i execute it by manual
<leorize> yunfan: maybe you should try building it manually?
<leorize> oh, and choosenim might have been compiled with glibc, so it wouldn't work on your device
<yunfan> leorize: got it, alpine were upon on musl
From IRC (bridge bot)
@FromIRC
<leorize> I can compile you an alpine version of choosenim, if you trust binaries from strangers :⁠)
<leorize> or you could build the compiler yourself, then use it to compile choosenim :⁠P
<yunfan> leorize: that would saved lots of my time :⁠D
From IRC (bridge bot)
@FromIRC
<leorize> yunfan: http://ix.io/1zod
<leorize> that's an .xz archive
<leorize> extract it and you'll get choosenim :⁠)
<yunfan> thanks
<leorize> oops, you can't dlopen using a static musl binary
<leorize> wait, I'll compile a shared one
<leorize> http://ix.io/1zof
<leorize> ^ that's the shared version of the binary (xz compressed)
From IRC (bridge bot)
@FromIRC
<yunfan> ok, the latter version works
Kaushal Modi
@kaushalmodi
what does this in C extern void eggx_gsetinitialparsegeometry( const char *, ... ) ; map to in Nim?
not sure how to google "..." syntax for C