<< 24-10-2017 >>

00:09:25FromGitter<watzon> (https://files.gitter.im/nim-lang/Nim/1QK1/image.png)
00:09:44FromGitter<watzon> What is this madness? The js compiler is also a php compiler?
00:11:51GitDisc<GooRoo> JS and PHP, best languages ever…
00:12:08GitDisc<GooRoo> especially in combination
00:28:35FromGitter<watzon> Lol for real 
00:29:17watzonWhat's the best way to make an http request to a JSON api in nim?
00:29:27watzonAny good libraries?
00:32:21SunDwarfpipe httpclient into jsondecode
00:35:15FromGitter<Yardanico> watzon: stdlib is your best friend
00:47:15*sleepyqt quit (Quit: Leaving)
00:55:29skrylarlibcurl is nice for such things
01:53:38skrylarwonder if there would be any point to dbase support in nim
01:57:07FromGitter<qqtop> dbase no , firebird yes
02:00:58*user3382 joined #nim
02:01:54user3382if i wanted to write my own language more as an exercise in semantics and logic flow than a truly seperate language, would nim be ideal for this?
02:02:45GitDisc<GooRoo> dbase no, firebird no, influx yes
02:03:07GitDisc<GooRoo> @user3382, just use MPS, dude
02:03:59user3382thats a dsl on java thou?
02:04:10user3382what if i want to redefine how c++ works to make it legible and straightfoward to use
02:05:02GitDisc<GooRoo> like for example?
02:06:52*AlexMax joined #nim
02:10:22*mwbrown quit (Quit: Exiting)
02:15:56user3382like nim does but more
02:22:32*user3382 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
02:23:07*mwbrown joined #nim
02:25:38GitDisc<GooRoo> I believe that Nim is good enough for this. However to be more precise you'd better give us more details
02:26:00GitDisc<GooRoo> Have you already filled this checklist?  http://colinm.org/language_checklist.html
02:30:25*vlad1777d quit (Ping timeout: 248 seconds)
02:34:10*def-pri-pub joined #nim
02:40:49FromGitter<gogolxdong> Is there anything like py2nim?
02:45:25*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:01:18FromGitter<Varriount> user3382: Making a programming language is a non-trivial project.
03:01:25FromGitter<Varriount> Especially if it's compiled.
03:02:02FromGitter<Varriount> You need a tokenizer/parser, abstract syntax tree, semantic checker, and backend emitter at the very least.
03:02:43FromGitter<Varriount> For compiled languages, you need details about the architecture that you're targeting too.
03:34:26*Nobabs27 joined #nim
03:34:51AlexMaxhttps://forum.nim-lang.org/t/3254/2
03:35:22AlexMaxI think I know the answer to this, but why a no-GC runtime slower overall?
03:41:39*Nobabs27 quit (Quit: Leaving)
03:57:58*smt` joined #nim
04:00:58*smt quit (Ping timeout: 255 seconds)
04:17:46*def-pri-pub quit (Quit: Leaving.)
04:22:57*dddddd quit (Remote host closed the connection)
05:25:51*miran joined #nim
05:44:30*nhywyll joined #nim
05:44:56*nsf joined #nim
06:01:05*couven92 joined #nim
06:08:59skrylarAlexMax, because GCs are faster (short version) than manual alloc
06:09:50skrylarlonger version: depends on the GC, and the application, but the cost of memory fiddling can be amortized in to time your program is idle anyway, whereas auto refcounters are paying that cost 100% of the time
06:10:12skrylarlike if you are waiting on IO, you can do some collection cycles instead of just doing nothing
06:13:19*miran quit (Ping timeout: 248 seconds)
06:34:08*PMunch joined #nim
06:43:41*miran joined #nim
06:44:20*gokr joined #nim
06:44:32FromGitter<mratsim> @user3382 check what @gokr did with is own lang written in Nim: http://goran.krampe.se/2016/08/26/benchmarking-spry-vs-squeak/
06:45:39FromGitter<gokr> Might be easier to start at http://www.sprylang.org
06:46:24FromGitter<gokr> And my articles on the journey so far: http://goran.krampe.se/category/spry/
06:47:12gokrOh, he is not around anymore
06:47:59*nhywyll quit (Quit: nhywyll)
06:56:41*Arrrr joined #nim
06:56:41*Arrrr quit (Changing host)
06:56:41*Arrrr joined #nim
07:07:47PMunchNice talk subsetpark :)
07:09:17GitDisc<GooRoo> Could you, guys, please share a link to the talk. I missed it somehow.
07:11:25miranhttps://www.youtube.com/watch?v=IVgNVJdizHg
07:11:45GitDisc<GooRoo> Thanks
07:12:54*claudiuinberlin joined #nim
07:20:40ArrrrAh, i see this link on reddit
07:30:40*Arrrr quit (Ping timeout: 255 seconds)
07:38:11*Arrrr joined #nim
07:38:12*Arrrr quit (Changing host)
07:38:12*Arrrr joined #nim
07:42:29FromGitter<alehander42> @mratsim unittest works fine with js for me too
07:49:52*libman quit (Quit: Connection closed for inactivity)
07:50:00*hogeland joined #nim
07:51:39hogelandokay time to stop getting spammed by gitter and instead idle in irc
07:54:53FromGitter<mratsim> Just deactivate gitter notifications except on mentions
08:02:52*hogeland is now known as kh
08:02:59*kh is now known as hogeland
08:24:15*floppydh joined #nim
08:24:39floppydhcan I import modules from a libraries private dir?
08:24:41floppydhoutside of it
08:24:52FromGitter<mratsim> I don't know if @johnnovak is hanging there but very interesting piece on game rendering HDR, contrast, Tone mapping, https://ventspace.wordpress.com/2017/10/20/games-look-bad-part-1-hdr-and-tone-mapping/
08:24:58*hogeland quit (Quit: leaving)
08:25:13FromGitter<mratsim> @floppydh, with the path
08:25:34floppydhmratsim so like somelib.private ?
08:26:07floppydhmratsim ah got it like this somelib/private/...
08:28:11*hogeland joined #nim
08:29:32*ibutra joined #nim
08:31:49*skrylar reads over said article anyway
08:33:01skrylarI don't know really.
08:33:42skrylarInnovation happens on the small scale, and the small scale doesn't have access to the "training" he keeps going on about
08:34:00*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:35:05*claudiuinberlin joined #nim
08:36:21skrylari know there are also some oddities in that artists really prefer stuff to look like it does in their editors, and it can be hard/impossible to change the way your modeler grades the viewport
08:37:31skrylarthat issue doesn't exist in VFX tools, since ex. Nuke/Natron will just let you dump a grading node in place
08:38:03*hogeland quit (Quit: Lost terminal)
08:38:27*hogeland joined #nim
08:58:16gokrJust published one of those "here's how to get cracking with Nim" blog post, for fun. Anyone want to proof-run through it?
08:58:45gokrI should put in some fun memes too - but don't have time right now ;)
08:58:55gokrhttp://goran.krampe.se/2017/10/24/nim-crash-course-inside-lxc/
09:08:19PMunch"but much more lightweight similar to Docker." maybe a comma after "lightweight"?
09:08:41PMunch"Contrary to Docker thoigh", assume you meant "though"
09:08:58miran"I should put in some fun memes too" - nah, you're fine without it
09:09:15miranand i say that before reading a word from the link
09:09:40PMunchmiran, haha agreed
09:10:28PMunchI get the need to put in some images or something that can break the monotomy of pure text (my own posts are pretty bad at this, very wall-of-texty)
09:10:51PMunchBut it's so strange when it's just images trying to express some reaction
09:11:25PMunchIt is a bit hard though writing about computer languages or programming in general and find related images..
09:11:40PMunchSeing how most of it is just text based anyways..
09:12:25miranyou (general you) can break a pure text with section names and stuff like that (more text to break text monotony :))
09:13:06PMunchTrue, but that requires that you actually change subject
09:13:27miranjust scrolled through the link and - text is already nicely broke into parts. really no need for memes
09:14:02*chuqkyjhgq joined #nim
09:14:03*chuqkyjhgq left #nim (#nim)
09:14:07PMunchYeah, I was talking more in-general
09:14:25PMunchTake an example from my site for example: https://peterme.net/cross-platform-guis-and-nim-macros.html
09:14:50PMunchText galore..
09:15:31miranwell, you have section names. without them, this would be impossible to read
09:16:14PMunchYeah, fair enough
09:16:45miranand this probably looks like lots of text because of large font size (which is much better than small font size which might look like less text)
09:17:03PMunchYeah, it was even larger before but I tuned it down a bit
09:17:26PMunchI feel this is a good compromise
09:17:59mirani prefer large text. on typical sites/blogs i need to zoom in to read comfortably, not the case with your blog
09:19:55*sz0 joined #nim
09:22:28mirangokr: "I am not going to explain the code" - maybe you could explain it just a bit for the beginners, for example: what is `discard`, why you use `result` variable (without `var`), etc.
09:23:02gokrOk, back, cool - I will scan all you wrote here
09:23:58PMunchmiran, yeah readability was a large focus for my site. Limiting the width of the text, giving it maximum vertical size by moving the bar to the side, giving you the option to collapse the bar to remove distractions, choosing a font that is known for being nice to read (LaTeX default font) etc.
09:24:34ibutraI must admit I don't quite understand why you put the LXC in there. Does it help undestand somethin?
09:24:48ibutraIn addition the nimble install will install into the path of the LXC or not?
09:24:51miranPMunch: Computer Modern (LaTeX default font) is nice, but there are better (more readable) fonts, IMO
09:25:16ibutrathat could be a little counterintuitive for beginners
09:26:00PMunchmiran, sure. But the LaTeX default was an easy way to go
09:26:14PMunchPlus I really like it personally :)
09:26:43miranPMunch: like many many users of LaTeX :)
09:27:40miranbtw, i use Palatino when writing in LaTeX, and Merriweather as my serif font in browser's reader mode
09:27:58PMunchOooh, I'll be sure to check those out
09:28:06PMunchAlways on the lookout for good fonts :)
09:28:21PMunchBut now I'm off for lunch
09:28:28gokributra: I agree, the LXC was just because... I experimented with it ;)
09:28:48FromGitter<mratsim> I have a font collection, in Latex I'm fond of Fontin, Fontin Sans, Audimat and Delicious
09:28:59miranPMunch: take my advice - don't go on the lookout for good fonts - this is a road without end. it's disastrous!
09:29:09gokributra: The whole rest of the article is done inside the LXC container. It's like a VM.
09:30:11FromGitter<mratsim> @gokr, I'm even further than you, I'm using Nim in LXC running GPU code from the container
09:30:46FromGitter<gokr> :)
09:30:56ibutraI get that experimenting thing. But I imagine some beginner scratching his head why his program isn't working in his normal environment. Maybe a small addition in the end that it is installed inside the container and added to its path would help?
09:31:43FromGitter<gokr> Yeah, sure. And also, one of the ideas of doing the whole excercise inside a fresh LXC - was for avoiding inconsistencies.
09:31:57FromGitter<mratsim> https://andre-ratsimbazafy.com/cuda-gpu-passthrough-to-a-lxc-container/
09:54:06ArrrrI need a way to provide a default value to untyped in a template. Is such a thing possible?
09:57:49PMunchHaha miran I know. The trick is to not go looking, but note down the ones you like so you have them for later ;)
09:58:27mirangood luck with that :)
09:58:54PMunchmiran, just had to find a good small caps font though. That was quite a project..
09:59:24miranbtw, to me - Computer Modern is a font that looks good on the paper and with small size on the screen. for larger sizes (like on your blog), i would look for another font :)
10:00:32*ibutra_ joined #nim
10:02:33*ibutra__ joined #nim
10:04:15*ibutra quit (Ping timeout: 258 seconds)
10:04:48*gggs joined #nim
10:04:51*ibutra joined #nim
10:06:22*ibutra_ quit (Ping timeout: 264 seconds)
10:06:53watzonWhat's the easiest way to write to a new file in nim?
10:07:06watzonSomeone told me the other day, but I forgot
10:07:15watzonIt was one command
10:07:28*ibutra__ quit (Ping timeout: 240 seconds)
10:08:06FromGitter<ephja> writeFile(filename, content: string)
10:08:15FromGitter<mratsim> @Arrrr can't you use var default: type(your_untyped_input) ?
10:08:42watzonephja that's it!
10:11:08watzonHow about checking for the existence of a file?
10:13:10FromGitter<gokr> https://nim-lang.org/docs/theindex.html#fileExists
10:13:19FromGitter<gokr> The index is your friend.
10:14:06dom96Kinda sucks a bit that the devs of Starbound decided to use Rust for their next game, but let's see what comes of this: https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dot8gr2/
10:14:34Arrrrno, the issue is that arg: untyped = DefaultVal doesn't work
10:14:36FromGitter<ephja> https://nim-lang.org/docs/system.html
10:14:59federico3http://pyvideo.org/pygotham-2017/nim-a-new-option-for-optimizing-inner-loops.html
10:15:04Arrrrfor example, default could be (discard 0)
10:17:19floppydhso I just realized I don't get includes, if I include foo that includes bar I can't see the symbols of bar unless they're exported?
10:17:54ArrrrIn theory, if a includes b a b includes c, a should be able to see c
10:18:02floppydhin theory
10:19:04PMunchdom96, it would be amazing if they did it in Nim instead
10:19:09ArrrrIf that doesn't work, you can always include both b and c from a
10:19:12dom96floppydh: why are you using includes in the first place?
10:19:23dom96an include is essentially copy and pasting the file into where the include is
10:19:24floppydhdom96: I try to access nonexported stuff from nigui
10:19:34dom96floppydh: why?
10:19:40floppydhdom96: because it wraps some nice windows stuff
10:20:02ArrrrReport it as a bug and see what araq has to say
10:20:18floppydhnote that a doesn't include at the top, it defines some stuff, then includes, defines other stuff and includes something else, so I'd basically have to copy a
10:20:36floppydhwell I guess I'll just copy paste it out of there for now
10:20:43dom96floppydh: in that case it may be worth submitting a PR to expose it
10:21:05PMunchfloppydh, grep "include .*" nimui.nim
10:21:17*xet7 quit (Quit: Leaving)
10:21:20floppydhPMunch: thats not the issue, a defines stuff that the include relies upon
10:21:43floppydhdom96: I guess that would be the right thing
10:22:00floppydhthanks everyone tho
10:25:31watzonQuestion about the posix `mkdir` proc. What is the mode exactly? `mkdir(a1: cstring; a2: Mode): cint`
10:25:50watzonIt's of type `cint`, but there's no documentation as to what int means what
10:27:47dom96http://pubs.opengroup.org/onlinepubs/009695399/functions/mkdir.html
10:28:02dom96Why are you using it directly?
10:28:20*ibutra_ joined #nim
10:28:40*xet7 joined #nim
10:29:21watzondom96: Is there a better way?
10:29:34dom96os.createDir
10:29:55floppydhokay its all fine, as I suspected, it was a mistake on my part, include works fine
10:30:14dom96also, welcome to you both watzon and floppydh :)
10:30:45watzondom96: Oh I've been here for a while haha. Just came back though after a long break, so thanks :)
10:30:48floppydhdom96: oh thank ya, I'm a lurker tho with different names I've been welcomed before
10:30:53floppydhhah watzon
10:31:42floppydhthe move-pointer-less stuff Araq did a cast on looked really lovely, you guys are doing a great job
10:32:08*ibutra quit (Ping timeout: 240 seconds)
10:50:10*dddddd joined #nim
11:00:48*Viktor_ joined #nim
11:01:41*ibutra_ quit (Ping timeout: 240 seconds)
11:02:27*Snircle joined #nim
11:02:54*ibutra_ joined #nim
11:03:44Viktor_Do you guys expect Nim adoption to explode after 1.0 release? It has everything to going for it, great performance, great productivity, wide array of usage possibilities (system, embedded, web server etc.).
11:04:56CalinouI don't think so, Rust adoption didn't explode after 1.0 either
11:05:05Calinouit's getting slowly and surely popular
11:05:17Calinou(I've seen a job offer from my university, asking for a C++ and Rust programmer. However, they pay like crap)
11:05:26Calinou(good old "If you ask for a Superman, all you'll get is a Deadpool")
11:06:23PMunchViktor_, I think one of the things that's holding it back is the lack of common packages. AWS is for some reason mentioned very often for example
11:06:51PMunchBut it's a bit of a chicken and egg problem. If there are no libraries you don't get users, but without users you don't get libraries.
11:08:42floppydhI enjoy nim being more on the experimental side, I love seeing new stuff put in, be it language features etc. without actually having to be shoe-horned into the whol thing for a big project, so I'm really just fine with how it is :3
11:09:14cremYes, hopefully nim will never be 1.0 :)
11:09:43cremI know it will, but still hope..
11:09:57*Arrrr quit (Ping timeout: 240 seconds)
11:10:59AraqI'd throw away the version number at this point and release Nim 2017
11:11:21*derlafff quit (Quit: No Ping reply in 180 seconds.)
11:12:06cremAfter 1.0 there's no really easy way to do breaking changes. I remember people disappointment when D v2.0 was released.
11:12:17federico3how about freezing the spec in 2.0 instead?
11:12:27*derlafff joined #nim
11:12:34*Arrrr joined #nim
11:12:34*Arrrr quit (Changing host)
11:12:34*Arrrr joined #nim
11:12:43Viktor_federico3 then there is not much point calling it 1.0
11:14:02federico3Viktor_: it sends a message. A large number of features can be frozen in 1.0, just not everything.
11:15:13*sleepyqt joined #nim
11:16:30*derlafff quit (Read error: Connection reset by peer)
11:16:56miranfederico3: and then be prepared for users' hate when 2.0 breaks some things
11:17:36*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:18:10FromGitter<krux02> federico3: is there a language spec of Nim?
11:18:28federico3miran: not if the freeze is very clerly spelled out
11:18:31cremI like rolling updates more than annual releases!
11:18:50FromGitter<krux02> always break it a little bit
11:19:05cremyes
11:19:14cremThat keeps developers alert.
11:19:32cremAnd they constantly keep context of what's happenning in the code.
11:19:49cremOtherwise it's easy to forget what you wrote.
11:19:49FromGitter<krux02> well nothing is for free
11:19:58Araqkrux02: yeah, that's exactly what we need to stop doing
11:20:15FromGitter<krux02> when the language can change at any time, people do not want to have huge codebases, because small changes can cause big problems
11:21:09FromGitter<krux02> Araq: there are minor things in Nim, where I see breaking changes inevitable.
11:21:22Araqlist them
11:21:32FromGitter<krux02> you know them
11:21:42AraqI don't know if I know them all
11:21:54*elrood joined #nim
11:21:56FromGitter<krux02> int and int64 are different type, float and float64 are identical
11:22:26Araqint as a builtin type has its advantages though
11:22:29FromGitter<krux02> and ``mySeq.isNil`` should be derecated and always return false
11:22:58Araqtried that in a branch, causes weird crashes
11:22:58FromGitter<krux02> well but it is kind of weird when I write functions for different types
11:24:08FromGitter<krux02> and then ``proc f(arg: float32) `` and ``proc f(arg: float64)`` is enough to support all floating point types, but for integers I have to also support ``int``
11:24:30FromGitter<krux02> it happened to me when writing a wrapper
11:24:50FromGitter<krux02> I tried it, too
11:25:05FromGitter<krux02> as you said, weird crashes
11:25:30*derlafff joined #nim
11:26:12FromGitter<krux02> it would also be nice, when you could see that int is just an alias for either int32 or int64 depending onthe architecture
11:26:17miranjust x-posted the video about optimizing inner loops to /r/python - they might be more interested than the general /r/programming public
11:26:30FromGitter<krux02> I mean if you could see that in the system module
11:26:59FromGitter<krux02> when [[is64bitArchitecture]]: type int = int64 ...
11:27:20dom96krux02: maybe you could just `SomeNumber` instead?
11:27:40dom96as for seeing what 'int' actually is, that's a docgen feature
11:27:43FromGitter<krux02> no, that doesn't solve the problem
11:27:44Araqkrux02: these things must not block v1 anymore, they take months to correct
11:27:45dom96that I have had planned for a while
11:28:06Araqthere will be a version 2 anyway which will be closer to perfection
11:28:14dom96Me and Araq are probably gonna do a livestream discussing v1 at some point
11:28:29Araqthe point of a v1 is to say "ok, you can use it now and
11:28:36Araq**fixes will be backported**
11:28:46ArrrrHow is that closer to perfection if you kill GC
11:29:38AraqArrrr, that's a whole different discussion and "ref got more expensive but supports threading now" is not killing the GC anyway
11:30:42Araqit's just a GC that works with destructors properly then
11:31:10PMunchIs there a better way to load a dynamic library and give it access to your procedures than to pass them all in a setup call?
11:31:52dom96GC won't be killed before v1
11:32:24ArrrrHow can i do sensitive work with var seqs if everything works inside a try catch?. The trolling about GC being slow is going to be a trifle in comparison to this
11:32:52AraqI don't understand you.
11:33:05FromGitter<BigEpsilon> Hi, I have a little problem, I have this code that does not compile, but I'm not sure if it is a bug or not : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a
11:33:17FromGitter<krux02> dom96: http://ix.io/BIr
11:33:40*Viktor_ quit (Ping timeout: 260 seconds)
11:34:24GitDisc<GooRoo> is there any public roadmap available?
11:34:33PMunchFor reference this is what I do now: https://pastebin.com/xMUr8Qnc https://pastebin.com/acK0dAXS which works fine for a couple procs. But this is about 80+ procs, some with just different signatures which would have to be wrapped in a template or something..
11:34:48dom96I hope I get an answer on reddit though. I'm curious if that developer considered using a real-time GC
11:35:06dom96This has been how we've been "marketing" Nim's GC for forever.
11:35:10dom96Is it wrong?
11:35:39Araqlet me say it again then:
11:36:10FromGitter<BigEpsilon> somehow VecAll[T, 3] can not be instantiated, and sorry for coming in the middle of an ongoing conversation
11:36:12Araqthere is nothing wrong with Nim's GC, especially not "omg, unpredicted pauses"
11:36:22dom96BigEpsilon: tough one, possibly a bug.
11:36:34dom96(or just a known limitation)
11:36:40Araqit's just that all GCs share certain problems
11:36:59FromGitter<krux02> dom96: the code I just sent you doesn't compile and I think that's a problem
11:36:59Araqwhich is interop with runtimes that use no/a different GC
11:37:21Araqas well as encouraging logical leaks
11:37:35*derlafff quit (Remote host closed the connection)
11:37:59dom96krux02: cast to largest int type?
11:37:59FromGitter<krux02> because when I would add a workaround to make it compile, then actually making int an alias type would not compile with the workaround
11:38:04Araqand unclear ownership rules which makes code harder to multi thread and comprehend
11:39:18AraqArrrr, the try is really cheap when compiling to C++ or LLVM.
11:39:51FromGitter<krux02> dom96: so you dismiss that calling the function with a 32 bit int argument might actually have importance?
11:39:57dom96Araq: Sadly most of Nim code is still compiled to C though
11:39:58ArrrrWell i hope that performance cost is not too high because not every software, at every function, needs interop with C or multithreads
11:40:27Arrrrbut the change seems to affect everything
11:40:34dom96krux02: sorry, I really don't know. Just trying to guess a workaround for you.
11:41:21*Yardanico joined #nim
11:41:36FromGitter<krux02> dom96: I have a workaround, but I think it's ugly and the workaround would crash as soon as int64 and int become the same type
11:41:48FromGitter<krux02> therefore I would like to have this happer rather sooner than later
11:43:35FromGitter<BigEpsilon> Thanks @dom96 ! If any one have a workaround I'll take it gladly : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a
11:44:10Araqbigepsilon: default parameters don't store the dependency to the 'T' here, just use an overload?
11:45:02FromGitter<BigEpsilon> ok thanks Araq I'll try that
11:45:41AraqArrrr, dom96 I know it's a pervasive change in the implementation, spec-wise it's mostly compatible with today's Nim
11:46:22Araqit's a tremendous amount of work which is why it's detached from Nim version 1
11:48:09dom96okay, maybe I need to read the blog post again
11:50:02miranlet's bring in some new python crowd to nim - https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/
11:50:11miranupvote for visibility :)
11:50:30dom96upvoted :)
11:51:11mirandom96: and be prepared to answer nim-related questions, if there will be any :)
11:51:55PMunchIs something like this: https://stackoverflow.com/a/17099137 possible in Nim?
11:51:59dom96Araq: What's your plan with destructors for Nim v1?
11:52:01PMunchOr the answer above it for that matter
11:52:29ArrrrEverybody makes fun of "Rewrite in rust" evangelism, so beware of spamming nim links.
11:53:02dom96Posting such links isn't the same
11:53:29Arrrri hope they think the same
11:54:08mirandom96: are you sure you didn't downvote? :D
11:54:14Araqdom96, I would like to get them stable as "opt-in", so you can write your own seqs and strings but the existing GC infrastructure/runtime stays as it is and doesn't use them
11:54:47dom96miran: Reddit fuzzes the score
11:55:03dom96But yes, I'm sure
11:55:13miran:)
11:55:17dom96Araq: Okay, but can we use them in the stdlib?
11:56:02Araqdom96, probably
11:56:13FromGitter<BigEpsilon> I think my issue is related to https://github.com/nim-lang/Nim/issues/5595
11:56:28dom96Araq: Essentially I want to use it for `close`
11:57:34arnetheduckYardanico, I am now
11:59:14Yardanicoarnetheduck, I wanted to ask you about compiling/running nlvm
11:59:26YardanicoI've added -fpermissive to compile nim compiler successfully
11:59:30Yardanicobut it fails at linker step
12:00:11Yardanicoarnetheduck, https://gist.github.com/Yardanico/7422b7c80ae945387538b7ced59cc1aa
12:02:14arnetheduckwhat are you compiling with?
12:03:12arnetheduckand does /home/tiber/stuff/nlvm/nlvm/nimcache/wrapper.o exist?
12:03:21arnetheduckI've noticed nim forgets to compile it sometimes
12:03:38Yardanicoarnetheduck, g++ versionb is 7.2.0
12:03:42Yardanico*version
12:03:57Yardanicoarnetheduck, yeah, wrapper.o doesn't exist
12:04:27dom96try passing '-f' to Nim
12:04:58arnetheduckI usually do some trivial modification to llvm/wrapper.cc and then nim will recompile it
12:05:10Yardanicoarnetheduck, ok
12:05:35Yardanicoarnetheduck, ah, sorry
12:05:36Araqdom96, for files that requires working moves
12:05:37Yardanicowrapper.o is here
12:05:45Yardanicoin nlvm/nlvm/nimcache/wrapper.o
12:06:13Araqor maybe not
12:06:58arnetheduckthough clearly something is broken with the way nim detects if {.compile.} files need recompiling
12:08:41Yardanicoarnetheduck, IDK really, wrapper.o is here
12:08:45arnetheduckanyway, the stuff you're getting linker errors for are in that file, not sure why they're not being picked up.. can try removing it
12:09:05dom96Araq: why would it require moves?
12:10:59Yardanicoarnetheduck, even if I remove wrapper.o, so it's recompiled - linker still errors
12:12:41Araqdom96, let f = open(); s.add(f); # escapes, injected destroy(f) must be a nop
12:13:30dom96Araq: Indeed, I would expect destructors to handle this.
12:13:46*Vladar joined #nim
12:13:49dom96this can happen for everything really
12:13:58dom96so if destructors fail at this then they're not working properly
12:14:51arnetheduckYardanico, actually, now that I removed my old copy and rebuilt it, I'm getting errors to.. will have a look
12:16:28Araqdom96, you don't understand
12:17:55Araqthe problem is that usually assignments for 'File' copy some handle/pointer, we need to overwrite assignment here so that either it's disallowed and only moves are allowed or that refcounts the usages in order to not close the file too early
12:19:07FromGitter<mratsim> @bigp
12:19:10dom96hrm
12:20:08FromGitter<BigEpsilon> yes @mratsim :)
12:20:15FromGitter<mratsim> @BigEpsilon @dom96 maybe try to add a dummy static default parameter for https://github.com/nim-lang/Nim/issues/5595, it worked for me in https://github.com/nim-lang/Nim/issues/6343
12:20:52FromGitter<mratsim> it’s ugly but you gotta do what you gotta do :P
12:21:08arnetheduckbah, it worked with gcc 6.x, but not with 7.x
12:21:34dom96Araq: I thought File was just a file descriptor.
12:21:43*Viktor_ joined #nim
12:22:12dom96So what can we do?
12:22:17Yardanicoarnetheduck, well I can install gcc 6 for now
12:22:41dom96Is it too difficult, should we give up on using destructors in the stdlib for v1?
12:23:48arnetheduckYardanico, looks like travis is broken too, it's something genuinely wrong that maybe worked because I had an old wrapper.o lying around
12:24:00watzonHow do you cross compile for windows?
12:24:05Yardanicowatzon, use mingw
12:24:40watzonFrom linux? I've never done that before haha
12:24:44Yardanicowatzon, yes, from linux
12:24:50Yardanicoinstall mingw using your package manager
12:24:54Yardanicoand then use it instead of gcc :)
12:25:14Yardanicowatzon, example config https://github.com/VKBots/Nickel/blob/fd1fe80931b0255fca5a23f12c0b2bfe3c6e5a6d/src/nim.cfg#L15 (don't look at comments)
12:25:20FromGitter<BigEpsilon> @mratsim I think the problem here is different. In my case it seems that default arguments do not store enough information to instantiate their generic parameters
12:25:26watzonAhh so you can't cross compile a windows executable from nim itself?
12:25:40Yardanicowatzon, nim compiles to C++/C
12:25:52Yardanicoyou can still output C code for windows
12:25:56Yardanicoand then compile C code under windows
12:25:59Yardanicobut it's easier with mingw
12:26:02FromGitter<BigEpsilon> same with dom96 issue
12:26:14Yardaniconim itself is a Nim2C compiler, not Nim2Binary
12:27:26FromGitter<BigEpsilon> @mratsim , other example : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a
12:28:25FromGitter<BigEpsilon> the workaround for my specific problem is use overloading insteed of default paramter as Araq suggested
12:30:42Yardanicoarnetheduck, ah, fails with g++-6 too
12:36:05arnetheduckYardanico, pushed a small fix, can you try make clean;make
12:37:25Yardanicoarnetheduck, works!
12:37:32Yardanicowith g++ 7 too
12:37:35Yardanicoyay
12:38:05arnetheduckgreat - when do I get the first pull req? ;)
12:38:15Yardanicoarnetheduck, xD
12:38:29Araqdom96, dunno, too early to decide on that
12:39:17*Arrrr quit (Read error: Connection reset by peer)
12:39:20dom96Araq: If we want v1 by January then I don't think it is :)
12:39:44Yardanicodom96, so deadline for 1.0 is january?
12:41:01dom96It would certainly be nice :)
12:41:48FromGitter<Varriount> dom96, araq: The problem is similar to why sequences must be copied, right? Unless you have a refcount with the file object, the destructor will still be called, even if there are other copies of the file handle in the program.
12:42:43Yardanicoarnetheduck, and what can be the reason of /usr/bin/ld: /home/tiber/projects/experiments/nimcache/genpi.o: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC ?
12:43:43arnetheduck-fPIC compile flag is missing somewhere? ;)
12:44:14arnetheducklikely you're trying to create a shared lib somewhere which nlvm doesn't even try to support..
12:46:39miranAraq, dom96: if v1.0 is planned for january (or whatever), have you maybe considered some kind of "month of bugfixes" before the release where we (the community) would try to close as many issues as possible?
12:47:44miranfrom what i could tell, currently there are more new issues than closes (in the same period of time)
12:47:51dom96miran: nope, maybe you could organise one :)
12:48:16watzonDamn I can't get this mingw stuff working
12:48:19dom96For v1 though it's more important to focus on breaking changes than bug fixes.
12:48:40Yardanicowatzon, ?
12:48:53watzonI installed it and set up my nim.cfg file similar to Nickel's
12:49:05mirandom96: i would gladly help, but my nim knowledge is quite limited.... as you have probably seen - i've submitted only PRs for some very easy issues
12:49:06watzonBut I keep getting `fatal error: io.h: No such file or directory`
12:49:28watzonWhich it the same thing that happens with no mingw
12:49:50mirandom96: but then again, those issues are probably quite boring for you more experienced guys, and your time is better spent on those breaking changes that you mention
12:49:54watzonWould this be the right command to use? `nimble build -d:release --os:windows`
12:50:33Yardanicowatzon, I've never used nimble for cross-compiling
12:50:36dom96watzon: you likely need to specify --cc: as well
12:50:39Yardanicoonly nim compiler itself
12:50:46Yardanicoand yeah, you need to specify mingw compiler
12:50:55Yardanicodom96, ah, sorry, you don't need it
12:51:03Yardanicoyou need to specify gcc path and executable
12:51:12dom96yes
12:52:00Yardanicoarnetheduck, it worked when I took LLVM IR compiled by nlvm, ran "opt" on it, then llc -filetype=obj -relocation-model=pic , and finally "gcc data.o -o a.out"
12:53:37Yardanicoand hello world executable is smaller than nim with C backend :P
12:56:54Yardanicoand we hit 1,100 issues again :(
12:57:26*ryanhowe joined #nim
12:57:49FromGitter<data-man> Hi, Nim lovers!
12:58:03Yardanicohi
12:58:03miranYardanico: are you volunteering for the mentioned "month of bugfixes"? :)
12:58:09watzonWhat would I use for the --cc: param?
12:58:15Yardanicowatzon, don't use it
12:58:22watzonOh ok haha
12:58:30Yardanicowatzon, did you see https://github.com/VKBots/Nickel/blob/fd1fe80931b0255fca5a23f12c0b2bfe3c6e5a6d/src/nim.cfg#L15 ?
12:58:33Yardanicodo the same
12:58:39FromGitter<data-man> https://github.com/nim-lang/Nim/pull/6582 Please, (Enj|Destr)oy! :)
12:59:10watzonI did, and it's in the same spot. How do I make sure nim is using that config file?
12:59:42Yardanicowell your config file should be in the same directory as your main source file
13:00:02Yardanicoor you can compile via a command like this:
13:00:02Yardaniconim c --gcc.linkerexe="mingw binary" --gcc.exe="mingw binary" --gcc.path="mingw binary path" --gcc.options.linker="" --os:"windows" -d:windows
13:00:03watzonIt is
13:00:34Yardanicowatzon, well did you copy crosswin part as well?
13:00:39Yardanicoe.g. @if crosswin @end ?
13:00:53watzonYeah
13:00:54Yardanicogotcha!
13:01:10YardanicoI've added this "if" so it would cross-compile if you specify -d:crosswin
13:01:12Yardanicojust try
13:01:17Yardaniconimble ... -d:crosswin
13:01:22mirandata-man - nice speedups!
13:01:22watzonOh!
13:02:30watzonIt worked!
13:04:15Yardanicowatzon, but generally you should use visual studio compiler (vcc). it usually produces faster/smaller binaries than mingw
13:04:22Yardanicobut you can use it only from windows AFAIK
13:04:33watzonOf course haha
13:04:49watzonWell I have windows, I just prefer to do my development in Fedora
13:05:05Yardanicowatzon, well ok, it won't hurt you anyway
13:05:12Yardanicountil you have some high-performance program
13:05:52watzonYeah I figured
13:06:17Yardanicoalso don't forget that, if you've used SSL, you'll need to provide ssl dll's
13:06:52watzonssl dlls?
13:07:03Yardanicowatzon, OpenSSL DLLs
13:07:11Yardanicowatzon, if you've used httpclient with some https websites
13:07:20Yardanicoor compiled with -d:ssl
13:07:24watzonWith the -d:ssl flag right? or is there something else?
13:07:30Yardanicoyes, with -d:ssl flag
13:07:42Yardanicoif you don't use it - you don't need them
13:07:48watzonOk yeah I've got that
13:07:57watzonI figured that out early on haha
13:08:11Yardanicohttps://nim-lang.org/download/dlls.zip in case you'll need them
13:08:49watzonHow do you specify an output directory when using the `nim c` command?
13:10:03Yardanicowatzon, usually you do --out:mybinarypath
13:10:17FromGitter<BigEpsilon> @data-man , seems great !
13:10:40Yardanicowatzon, e..g nim c -d:release -o:myfolder/mybinary myfile.nim
13:10:58watzonPerfect, thanks :)
13:13:39FromGitter<data-man> @miran, @BigEpsilon, Thanks!
13:14:07PMunchOkay, I've made some progress. By defining the procs as {.importc.} they get resolved on load-time. Only problem is that the name of the proc now has to be the Nim-mangled name..
13:14:46arnetheduckYardanico, well, nlvm compiles (internally, same as you did with opt etc) with whatever defaults there are, which probably means non-pic..
13:16:00*claudiuinberlin joined #nim
13:16:50dom96Anyone wanna write an article on how to cross-compile with Nim? :)
13:17:23Yardanicodom96, it's not enough for an article
13:17:33Yardanicoone command or one small config file
13:17:38Yardanicobetter to add it to wiki probably
13:20:01PMunchHmm, is Nim procedure mangling deterministic? Ie will I get the same name every time?
13:20:25dom96Yardanico: It is enough.
13:20:52dom96but add it to wiki if you prefer
13:21:01dom96then add a link to it in nim-lang.org docs
13:27:44YardanicoPMunch, yes
13:27:58Yardanicoit was non-deterministic before
13:28:35YardanicoPMunch, https://github.com/nim-lang/Nim/commit/4b0ba5e3f1b78b3c45a3f1576ed3d60f9a8b6d80
13:29:11Yardanicobut I may be mistaken
13:30:24*vlad1777d joined #nim
13:30:41PMunchHmm, what I tried to do didn't really work anyways though..
13:30:48YardanicoPMunch, Araq should know everything about that :)
13:31:48*Yardanico quit (Remote host closed the connection)
13:32:14PMunchArgh, this is so annoying. I feel like it should be possible somehow, seeing how it is possible in C. But I can't get it to work..
13:34:44PMunchThe main executable has the symbol defined, and the DLL has it undefined. But it still doesn't trickle down to the DLL..
13:36:15FromGitter<andreaferretti> @Yardanico I fail to see how it can be one command or one small config file. Surely you must have installed stuff like clib for your target architecture?
13:36:22FromGitter<andreaferretti> I must admit I never tried
13:36:47FromGitter<andreaferretti> But i wouldn't think it could work out of the box to - say - compile an executable for Mac on a Linux box
13:37:11FromGitter<andreaferretti> Without installing something you copy from XCode or whatever
13:37:59FromGitter<andreaferretti> It seems to me there will be some nontrivial setup that maybe you are giving for granted
13:39:35AraqPMunch, use '.extern' to set an external name
13:39:54PMunchI tried that, but it didn't work..
13:43:41PMunchWell it works in that I do get an undefined symbol in the .so file I create
13:44:34PMunchBut when I try to load it into an executable that has the symbol defined (checked with "nm -g") I get nil from loadLib and dlerror (added with .emit.) returns that the symbol is not defined
13:44:46PMunchSo the symbol does not get overwritten as it should be the loader
13:44:58FromGitter<ephja> meep meep
13:46:12PMunchAccording to the dlopen manpage it should resolve missing symbols on load
13:46:30PMunchAnd I did --passC:"-export-dynamic" when I compiled the main binary
13:58:10*zolk3ri joined #nim
14:00:35*derlafff joined #nim
14:02:01*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:02:52PMunchPhew, got it working now
14:03:05PMunchI was passing -rdynamic to --passC and not --passL
14:10:14PMunchGot to write this down..
14:14:23*derlafff quit (Remote host closed the connection)
14:27:06*claudiuinberlin joined #nim
14:27:06*claudiuinberlin quit (Client Quit)
14:29:39*PMunch quit (Quit: Leaving)
14:29:52*claudiuinberlin joined #nim
14:42:18*PMunch joined #nim
14:48:43*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
14:57:12*ibutra_ quit (Read error: Connection reset by peer)
15:00:24PMunchHmm, is there a way to get the name Nim will mangle a procedure to?
15:00:36PMunchI want to try and automate the process of the symbol lookup
15:00:36*derlafff joined #nim
15:03:56*arnetheduck quit (Remote host closed the connection)
15:05:11PMunchHmm, I see --genMapping in the docs
15:05:30*arnetheduck joined #nim
15:05:54PMunchNo idea how to call it though..
15:06:27PMunchI tried with "nim c --genMapping <nim file>" and that just fails with gcc: error: libregex.c: No such file or directory
15:08:30FromGitter<mratsim> Seems like regex are Nim nemesis
15:08:39PMunchHaha :P
15:12:21PMunchhttps://github.com/nim-lang/Nim/issues/1592
15:12:32PMunchApparently it's been a bug since 2014..
15:13:40*TjYoco joined #nim
15:18:38*zolk3ri quit (Quit: Lost terminal)
15:19:17*zolk3ri joined #nim
15:22:50dom96It is low priority though :)
15:24:14*captainkraft joined #nim
15:24:38captainkraftWow, I haven't been here since July. I hope things are still going strong :-)
15:25:29captainkraftI'm working on some debugging tools for C and was considering either Nim, Odin, or C++ for the project. I used Nim for a little while and enjoyed writing it. I also noticed there is a binding out there for Nuklear, the imgui library in C.
15:25:45captainkraftOdin has Dear Imgui bindings, but the language is very young.
15:26:16captainkraftAnd C++, well, it's C++
15:27:53SunDwarfi wonder what recommendation youre gonna get in here :thinking:
15:28:10gokrGot some connection with the snap guys - to add Nim as a build plugin.
15:29:52dom96captainkraft: welcome back :)
15:31:17*Trustable joined #nim
15:31:50PMunchcaptainkraft, haven't used Nuklear myself but I'll always recommend Nim :)
15:38:39*gokr quit (Ping timeout: 248 seconds)
15:43:14*PMunch quit (Quit: leaving)
15:58:42*ketralnis quit (Read error: Connection reset by peer)
15:59:10*ketralnis joined #nim
16:02:39*floppydh quit (Quit: WeeChat 1.9.1)
16:03:16*nsf quit (Quit: WeeChat 1.9)
16:06:04*claudiuinberlin joined #nim
16:09:14*dhalinar joined #nim
16:12:37*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:15:40*dhalinar2 joined #nim
16:17:45*dhalinar quit (Remote host closed the connection)
16:19:11*arnetheduck quit (Ping timeout: 248 seconds)
16:19:30*Viktor_ quit (Ping timeout: 260 seconds)
16:19:48*claudiuinberlin joined #nim
16:21:08*gokr joined #nim
16:25:25FromGitter<alehander42> how can I not escape symbols in a cstring ? e.g. `cstring"\t"` to be "\t" not "\\t"
16:33:43*gokr quit (Ping timeout: 258 seconds)
16:43:02captainkraftCan bindings be written in Nim for C++ libraries?
16:45:40FromGitter<BigEpsilon> yes
16:45:52onionhammerim │ dave24
16:45:55onionhammer │10:24:38 captainkraft | Wow, I haven't been here since July. I hope things are still going strong
16:46:01onionhammerhttps://github.com/onionhammer/clibpp
16:46:05onionhammersorry* wrong paste
16:46:09FromGitter<BigEpsilon> you can use c2nim to do some of the initial work
16:46:20FromGitter<BigEpsilon> and compile with cpp target
16:46:44dave24what is this
16:46:52dave24I got pinged by somebody claiming to be me!!
16:46:55dave24outrage
16:47:11*sz0 quit (Quit: Connection closed for inactivity)
16:47:17onionhammeridk how that got in my clipboard lol
16:51:42captainkraftonionhammer: do you use Weechat?
16:53:56*kafke quit ()
16:55:21onionhammeri do yes
17:02:20captainkraftI have that same clipboard issue sometimes. Somehow I highlight the wrong line and it just lives in my clipboard when I think something else is there.
17:06:08captainkraftHave you heard of, or have you experienced yourself, struggling as a Nim programmer to find work where you are allowed to use Nim? Contractors and consultants seem to have more control over their tools, but if you are delivering a software product, do the clients/customers expect it to be written in a language they are familiar with?
17:06:45*JappleAck joined #nim
17:07:25*Arrrr joined #nim
17:07:25*Arrrr quit (Changing host)
17:07:25*Arrrr joined #nim
17:09:45*dhalinar2 quit (Ping timeout: 258 seconds)
17:10:46*Jesin joined #nim
17:23:45*martinium joined #nim
17:23:56subsetparkyes :)
17:24:34subsetparkAs a "professional Nim programmer", I would find it insane to suggest Nim to a client
17:30:07captainkraftWhy is that? What kind of products would you be delivering?
17:30:49captainkrafts. How large are they compared to something similar in C++?
17:30:55captainkraftwtf..
17:31:30federico3captainkraft: it really depends on the client. Also, sometimes you provide a service, not software.
17:31:30captainkraftOff topic: I've read in the recent survey that Nim produces large binaries. How large are they compared to something similar written in C++?
17:32:11federico3captainkraft: no, they are tiny, unless something went really wrong.
17:32:34dom96what, where in the survey did you read that?
17:34:49federico3dom96: IIRC it was one of the free-form answers in the survey
17:38:46captainkraftThere were at least two responses that said "HUGE binaries"
17:38:52captainkraftI'll go back and check again
17:39:22captainkraft"Compiler doesn’t conform to Unix traditions and outputs HUGE binaries."
17:40:00captainkraftOh, haha. The second one was the same quote, just put twice on the page. I took that as more than one person saying something similar :-/
17:40:09captainkraftGood to know that's not true, then
17:40:13*Viktor joined #nim
17:40:52federico3https://hookrace.net/blog/nim-binary-size/
17:44:54captainkraftVery cool
17:45:21dom96You shouldn't put such high trust in survey respondent's anyway :P
17:45:43captainkraftIn that survey, there was also a complaint about exceptions and the standard library's reliance on them. Is that a common concern?
17:48:11dom96I wouldn't say so.
17:48:38dom96But if others think so then please speak up, stdlib is under review now.
17:48:54SunDwarfprobably a go user got let out of their if err != nil cage
17:49:12dom96lol
17:49:42SunDwarfalso, if the stdlib is under review, I have some things about asyncdispatch
17:49:52captainkraftI've heard that exceptions are especially hated in the game making community.
17:49:59SunDwarfsuch as the lack of built-in async primitives such as locks or queues
17:50:12SunDwarfsince ive come from python which has asyncio and etc which has all that stuff included
17:50:44SunDwarfunless i'm missing something in the docs somewhere
17:51:23subsetparkthere are both locks and queues
17:51:39subsetpark(queues being implemented on deques)
17:51:47SunDwarfthose are sync stuff for threads though, aren't they?
17:53:37dom96locks are locks, they can be used for threads and async procs if you really want
17:53:48dom96same for queues
17:54:19dom96They don't do any IO so whether they are synchronous or asynchronous doesn't matter.
17:55:14SunDwarfI guess i'm missing something about how asyncdispatch works because i dont see how they wouldn't block everything
17:55:32captainkraftCan exceptions be disabled? Would that make a large chunk of the standard library useless?
17:56:18FromGitter<Yardanico> why would you want to disable them?
17:56:30dom96SunDwarf: In fact, I don't see a reason why you'd need locks for async
17:57:15SunDwarfacquiring a lock whilst a proc does something such as wait on i/o so that no other proc can do that specific operation at the same time?
17:57:33dom96can you give a concrete example?
17:57:59FromGitter<Varriount> captainkraft: You can, in a way. What would procedures do when they encounter an error condition though?
17:59:24SunDwarfe.g. i have a proc that makes a http request which is ratelimited, and I don't want anything else to be able to make a http request whilst the ratelimit is active, so the first proc holds the lock until it expires
18:00:22FromGitter<Varriount> SunDwarf: Have a global lastCallTime variable?
18:00:25FromGitter<data-man> IMO, the stdlib must have a functions to determine the capabilities of the processor. isSSE(), isSSE2(), etc.
18:02:07SunDwarfthe particular service I use is really really touchy about not hitting the ratelimits, so having two requests happen where one exhausts the rate limit and sets lastCallTime and the other starts before it's set can't happen
18:02:20dom96SunDwarf: Okay, so that would be a good use for locks. (I'd probably just have a counter called 'activeConnections' and not let anything exceed that, but both approaches will work).
18:02:36dom96s/that/my max connections/
18:03:08dom96hrm
18:03:17dom96I think I see what the potential problem would be
18:03:29dom96Acquiring the lock would block everything
18:04:26FromGitter<kdheepak> > how can I not escape symbols in a cstring ? e.g. `cstring"\t"` to be "\t" not "\\\t" @alehander42 I'm also curious about this. Did you figure this out?
18:06:44FromGitter<Varriount> @kdheepak Where are you getting the cstring from, and how are you displaying it?
18:07:09dom96SunDwarf: Make an issue :)
18:08:00*Viktor_ joined #nim
18:08:21*Viktor quit (Quit: Page closed)
18:08:21*Viktor_ is now known as Viktor
18:08:42FromGitter<Varriount> SunDwarf: Huh. But async things aren't preemptively scheduled.
18:09:33FromGitter<Varriount> It's possible to check and update that lastCallTime "atomically", unless you decide to yield in-between the check and set.
18:11:20dom96Yeah, in general I still don't think locks are desperately needed for async.
18:11:48dom96For this rate limiting use case you'd likely want a queue anyway
18:11:55dom96And that would work fine with async
18:12:34dom96I decided to do the boring work of finally merging upcoming async https://github.com/nim-lang/Nim/pull/6585
18:13:33*ryanhowe quit (Quit: WeeChat 1.4)
18:13:38*dddddd quit (Ping timeout: 246 seconds)
18:14:41subsetparkdom96: that's not your unification of the threading and async await, is it?
18:14:52dom96nope
18:15:11dom96support for threading in asynchttpserver is on my todo list though
18:15:26dom96But who knows whether it's even possible to achieve in a satisfactory manner right now
18:15:52captainkraftVarriount: I guess if a language has exceptions, there might not be a way to detect errors. So, maybe it is a serious problem for people who don't like exceptions.
18:16:18*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:16:26dom96captainkraft: Yes, but Nim has checked exceptions. So this isn't a problem in general.
18:16:40FromGitter<Varriount> But exceptions *are*the way to detect errors.
18:16:53dom96(optional checked exceptions, we're not Java :))
18:17:30SunDwarfissue made, im not very good at writing them
18:17:43captainkraftHow did people detect errors before exceptions were invented?
18:17:49SunDwarfapart from that ive absolutely fallen in love with nim in the last few weeks
18:17:59FromGitter<Varriount> There are two main models (that I know of). Either exceptions are represented a language mechanism, or they are returned as error codes/values
18:18:34captainkraftdom96: tbh, I'm not very familiar with exceptions. What do you mean checked exceptions and how is this better?
18:19:10dom96proc foo() {.raises: [].} = raise newException(OSError, "") # Compile-time error: foo() raises OSError
18:19:18FromGitter<Yardanico> but this is not enforced in nim
18:19:20FromGitter<Yardanico> :)
18:19:24dom96!eval proc foo() {.raises: [].} = raise newException(OSError, ""); foo()
18:19:25NimBotCompile failed: in.nim(1, 65) Error: statement not allowed after 'return', 'break', 'raise' or 'continue'
18:19:25FromGitter<Yardanico> as dom96 said
18:19:27*claudiuinberlin joined #nim
18:19:31captainkraftI've only heard others' complaints about exceptions. Performance overhead and unnecessary code to add all over the place are the common issues, iirc.
18:19:37dom96oh heh
18:19:44dom96!eval (proc foo() {.raises: [].} = raise newException(OSError, "")); foo()
18:19:45NimBotCompile failed: in.nim(1, 7) Error: ')' expected
18:19:47FromGitter<Yardanico> captainkraft: you don't need to add unnecessary code
18:19:52dom96well that sucks
18:20:12FromGitter<Yardanico> dom96: nim is indentation based
18:20:18dom96lol?
18:20:32FromGitter<Yardanico> !eval let myproc = (proc foo() {.raises: [].} = raise newException(OSError, "")); myproc()
18:20:33NimBotCompile failed: in.nim(1, 20) Error: ')' expected
18:20:37FromGitter<Yardanico> :D
18:20:47FromGitter<Yardanico> don't expect to be able to have everything on one line
18:21:17FromGitter<Varriount> captainkraft: Were they using C, C++, or Java?
18:21:45FromGitter<Varriount> Depending on the compiler, C++ exceptions can have very little overhead.
18:21:56captainkrafteither C or C++. Most of the programmers I talk with are C and C++ devs. Many of them interested in game development.
18:22:21FromGitter<Yardanico> well exceptions in nim are not annoying
18:22:30FromGitter<Yardanico> if you don't need to check for an exception - you don't do it
18:22:50FromGitter<Varriount> captiankraft: Regarding errors, the only other method is to return an error code through the return value.
18:23:00FromGitter<Yardanico> and this is mostly ugly
18:23:01FromGitter<Varriount> In which case you still have to add logic to check for the error.
18:23:27dom96Problem is that the way !eval works: you can't have more than one line.
18:23:31dom96And you shouldn't need to.
18:23:55FromGitter<Yardanico> why "you shouldn't need to"?
18:23:58FromGitter<Yardanico> nim is not C++ with brackets
18:24:16*bkerin joined #nim
18:24:48*gokr joined #nim
18:24:56dom96!eval let foo = (proc () {.raises: [].} = raise newException(OSError, "")); foo()
18:24:56bkerincd
18:24:57NimBotCompile failed: in.nim(1, 37) Error: can raise an unlisted exception: ref OSError
18:24:58dom96There we go
18:25:19FromGitter<Varriount> captainkraft: The only big arguments I've heard against C++ and Java-style exceptions are that they have a performance penalty, and add another mechanism to the programming language.
18:25:54Arrrr!eval echo "Not a bad argument"
18:25:57NimBotNot a bad argument
18:26:07Arrrrnimbot agrees
18:26:23bkerinis it possible to get an off-line copy of docs
18:26:36FromGitter<Varriount> bkerin: What browser do you use?
18:26:54FromGitter<Yardanico> bkerin: yes!
18:27:14*FromGitter * Varriount is going to take a nap now
18:27:22FromGitter<Yardanico> you can: ⏎ 1) download all pages docs ⏎ 2) generate docs yourself (if you have nim repo) ⏎ 3) use devdocs.nim, but they have nim 0.17.2 [https://gitter.im/nim-lang/Nim?at=59ef860a0182fa5f4d7205aa]
18:27:26FromGitter<Yardanico> *nim 0.17.0
18:27:39FromGitter<kdheepak> @Varriount ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ef861bb20c64242941dc47]
18:27:45FromGitter<Yardanico> *devdocs.io
18:28:23bkerini tried devdocs but it didn't have e.g. OOP Macro example and there was some stuff about voting for docs which turned me off
18:29:17FromGitter<Yardanico> it's nice actually
18:29:23FromGitter<Yardanico> and oop macro isn't official
18:29:36FromGitter<Yardanico> OOP macro is from "nim by example"
18:30:19FromGitter<Varriount> @kdheepak Ugh, I told @Araq the string prefix semantics were confusing.
18:30:25FromGitter<kdheepak> @Varriount on an unrelated note, I'm interested in working on the nlvm and adding features to allow a working REPL. I see that you've posted an issue there. I was wondering if you had used it / had any thoughts on where I could start
18:30:44FromGitter<Varriount> @kdheepak Use cstring("...") instead
18:31:14FromGitter<Varriount> @kdheepak What was the issue?
18:31:42FromGitter<Yardanico> @kdheepak I don't think you should start doing a REPL based on NLVM
18:32:00FromGitter<kdheepak> This repo (https://github.com/arnetheduck/nlvm). I'm just curious if you've used it.
18:32:11FromGitter<Yardanico> Firstly NLVM should have all features Nim has, e.g. threads
18:32:35hogelandbkerin: The docs are all checked in: https://github.com/nim-lang/Nim/tree/devel/doc
18:33:16FromGitter<kdheepak> @Yardanico Can you elaborate? I'm new enough to Nim that I don't know what the best way to go about this would be.
18:33:32hogelandbkerin: And for any individual modules you can generate the docs: https://github.com/nim-lang/Nim/tree/devel/doc/docgen.rst
18:33:45FromGitter<kdheepak> Perhaps I should open a forum thread regarding this, so that this conversation is easier to reference.
18:33:57FromGitter<Yardanico> @kdheepak NLVM is developed only by one developer
18:34:12*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:35:23GitDisc<GooRoo> the usual concern regarding exceptions in C++ is possible problems during unrolling the stack
18:35:23FromGitter<Yardanico> I think really nim should make all stdlib modules in pure-nim (without importc), and then LLVM backend would be really good
18:35:54GitDisc<GooRoo> that was for previous discussion 
18:38:19FromGitter<Yardanico> the problem with LLVM is: it's yet another backend for nim
18:38:21dom96Yardanico: That's impossible
18:38:22FromGitter<kdheepak> Perhaps importc could use FFI instead?
18:38:29FromGitter<Yardanico> dom96: it IS possible
18:38:31FromGitter<Yardanico> why not?
18:38:38FromGitter<Varriount> @Yardanico And I would love it if we had a wealthy company or donor to back Nim.
18:38:46dom96Because the OS APIs are implemented in C
18:38:47FromGitter<Yardanico> yeah, that's the only problem :P
18:38:55FromGitter<Yardanico> well you can have FFI to support them
18:38:59FromGitter<Yardanico> I mean direct "importc"
18:39:07dom96You mean without 'header'
18:39:14dom96That's what the problem is for the LLVM backend
18:39:20dom96dynlib is fine
18:39:26FromGitter<kdheepak> @dom96 this would be possible if we used shared libraries and dynamic loading, yes?
18:39:28FromGitter<Yardanico> well yes, I know that dynlib is fine
18:39:29FromGitter<Varriount> How do other languages using LLVM interface with the OS?
18:40:28FromGitter<kdheepak> @Varriount I believe Julia ( which uses LLVM ) does it using dynamic loaded libraries
18:40:58*claudiuinberlin joined #nim
18:44:40dom96kyrenn is awesome https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dotvkdj/?context=3
18:45:25*ibutra joined #nim
18:45:33FromGitter<kdheepak> @Varriount To clarify, (to my understanding) the dynamic loaded libraries discussion is relevant only because we are interested in using importc functions in a REPL environment.
18:46:30bkerinwith the ref counting garbage collector, is the descturcotr guaranteed to be called when an object goes out of scope?
18:46:36bkerinif its the last ref?
18:47:20dom96Good question. You might wish to use a finaliser instead, AFAIK destructors don't work this way.
18:47:51bkerinthat's probably what I meant, I know destructors are WIP still
18:48:09dom96I think you do get a guarantee in that case, but maybe Araq can confirm
18:51:04bkerinref counting collector is the only gc where it seems like it might. The compiler doc shows --gc:refc|v2|markAndSweep|boehm|go|none|regions and I recall reading elsewhere that gc can be tuned is there a more detailed description of that somewhere?
18:51:16captainkraftIs nimx the best solution for GUI applications in Nim, currently?
18:55:11captainkraftdom96: you mentioned checked exceptions and then showed how !eval gave a compilation error. Is that to demonstrate that you can't use a function that raises an exception without handling it? Sorry, I'm not following.
18:55:23dom96yep, precisely
18:55:48dom96!eval let foo = (proc () = raise newException(OSError, "")); foo()
18:55:49Araqbkerin, the RC'ed GC offers no such guarantee either because it's *deferred* RC
18:55:51NimBot<no output>
18:55:58dom96Well that's disappointing.
18:56:02captainkrafthaha
18:56:05dom96It should show the error, but anyway, now it compiles
18:56:05*dddddd joined #nim
18:56:15captainkraftDoesn't that make exceptions more annoying? I can't just ignore them?
18:56:41dom96captainkraft: you can, the point is that you have the option to get the compiler to annoy you about them.
18:57:09Araqcaptainkraft, depends, nimx is game focussed being based on SDL, for native GUI we also have the usual huge messy gtk/wxWidgets etc wrappers
18:57:17dom96So you can decide "Okay, I don't want function `foo` to raise any exceptions, I want to handle all of them explicitly."
18:57:31dom96You mark it with {.raises: [].} and the compiler tells you the exceptions you need to handle
18:57:42bkerinAraq ok I though probably but worth an ask. something has to do unref I though maybe could be made immediate somehow
18:59:00captainkraftAraq: I found a wrapper for iup and nuklear as well. Not much in the way of tools built in Nim, it seems.
18:59:13captainkraftThe Nuklear bindings might be just what I need, though
18:59:38captainkraftdom96: I see, so optional compile-time checking as well as a way to handle errors at runtime?
18:59:39Araqcaptainkraft, for browser based UIs I would use 'karax' but I wrote it so I'm biased
19:00:00dom96captainkraft: yep
19:00:00GitDisc<GooRoo> has anyone tried https://github.com/filcuc/nimqml for UI?
19:00:22dom96Araq: What's the status of ormin?
19:00:23captainkraftMy goal is to write desktop applications as standalone programming tools. A simple debugger for C is what I'm working on now.
19:02:19captainkraftdom96: do the standard library functions that raise exceptions have the compile-time checking built in by default?
19:02:54dom96captainkraft: the compiler infers everything automatically :)
19:06:15FromGitter<mratsim> Would love to see @data-man suggestion somewhere: isSSE, isAVX, etc to detect CPU capabilities
19:07:51*miran_ joined #nim
19:08:31captainkraftWhat is the preferred way of keeping Nim and libraries up-to-date?
19:08:56captainkraftUbuntu's Nim package is way out of date, and I recall reading about a tool that does this for you?
19:09:16FromGitter<Varriount> captainkraft: Nimble
19:09:26federico3captainkraft: no, Nim is at 0.17.2 in artful
19:09:46FromGitter<Varriount> GooRoo: I might try it on my Windows laptop later today, if I have time.
19:10:27FromGitter<Varriount> Though, it looks to have been only tested on Linux
19:10:34*nsf joined #nim
19:11:19dom96captainkraft: choosenim
19:12:41captainkraftchoosenim, that's the one
19:14:30*rauss quit (Quit: WeeChat 1.9.1)
19:17:56captainkraftdom96: Araq: What do you think is keeping Nim from more wide adoption? Are you confident that will change after 1.0?
19:18:38miran_captainkraft: small amount of packages/libraries
19:18:38dom96captainkraft: A Mozilla/Google/Facebook/Microsoft
19:18:48miran_and that's because of small community
19:18:56dom96Whether that is strictly necessary for wide adoption is an open question
19:19:04miran_and that's because of small amount of packages/libraries, and that...
19:19:38captainkraftWill that change? How?
19:20:03dom96But if myself and Araq (and some others, notably zahary) were able to work on Nim full-time, with sponsorship from a big company, Nim would move a lot faster and we would have more time to market it
19:20:04*Arrrr quit (Read error: Connection reset by peer)
19:20:09federico3Python never had [in]famous tech companies pushing it, yet...
19:20:34miran_but things might change for better after v1.0 is out - if that is not just renamed v0.18, and it guarantees more stability and less breaking in the future versions
19:20:41dom96Indeed. That gives me hope, but it also feels like we're living in a different age these days
19:20:57GitDisc<GooRoo> Python didn't need it because there was no good competitor in fact
19:21:06*PMunch joined #nim
19:22:22GitDisc<GooRoo> Ruby was created in 2005, but became famous only in 2001 or 2002 with the release of Ruby on Rails
19:22:51PMunchGooRoo, got that backwards?
19:23:11captainkraft2011/12 perhaps?
19:23:14FromGitter<data-man> @mratsim, a programs should work fast on any hardware. :) ⏎ For e.g., in the Delphi (and in the FreePascal), a functions that are optimized for a specific set of processor instructions are dynamically assigned at run time.
19:23:21GitDisc<GooRoo> sorry, in 1995
19:23:36hogeland>Python never had [in]famous tech companies pushing it,
19:23:37GitDisc<GooRoo> missed 10 years accidentally )
19:23:46ibutraAraq, dom96 can I have some input on https://github.com/nim-lang/Nim/issues/6541
19:23:59hogelandthat's not totally true, since Guido worked at Google on Python for yeards
19:24:05hogeland*years
19:24:21hogelandBut yeah it wasn't popular because of a corporate push
19:24:39captainkraftdom96: what's a good way to ease into contributing to the language itself? Should new Nim users wait until they are much more familiar with the language before attempting to contribute?
19:24:43bkerinwell noob perspective here: im trying nim because: C and JS backends, typed, fast compiled
19:24:51FromGitter<Varriount> hogeland: However Python did not have 3 different company-sponsored languages competing against it (Go, Rust, Swift)
19:24:51dom96hogeland: wasn't that after it became somewhat mainstream?
19:24:54federico3hogeland: the language was already popular before that
19:25:37bkerinit seems like the best choice with these features to me, so if it does get polish and maybe some backing it would seem to be logical choice for lots of uses
19:26:04hogelandVarriount: that's very true
19:26:15dom96ibutra: sorry, wish I could help but this is a question for Araq
19:26:21ibutracaptainkraft I am quite new with nim and I just look at the issues labled easy or really interest me and try my best. (Just spend the last 5 hours after I was done working figuring out where assignments are generated ;) )
19:27:04*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:27:12ibutradom96 don't worry I will just wait for him then :)
19:29:41PMunchHmm, is there no way to get the mapping from nim procedure definition to C-mangled symbol?
19:30:28*demi- quit (Ping timeout: 240 seconds)
19:30:30ibutraIf I recall correctly there is a pragma to turn off mangling for a procedure. would that help?
19:31:13PMunchNot really, turning it off won't work for multiple procs with the same name but different signatures (as C doesn't allow this)
19:31:19*Jesin quit (Quit: Leaving)
19:31:50PMunchI could of course use the extern pragma to define the mangled name of each proc myself, but that's just as much work..
19:32:34*demi- joined #nim
19:32:43dom96PMunch: I think you'll have to define the names yourself
19:32:54dom96you can use a macro for this
19:33:16PMunchHmmm
19:33:30PMunchWhy couldn't --genMapping just work :P
19:33:50PMunchWould've made this process so much easier..
19:34:14PMunchHmm, maybe I can parse the GDB debugger symbols..
19:34:25PMunchThose tell you what proc it is right?
19:34:37*craigger joined #nim
19:36:53*claudiuinberlin joined #nim
19:39:15*Sentreen quit (Ping timeout: 258 seconds)
19:39:32PMunch--embedsrc embeds everything as comments, expect proc definitions..
19:40:40*sleepyqtx joined #nim
19:42:44GitDisc<treeform> Hey dom96, on HN you said "Indeed, Araq's plan is to release v1 ASAP (he said by the end of this year on IRC) and implement the ideas described in this article afterwards for a Nim v2." Is there any more about time lines and what nim team plans are?
19:44:01*sleepyqt quit (Ping timeout: 248 seconds)
19:44:25dom96Not really. I think in general though the consensus is that v1 has been taking too long, and we all want it out ASAP.
19:44:57dom96But we really don't have any timelines ourselves. It will be ready when it's ready.
19:45:19*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:45:57GitDisc<treeform> Sounds good. That is how I operate too. Can't blame others.
19:47:37PMunchIs there really no default way to get something like a mangling table?
19:47:55PMunchSeems like something that would be pretty easy to put in..
19:48:05PMunchAfter all Nim has to know the mapping at some point
19:48:13dom96But if you're thinking of holding off on Nim until after v1, please don't. We still have time to make breaking changes, and the more people use it now the higher the chances that we will be able to find out what changes need to be made.
19:48:42dom96PMunch: why do you need this?
19:49:26PMunchI'm dynamically loading code into the program, and it needs to get some procedures from the main program
19:49:42PMunchBy some I mean 80+ so passing them in a setup function wouldn't work
19:50:18PMunchCurrently I have something like: proc define(i: In): ref MinScope {.importc, extern: "define_HtvBzo0skz2GBYAKuFddKA".}
19:50:34PMunchWhich I've written manually for the five procs I used in a test
19:50:53PMunchAnd it works fine, but adding all 80 would be really tedious..
19:51:19ipjkWhy won't the non-mangling pragma work? Why do you need to mangle the names?
19:51:44PMunchBecause I have many procs with the same name but different signatures, and C doesn't allow that
19:51:52PMunchSo they would have to map to different symbols
19:51:59PMunchAnd I would have to do the mapping manually again
19:52:09*Sentreen joined #nim
19:52:11*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
19:52:19ibutraBut don't you need a manual step for those anyway?
19:52:41PMunchI was hoping that I could use --genMapping and write a script that would automatically rewrite that into the procedure definition code
19:52:49GitDisc<treeform> dom96, naa I am using nim. Convincing other people though... i bet they would just complain about other things. People hate change.
19:53:06ibutraor are you parsing the types of the arguments somewhere to know which one to call if you had the mangling mapping?
19:53:18PMunchIf I had a file with something like "proc define(i: In): ref MinScope -> define_HtvBzo0skz2GBYAKuFddKA" it would be dead easy to do
19:54:33PMunchI'm just defining them as "don't worry, you'll find this symbol when you're running" and the compiler spits out a file with undeclared symbols in it. When the program loads them it will allow it to read from it's symbols table and therefore get the definition for the symbol.
19:58:30ibutrayou could try to find out where the mangling is done and see if it is deterministic. If so you could reproduce it
19:58:41AraqPMunch, the name mangling is deterministic
19:58:43gokrhogeland: I am not fully certain, but I suspect one strong factor pushing Python along was Redhat's move to focus entirely on it.
19:59:03Araqyou can rely on the name define_HtvBzo0skz2GBYAKuFddKA (but really shouldn't...)
19:59:20PMunchYes, but I don't want to manually get all 90 of these
19:59:28PMunchAnd especially not if it suddenly changes
19:59:42Araqthere was an awesome hack for this
19:59:47Araqoh yeah
19:59:57PMunchIs the name mangling defined somewhere so I can easily copy it?
20:00:12PMunchIt's not like the md5 hash of the signature or something
20:00:23AraqPMunch, muhahaha welcome to world of namespaces
20:00:54Araqwe need to hash an awful lot to guarantee distinct hashes
20:01:15PMunchOh right, good point
20:01:23PMunchSo how are they generated?
20:01:38PMunchJust a counter somewhere?
20:01:50Araqcompiler/sighashes.nim
20:02:05Araqyou don't want to copy these 300 lines of code
20:02:21Araqit's not a counter, I said it's deterministic now
20:02:36*gokr noticing a certain boost in number of people here...
20:02:57dom96gokr: 2018 will surely be the year of Nim
20:03:05dom96:)
20:03:16gokrHehe
20:03:29PMunchOh, it's that deterministic
20:03:30miran_dom96: and the year of linux, from what i heard :D :D
20:03:41PMunchAraq, so what should I do then?
20:03:43dom96For those of you that didn't see, based on this reply it seems that Nim really is perfect for game dev https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dotvkdj/
20:03:56gokrThe year of Linux on the Desktop! Eh... no, that was another year.
20:03:59dom96(Developer of Stardew Valley/Starbound)
20:04:06*dom96 is awestruck
20:04:11PMunchI got nim to compile with --genMapping by setting --nimcache to the current directory and copying in nimbase.h
20:04:24PMunchBut the Symbols table in the mapping.txt file is still empty..
20:05:04miran_gokr: that year was in the past or in the future? :P
20:05:11miran_or both? :D
20:06:35gokrdom96: That is indeed a really nice post. Hope he pops in here also so that Araq can help him out with that evaluation
20:06:40miran_Araq, dom96: "Nim has its roots in a mash-up of Python and Pascal, and it borrows a lot of bad ideas from Pascal/Delphi. You can take the developer out of Pascal but it's very hard to take the Pascal out of the developer"
20:06:58miran_seen in this thread: https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/
20:07:25FromGitter<Yardanico> https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/dotzvsn/
20:08:02Araqmiran_, so? people are free to have this opinion.
20:08:21Araqat least I didn't take the bad ideas of Python.
20:08:27miran_hehehe
20:08:36Araqwhich would be pretty much everything beyond its basic syntax.
20:09:14miran_i've copied the link - thought maybe one of you might join the discussion
20:12:21Araqin fact, even its basic syntax is inconsistent, *def*ine method, define *class*
20:13:59AraqPMunch, what are you trying to do?
20:15:55hogelandAh, you know what Python has that Nim is missing?
20:15:55PMunchWell, I'm loading a dynamic library and I need to access some of the symbols of the main program. Currently I have proc define(i: In): ref MinScope {.importc, extern: "define_HtvBzo0skz2GBYAKuFddKA".} which works fine and creates a dynlib with that system as undefined and reads it from the global symbols table when it's loaded into the program. However I don't want to manually generate those mappings for 80+ procs, so I'm looking for a way to automate the
20:15:57PMunchprocess
20:16:06hogelandThe killer feature that brought it to the top?
20:16:15hogelandThe global interpreter lock
20:16:49FromGitter<Yardanico> :D
20:19:49PMunchAha, with --debuginfo I got something which might be useable
20:21:26PMunchI can search through the .nim file I want to map, then for each "proc" I can get the current line, then look in the .ndi file and grab the mangled name from there
20:21:33PMunchUnless you have a better idea Araq
20:23:49*Zwei joined #nim
20:24:14*Zwei left #nim (#nim)
20:25:41PMunchhttps://github.com/nim-lang/Nim/blob/5dca695bcfaad7212679c80b3219e0f69afdca7d/compiler/extccomp.nim#L877
20:25:49AraqPMunch, import the module that defines the procs?
20:25:52PMunchThis seems like the broken part of --genMapping by the way
20:26:39PMunchAraq, that would mean that each dynlib would be copying half the main program. And for every fix in the main program every dynlib would have to be compiled again not to break anything..
20:27:41FromGitter<Yardanico> we definitely need a library to ease splitting our modules into different dll's :)
20:28:00AraqPMunch, define a pragma that does either
20:28:10PMunchEither what?
20:28:21*miran_ quit (Ping timeout: 240 seconds)
20:28:22Araq .dynlib, importc
20:28:26Araqor
20:28:36elroodwouldn't the obvious solution to PMunch's problem be to just fix --genMapping instead of wasting time searching for workarounds?
20:28:39Araq .dynlib: "name.dll", exportc
20:29:07PMunchelrood, yeah that would be nice. Or at least remove it since it's quite broken as-is
20:30:46PMunchError: 'dynlib' requires 'exportc'
20:30:53PMunchSo I guess the first one is out..
20:30:56*obadz joined #nim
20:30:58FromGitter<Yardanico> ?
20:31:07FromGitter<Yardanico> {.dynlib: "name.dll", exportc.}
20:31:10PMunchWhat would .dynlib: "name.dll", exportc do?
20:31:34PMunchYardanico, the other was Araqs first suggestion
20:31:43FromGitter<Yardanico> yes
20:31:50FromGitter<Yardanico> but why you didn't try his solution?
20:32:17PMunchI tried the first one, "{.dynlib, importc.}" that didn't compile
20:32:35*Trustable quit (Remote host closed the connection)
20:32:42FromGitter<Yardanico> did you try dynlib with name.dll ?
20:32:51PMunchWhat would "{.dynlib: "name.dll", exportc.}" actually do?
20:33:02Araqwell the other way round
20:33:10Araq.dynlib, exportc
20:33:22Araq.dynlib: "my.dll", importc
20:35:08PMunchWait, I think you misunderstood
20:35:21PMunchIt's the dynlib that needs symbols from the main program
20:35:24PMunchNot the other way around
20:36:54dom96damn, we're definitely getting many more PRs
20:36:58dom96Not sure if hacktoberfest
20:37:05dom96or it really is the year of Nim
20:37:33FromGitter<Yardanico> but many of them aren't merged
20:37:39FromGitter<Yardanico> and many of them are very old
20:37:41PMunchI'll guess we'll see in November..
20:37:45FromGitter<Yardanico> and they are not resolved/closed
20:38:00GitDisc<treeform> I used nim at work and got paid for it, so that is a first for me.
20:38:02dom96Yardanico: Stay positive my friend :)
20:38:23dom96treeform: nice, where do you work (if you don't mind sharing this)?
20:39:55*Vladar quit (Quit: Leaving)
20:40:09GitDisc<treeform> It was just for a hakathon-like project. We will probably not use it in production. Because I do data crunching no one cares what I use as they are one-off scripts.
20:40:33GitDisc<treeform> I work for a social site called reddit.
20:40:41FromGitter<Yardanico> woow
20:40:42dom96whoa, for real?
20:41:22dom96That's pretty freaking awesome
20:41:36GitDisc<treeform> I do not feel it is that exciting...
20:42:49PMunchtreeform, you don't like working for them, or you don't think the job is exiting?
20:43:06GitDisc<treeform> Oh i love working here and my job is pretty good.
20:43:21ViktorIf I name a file stdin.nim, add only this line “let inText = stdin.readLine()” I get an error at nim c -r : stdin.nim(1, 20) Error: undeclared identifier: 'readLine'
20:43:27GitDisc<treeform> The fact that I used nim is not that exciting. Its a cool language why not.
20:43:31Viktorif I name it anything else it works
20:43:38elroodperhaps if you could expand a little on the *we will probably not use it in production* bit, that'd be helpful for the project. always good to hear what is standing in the way of adoption
20:43:42Viktorshould I log a bug report, or is this a know issue?
20:43:51FromGitter<Yardanico> this is a known issue
20:43:54FromGitter<Yardanico> you can't do that
20:43:58dom96treeform: oh yeah, I was referring to the fact that you work at Reddit.
20:44:24FromGitter<mratsim> You can see talks about v1 soon from 2014 in the forum ;)
20:44:28Viktorso what I cannot do is name a file anything that is in the nim source repo, or only stdin is not allowed?
20:44:45GitDisc<treeform> dom if you find your self in SF, stop by I will show you around.
20:45:07FromGitter<Yardanico> you can't name your file "myvar.nim" if you have myvar in myvar.nim
20:45:23dom96treeform: Ooh, thanks. Will keep this in mind :D
20:45:26Viktoraha ok, got it!
20:46:12ViktorI am going through your book dom96 by the way, it is awesome.
20:46:29dom96Viktor: Glad you like it, thanks for buying it :)
20:46:42ViktorI am reading it on Safari, I have a subscription
20:46:48ViktorI hope you still get money for it.
20:47:21bkerini don't understand .used. pragma example
20:47:21dom96ahh cool. Good question, I have no idea heh
20:47:40*xet7 quit (Read error: Connection reset by peer)
20:47:43ViktorBut I will most likely buy it as well, and have it on the shelf :)
20:47:44bkerinechoAdd and echoSub do not have * so how are they exported?
20:48:18GitDisc<treeform> elrood, I build kind of a map reduce thingy, I need to convince people that my map reducer thingy is better then their map reducer thingy.
20:48:35bkerino
20:48:37bkerinnot exported
20:48:49bkerinnm
20:50:27PMunchWell okay, I'm off now
20:50:27ipjkbkerin: it ignores the warning produced for a function not used.
20:50:54ipjkbkerin: they aren't exported, they are used within the same module.
20:51:03PMunchGuess I'll be writing a script to create my mapping tomorrow from the ndi file, should be fun -_-
20:51:40*PMunch quit (Quit: leaving)
20:54:25ipjkbkerin: but lets say you have proc add(...) in module 'a.nim', if you forgot the export and try to use it in another module, a warning will be printed telling you proc add(...) isn't used.
20:54:41ipjkbkerin: since it isn't called in module 'a.nim', just implemented.
20:55:35*Jesin joined #nim
20:59:36Araq<mratsim> You can see talks about v1 soon from 2014 in the forum -- yup, and it will be "really soon" in december 2020
21:02:06bkerinipjk i got it thx was misreading the doc though it talked about exported unused syms
21:02:53*bkerin quit (Quit: "Wife who put husband in doghouse soon find him in cat house.")
21:03:50*xet7 joined #nim
21:04:20*Jesin quit (Quit: Leaving)
21:05:34*ibutra quit (Quit: My iMac has gone to sleep. ZZZzzz…)
21:17:13*martinium joined #nim
21:18:36*TjYoco quit (Quit: Leaving)
21:28:40watzonHow would I go about linking libeay64.dll when compiling? Or can you?
21:29:24watzonI'm trying to compile a program that requires ssl for Windows
21:32:51*sleepyqtx quit (Quit: Leaving)
21:37:10*Nobabs27 joined #nim
21:39:22dom96watzon: it's loaded at runtime
21:39:25*dhalinar2 joined #nim
21:39:30dom96you can't statically link a dll
21:39:39watzonAhh ok
21:40:02watzonSo is there a way to do it that won't require loading it at runtime?
21:40:19dom96no easy way I'm afraid
21:41:05*adeohluwa joined #nim
21:41:52watzonWell damn haha
21:43:24dom96why do you want to statically link it?
21:43:38Araqyou can get the C code and .compile it and do some --dynlibOverride
21:44:16Araqwe probably should have figured out how to do that years ago, no DLL required for SSL support
21:44:58watzondom96: make the release process a little easier
21:45:10watzonAraq: agreed
21:45:27Araqwatzon, try it please and report your results
21:46:22Araqthat would really be useful for the whole community
21:46:46watzonI imagine I'd want this? https://github.com/openssl/openssl
21:48:05watzonI'm not a big C guy, so a lot of this stuff is still pretty new to me
21:50:37elroodespecially for security-relevant things like ssl dynamic linking makes more sense though
21:54:54*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:01:19*elrood quit (Quit: Leaving)
22:03:22*vlad1777d quit (Ping timeout: 264 seconds)
22:06:01*vlad1777d joined #nim
22:07:31*Viktor quit (Quit: Viktor)
22:20:09GitDisc<GooRoo> @dom (dom69), I believe that ConcernedApe is the developer of Stardew Valley. Chucklefish is the publisher (and probably they could help him with porting it to more platforms)
22:20:44dom96Yep
22:20:54FromGitter<kdheepak> @GooRoo its @dom96 but he'll probably see this message anyway.
22:21:51FromGitter<kdheepak> Is there an example of Nim on Android that I can take a look at?
22:22:13dom96there is something in the Nim repo
22:23:23GitDisc<GooRoo> @kdheepak I know, but it's difficult to make mentions relying on some bridge between Discord, Gitter and IRC
22:23:23FromGitter<kdheepak> Found it! Thanks!
22:23:58*dhalinar2 quit (Ping timeout: 240 seconds)
22:26:18GitDisc<GooRoo> https://www.youtube.com/watch?v=u0rh4RcGXo8
22:26:34GitDisc<GooRoo> Wrong chat, sorry
22:30:16GitDisc<GooRoo> BTW, one more reason to use something modern like Slack or Discord without bridges: ability to edit / delete messages
22:32:14GitDisc<GooRoo> I've removed the link, posted by mistake, but it has already been synced
22:32:47*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
22:33:20*Jesin joined #nim
22:34:09*gokr quit (Ping timeout: 248 seconds)
22:35:21*nsf quit (Quit: WeeChat 1.9)
22:40:11adeohluwasay you have a node. js app on a server, all things bn equal you can handle a lot more users by just switching to nim lang right?
22:44:44adeohluwabetween the twitch tv live stream == "awesome"
22:45:52*vlad1777d quit (Ping timeout: 260 seconds)
22:52:11*vlad1777d joined #nim
23:04:19*Lord_Nightmare joined #nim
23:16:58*Nobabs27 quit (Quit: Leaving)
23:32:49*derlafff quit (Remote host closed the connection)
23:32:58*derlafff joined #nim
23:42:30*JappleAck quit (Quit: Leaving)
23:42:44*zolk3ri quit (Quit: leaving)