<< 05-01-2015 >>

00:01:31*brson joined #nim
00:08:56*irrequietus quit ()
00:11:58MyMindcool nim 0.10.2 is on homebrew finally
00:17:18MyMindyay https://github.com/infininight/nim.tmbundle
00:20:34BlaXpirit_Can someone try out or review/nitpick my CSFML bindings library? https://github.com/blaxpirit/nim-csfml
00:20:39BlaXpirit_Varriount_?
00:21:05*Epic|gmpreussner is now known as gmpreussner
00:22:03BlaXpirit_maybe def-
00:26:40ekarlso-https://bpaste.net/show/0121ed5d868b < doesn't that look valid ? it gives me a 400 though I dont see a reason why
00:29:10MyMindspaces instead of tabs are mandatory right?
00:29:29renesac_yes, for indentation
00:30:21reactormonkHow can I interweave C code dependencies? It would depend on nim code, and other nim could would depend on the first one and the C code
00:33:04*wan quit (Quit: WeeChat 1.0.1)
00:35:16ekarlso-dom96: u around ?
00:35:30def-I think it's pretty cool that you can easily make a macro to make JSON work directly in Nim: https://github.com/Araq/Nim/pull/1869
00:36:45ekarlso-is postContent broken somehow ? the asynchttpserver is going 400 on my ass saying no content-length was given but python requests works fine
00:37:23def-ekarlso-: that's interesting, can you give me your code? I have an open pull request with postContent, can just add it there probably
00:37:24*yglukhov__ joined #nim
00:37:45def-(add the fix for content-length there)
00:38:04def-BlaXpirit_: i only have linux though
00:38:14ekarlso-def-: take a look at the link I pasted :)
00:38:26ekarlso-https://bpaste.net/show/0121ed5d868b
00:38:28BlaXpirit_def-, that's good, because i'm pretty sure it will only work on linux, without some minor changes
00:38:44BlaXpirit_i'm gonna start up that windoze virtual machine one day too
00:41:07BlaXpirit_also, I didn't consider that I'm going to bed soon, so I won't be able to hear your comments right away
00:41:33*yglukhov__ quit (Ping timeout: 244 seconds)
00:42:15def-ekarlso-: you probably need to add an \c\L at the and of headers
00:42:22def-maybe we should do that automatically
00:50:54MyMindadam_s: exist any yasnippet for nim?
00:53:06*hakand quit (Quit: Be back later ...)
00:57:52*Matthias247 quit (Read error: Connection reset by peer)
00:58:47adam_sMyMind: none that I'm aware of, but I haven't looked
00:58:58adam_sit would be pretty easy to write some if you wanted, though
00:59:07adam_sI don't really use yas
00:59:47renesac_http://nim-by-example.github.io/oop/ <-- this page calls multi-methods "methods" and implies they are needed for OOP, but it is only needed if you want inheritance, and in most cases it is the wrong tool
01:00:02renesac_flaviu: ?
01:01:32flaviurenesac_: It appears my ignorance is showing.
01:02:30flaviuI suppose I can change that, but I the words "OOP" imply inheritance for many people.
01:02:52renesac_actually, I'm not sure if multi-methods are needed for inheritance
01:03:08renesac_I never used neither in nimrod
01:03:42renesac_http://nim-lang.org/tut2.html#object-oriented-programming
01:03:44Triplefoxoop is basically a "whatever i think it is" term at this point
01:04:16BlaXpirit_true dat
01:07:21*superfunc[mobile quit (Quit: Connection closed for inactivity)
01:08:22def-BlaXpirit_: i can't even get csfml installed^^
01:08:32BlaXpirit_def-, distro?
01:08:39def-i'm building from source
01:08:55BlaXpirit_uhhhhhhhhhhhhhhh okay
01:09:03BlaXpirit_what seems to be the problem?
01:09:10def-only have csfml 1.6 in gentoo strangely
01:09:15BlaXpirit_D:
01:10:10def-BlaXpirit_: https://gist.github.com/def-/561538f0a59243836fcb
01:10:49BlaXpirit_well i dont know gentoo at all
01:11:13def-that has nothing to do with gentoo, I'm just building from source and cmake is doing weird stuff
01:12:14BlaXpirit_lol i don't remember the last time i had to execute "make" myself
01:13:05phirakids these days
01:13:21phirain my day it was all configure;make;make install
01:13:35def-phira: i wish it was for sfml, don't understand this cmake error
01:13:39BlaXpirit_yaourt -S name here
01:13:40phiranow it's # curl http://insecure.site.com/installer.sh | bash
01:13:46BlaXpirit_def-, do u even have SFML?
01:13:49BlaXpirit_phira, yuck
01:13:55def-BlaXpirit_: yeah
01:13:57phiraBlaXpirit_: I know :/
01:14:07BlaXpirit_def-, I'm not sure if CSFML 2.1 will work with SFML 2.2
01:15:25BlaXpirit_whatever, this is not urgent :|
01:15:36def-BlaXpirit_: on archlinux sfml 2.2 gets installed with csfml 2.1 at least
01:15:46BlaXpirit_def-, yeah, and csfml doesn't work :D :D :D
01:15:51BlaXpirit_i had to downgrade
01:15:55BlaXpirit_sfml
01:16:03renesac_I don't know what SFML is, but I know what FML is, and it seems related
01:16:04renesac_:P
01:16:10BlaXpirit_no, not related
01:16:17BlaXpirit_this has gotten really offtopic, sorry
01:16:24BlaXpirit_and i definitely should go now.
01:16:29renesac_I ws being sarcastic
01:16:30renesac_XD
01:16:33renesac_*was
01:17:06BlaXpirit_it's not even jokingly related, because there is virtually nothing negative about it
01:17:27renesac_the compilation/instalation
01:17:43renesac_bah, forget it, it was a dumb joke
01:21:25reactormonkAraq, How can I interweave C code dependencies? It would depend on nim code, and other nim could would depend on the first one and the C code
01:21:51Araqreactormonk: .compile pragma?
01:28:20*z1y joined #nim
01:28:52*BlaXpirit_ quit (Quit: Quit Konversation)
01:32:22reactormonkAraq, I only see a compileTime pargma, not a compile pragma in the manual
01:32:27*z1y quit (Remote host closed the connection)
01:33:19Araqhttp://nim-lang.org/nimc.html#compile-pragma
01:33:25*z1y joined #nim
01:36:18reactormonkAraq, where do I put the code that the .compile pragma depends on? Above?
01:36:44Araqit doesn't matter, but it should be in the same module
01:39:29*JohnnyLee quit (Quit: Page closed)
01:42:12*z1y quit (Ping timeout: 264 seconds)
01:43:09reactormonkok
01:43:26reactormonkWill try and report.
01:49:30*gmpreussner_ joined #nim
01:49:57*gmpreussner quit (Ping timeout: 244 seconds)
01:58:06MyMindAraq: in few hours will be official for Textmate https://github.com/infininight/nim.tmbundle
01:58:38def-MyMind: nice
01:59:16MyMindIt's very basic support but will be shouted on the official twitter
01:59:26*VinceAddons quit (Read error: Connection reset by peer)
02:10:24*darkf joined #nim
02:14:18*z1y joined #nim
02:26:14*yglukhov__ joined #nim
02:27:35*z1y quit (Remote host closed the connection)
02:28:12*z1y joined #nim
02:30:23*yglukhov__ quit (Ping timeout: 240 seconds)
02:45:19*kapil__ joined #nim
02:50:10*yglukhov__ joined #nim
02:54:48*yglukhov__ quit (Ping timeout: 264 seconds)
03:04:24*willwillson quit (Ping timeout: 245 seconds)
03:07:43*z1y quit (Remote host closed the connection)
03:08:05*z1y joined #nim
03:18:20*Varriount joined #nim
03:19:56*Varriount quit (Client Quit)
03:20:48*Varriount_ is now known as Varriount
03:23:51*superfunc[mobile joined #nim
03:27:45renesac_nim still don't have any interface to write bits (rather than bytes) to a file?
03:29:11renesac_and when I should use the stream module rather than simply writing to a file using the procs in system?
03:32:18EXetoCthere are bit-granularity file systems?
03:33:29renesac_no, you need at least one bit of buffer
03:33:47renesac_but there are bit-granularity data that a proc can generate
03:34:09renesac_*one byte of buffer
03:38:34Varriountrenesac_: The stream module allows for multiple stream interfaces, such that you can (theoretically) write to a socket as easily as to a file.
03:39:02EXetoCbut what should happen if a single bit is written? since you need to then store a byte
03:39:17renesac_EXetoC: it is written to the buffer
03:39:45renesac_when you close the file, it is written, followed by some padding (zeroes?)
03:39:53EXetoCok
03:40:33Varriountrenesac_: So make the char equivalent of a bit padded by some zeroes?
03:41:06renesac_Varriount: well, what is the difference of defining the same procs for the socket as for a file?
03:42:12renesac_w/o using that stream object?
03:44:29*brson quit (Quit: leaving)
03:47:33*z1y quit (Remote host closed the connection)
03:48:05*Boscop quit (Read error: Connection reset by peer)
03:48:11*z1y joined #nim
03:48:30*Boscop joined #nim
03:49:46*saltylicorice joined #nim
03:53:38renesac_Varriount:: I will probably use a uint8, as data with bit granularity is binary data, and I will use lots of bitwise ops to manipulate it
03:54:30renesac_if there is no such IO/stream library, I will write it, but I'm not sure what model I should use
03:54:49renesac_I don't see what value the "stream" object full of callbacks is adding
03:55:24renesac_instead of the regular static dispatching by the compiler
03:55:37*z1y quit (Ping timeout: 240 seconds)
03:58:48Varriountrenesac_: Ask araq
04:10:51renesac_ok, it indeed makes easier to write extra functions that works on any type of stream
04:11:25renesac_but zahari's user defined type classes also should make the same thing possible
04:12:37renesac_just define a stream type testing if the required operations are defined for that type, and avoid that runtime overhead of calbacks
04:12:53renesac_I'm missing something?
04:13:33renesac_Varriount:: the manual says that user defined type classes are still in development, how stable are they?
04:14:43EXetoCthey often break
04:15:35*z1y joined #nim
04:17:56*ARCADIVS joined #nim
04:19:52renesac_:P
04:24:55*dts|pokeball joined #nim
04:26:58renesac_oh, but I think with pure generics it may be possible to make this work, but then the functions accepting Stream will have a "T" instead of the much more descriptive "Stream" as type
04:28:32renesac_and the tests will happen in the function bodies, instead of the requeriments being documented on a centralized place
04:28:54renesac_not very pretty
04:29:17renesac_is there work being done to fix user defined type classes, or is it low priority?
04:31:25EXetoCit's not of priority for 1.0, and zahary is very busy
04:31:35renesac_ok
04:33:20renesac_but whole libraries types (like the stream one) could be rewritten taking advantage of this, aparently
04:34:43*boydgreenfield quit (Quit: boydgreenfield)
04:38:39*jefus__ joined #nim
04:40:10renesac_and I find strange that the buffer and buffer lenght should be given as parameters to every relevant stream operation, as oposed to be stored in the stream object as state
04:40:34renesac_like it is in C I think
04:40:48renesac_that one is for araq to answer though
04:41:10*renesac_ is now known as renesac|away
04:41:57*jefus_ quit (Ping timeout: 240 seconds)
04:45:29renesac|awayoh, nevermind the last question, it is the lower level interface
05:04:01*saltylicorice quit (Ping timeout: 244 seconds)
05:05:41*x4nt joined #nim
05:06:01x4ntDoes echo always end in a newline?
05:10:14EXetoCyes. see 'write' (stdout.write)
05:18:40*Sergio965 joined #nim
05:47:21*superfunc[mobile quit (Quit: Connection closed for inactivity)
05:49:53*yenic left #nim (#nim)
06:17:54*jpoirier quit (Ping timeout: 244 seconds)
06:23:21reactormonkWhat's the current branch? devel or master?
06:26:23dts|pokeballreactormonk, i think devel just merged into master
06:43:14*dyu joined #nim
06:51:14*dts|pokeball quit (Changing host)
06:51:14*dts|pokeball joined #nim
06:52:51*SplinterOfChaos quit (Ping timeout: 256 seconds)
07:16:11*gmpreussner__ joined #nim
07:16:57*gmpreussner_ quit (Ping timeout: 240 seconds)
07:39:35*BlaXpirit joined #nim
07:46:39*yglukhov__ joined #nim
08:00:31*gour joined #nim
08:08:38*Sergio965 quit (Quit: Bye! :))
08:08:59*Sphax joined #nim
08:27:19*adam_s quit (Quit: Leaving)
08:29:11*dts|pokeball is now known as blackmist
08:29:37*blackmist is now known as dts|pokeball
08:29:57*hakand joined #nim
08:49:02*dyu quit (Ping timeout: 245 seconds)
08:51:53*dyu joined #nim
09:00:18*z1y quit (Remote host closed the connection)
09:00:51*z1y joined #nim
09:05:03*Sphax quit (Quit: ZZZZZzzzzz)
09:11:53ekarlso-yet what is it that will replace parseopt ?
09:14:51*goobles joined #nim
09:16:02*Sphax joined #nim
09:22:07*lyro joined #nim
09:36:01ekarlso-can a exception be used in a case statement ?
09:36:22*zahary1 quit (Quit: Leaving.)
09:36:42dts|pokeballtry it and see?
09:36:47ekarlso-packages.nim(247, 12) Error: selector must be of an ordinal type, float or string
09:36:50ekarlso-meh -,,-
09:36:54ekarlso-if statement then I guess
09:42:11*yglukhov___ joined #nim
09:42:11*yglukhov__ quit (Read error: Connection reset by peer)
09:48:57*hakand quit (Quit: Be back later ...)
09:51:05*repax joined #nim
09:51:48*hakand joined #nim
09:53:16*superfunc quit (Ping timeout: 246 seconds)
10:00:13*z1y quit (Remote host closed the connection)
10:01:24*z1y joined #nim
10:24:35*ekarlso- quit (Changing host)
10:24:35*ekarlso- joined #nim
10:33:03*gokr quit (Quit: Leaving.)
10:40:45*gokr joined #nim
10:40:57*Matthias247 joined #nim
10:41:17*gokr_ quit (Ping timeout: 240 seconds)
10:42:17*Sphax quit (Quit: ZZZZZzzzzz)
10:42:49*VinceAddons joined #nim
10:42:50*Sphax joined #nim
10:55:23*z1y quit (Ping timeout: 256 seconds)
11:00:16*gokr1 joined #nim
11:00:19*gokr1 quit (Read error: Connection reset by peer)
11:01:33*kapil__ quit (Quit: Connection closed for inactivity)
11:01:44*gokr1 joined #nim
11:05:12*willwillson joined #nim
11:05:38*bjz joined #nim
11:08:40*milosn quit (Remote host closed the connection)
11:09:34*milosn joined #nim
11:20:39*Sphax quit (Quit: ZZZZZzzzzz)
11:32:06*Epic|gmpreussner joined #nim
11:32:22*gmpreussner__ quit (Ping timeout: 245 seconds)
11:36:36*VinceAddons quit (*.net *.split)
11:36:36*x4nt quit (*.net *.split)
11:36:36*MightyJoe quit (*.net *.split)
11:38:20*MightyJoe joined #nim
11:38:29*xant1 joined #nim
11:39:52*Forty-3 quit (Ping timeout: 259 seconds)
11:40:49*Matthias247 quit (Read error: Connection reset by peer)
11:40:55*bjz quit (Read error: Connection reset by peer)
11:46:22*hakand quit (Quit: Be back later ...)
11:47:21*bjz joined #nim
11:47:27*soggybread quit (Quit: leaving)
11:48:00*hakand joined #nim
11:56:46*gokr1 quit (Quit: Leaving.)
12:08:30*z1y joined #nim
12:09:58*bjz quit (Read error: Connection reset by peer)
12:10:06*bjz_ joined #nim
12:11:33*repax_ joined #nim
12:14:27*z1y quit (Quit: Leaving.)
12:14:49*repax quit (Ping timeout: 245 seconds)
12:20:03*Sphax joined #nim
12:20:20*repax_ quit (Quit: repax_)
12:26:47*z1y joined #nim
12:33:17*z1y quit (Remote host closed the connection)
12:42:20*bjz joined #nim
12:42:43*bjz_ quit (Read error: Connection reset by peer)
12:46:42*Matthias247 joined #nim
12:50:30*bjz quit (Ping timeout: 250 seconds)
12:51:13*bjz joined #nim
12:59:16*irrequietus joined #nim
12:59:29*irrequietus quit (Changing host)
12:59:29*irrequietus joined #nim
13:05:42*z1y joined #nim
13:09:23*bjz quit (Ping timeout: 240 seconds)
13:14:02*jefus__ is now known as jefus
13:16:30*VinceAddons joined #nim
13:16:54*gokr quit (Ping timeout: 245 seconds)
13:18:01*bjz joined #nim
13:22:14*bjz quit (Read error: Connection reset by peer)
13:24:06joeboIt looks like asynchttpserver is single threaded. Are there any multi-threaded versions or other ways of enabling it to use all the cores on a machine, aside from having 8 processes listening on different ports and having a reverse proxy round-robin it
13:26:32*Trustable joined #nim
13:26:48acidxjoebo: not sure about technicalities regarding num, but if your operating system supports it, you can enable SO_REUSEPORT on the main socket, so that various processes can bind on the same port. the kernel will then schedule the connections.
13:27:41joebotrue
13:28:18Araqjoebo: we still haven't tested async with spawn :-)
13:28:21joeboI was hoping I there was an existing solution that used spawn
13:28:43joeboAraq: Thanks, I figured... it's still quite new it seems
13:28:56Araqboth features are bleeding edge
13:29:17Araqspawn works with classical sockets though
13:30:39*bjz joined #nim
13:32:01joebook... the async/await pattern looks really nice
13:32:09joebovery clean code
13:32:26Araqthat said, async has still performance problems, I think and so is slower than the boring old sockets, so spawn + old sockets might be the winner
13:32:46joeboI may try spawning from the asynchttpserver callback and see what happens
13:33:28joeboAraq: are you aware of any server examples using boring old sockets ? I can go check rosettacode
13:35:56joebohttp://goran.krampe.se/2014/10/25/nim-socketserver/
13:37:24Araqyeah that one uses a non-optimized deepCopy of the socket's buffer
13:37:32Araqbut apparently performance is acceptable
13:39:21joebohmm, it still only used one core on windows (100% cpu on one core) even with --threads:on
13:39:49*bjz quit (Ping timeout: 245 seconds)
13:40:56joebobut maybe the response callback is so quick that it still keeps using these same thread/core
13:55:55*kapil__ joined #nim
13:56:07joebothat seemed to be it. I added a more CPU intensive workload to the spawned callback and it started using more cores
13:56:32*bjz joined #nim
13:56:48Araqgood
13:57:25joebonim is really impressive. thank you
14:00:57*ramnes joined #nim
14:01:11*Matthias247 quit (Read error: Connection reset by peer)
14:06:20BlaXpiritso destructors is a new thing? :o
14:07:22BlaXpiritor has it been experimental for long?
14:08:32*dirkk0 joined #nim
14:09:16ramneshi
14:09:34*gokr joined #nim
14:09:50ramneswhy didn't I heard about nim before and why so much hype now?
14:10:10*bjz quit (Ping timeout: 255 seconds)
14:10:52gokrramnes: Because it was recently renamed to Nim - and because of the hype around Rust I suspect (where Nim pops up as a similar lang)
14:11:27ramnesyeah I know it just has changed it's name, but I never heard about nimrod neither
14:11:38gokrMe neither, until like a month or two ago
14:11:48ramnesand Rust is hype for monthes now
14:12:00gokrI have been cranking out articles btw, http://goran.krampe.se/category/nim
14:12:06gokrMight be of help if you are learning.
14:12:10*hakand quit (Quit: Be back later ...)
14:12:33ramnesnice, thanks gokr
14:13:09ramnesany serious project on Github to see some nice code?
14:13:11*bjz joined #nim
14:14:23joebogokr: your socket server example was very help. thanks
14:14:31gokrGood!
14:15:12gokrI am all for slick async stuff - but a "regular" forking server is also very useful since then you can rely on blocking code if you need to.
14:15:34gokrFor an async server all code handling the requests will need to be async.
14:16:04*hakand joined #nim
14:16:47gokrIts also worth noting that the "spawn" uses the thread pool that Andreas has written - so it doesn't actually create a new thread for each request.
14:17:34gokrramnes: I think the forum code, Aporia etc are some of the public examples.
14:17:37*z1y quit (Ping timeout: 264 seconds)
14:18:12gokrI wrote a little utility called blimp that makes it easy to handle big binary files in git. So it may be an interesting example of a command line utility.
14:19:17*dirkk0 quit (Quit: Leaving)
14:19:34dv-nimble is nice too
14:20:12*z1y joined #nim
14:21:07*Epic|gmpreussner quit (Ping timeout: 245 seconds)
14:22:04*z1y quit (Remote host closed the connection)
14:22:19*z1y joined #nim
14:23:01*Epic|gmpreussner joined #nim
14:23:33*bjz quit (Read error: Connection reset by peer)
14:23:52*Epic|gmpreussner is now known as gmpreussner
14:24:58*gmpreussner quit (Client Quit)
14:25:43*bjz joined #nim
14:31:48ramnes why mixedCase for functions? :(
14:32:31gokrWhy not?
14:33:27ramnesbecause snake_case is easier to read
14:34:18BlaXpiritramnes, at least you don't have to write mixedCase in nim
14:34:48*hakand quit (Quit: Be back later ...)
14:35:05ramnesyeah but it looks like it's already the defacto standard
14:35:11flaviu.give ramnes let fooBar = "123"; echo foo_bar
14:35:16Mimbusramnes: 123
14:35:34ramneswat
14:36:49gokrramnes: "is easier to read" - says who? Its quite odd to argue like that given the amount of people thinking otherwise.
14:37:09*hakand joined #nim
14:38:03BlaXpiritmixedCase is about as easy to read as mixed_c_ase
14:38:26ramnesgokr: see http://programmers.stackexchange.com/questions/27264/naming-conventions-camelcase-versus-underscore-case-what-are-your-thoughts-ab
14:38:32ramnesaRatherLongSymbolName vs a_rather_long_symbol_name
14:38:35ramnesseems fair to me
14:39:02flaviuarguing about identifier style is unlikely to be productive
14:39:11ramnesI know
14:39:49*bjz quit (Ping timeout: 245 seconds)
14:39:50ramnesbut this is a big part of a language standards design
14:40:09ramnesso I guess there is some reasons about mixedCase being used
14:40:28ramneshence my question
14:40:59gokrramnes: Reading a bit in that link you posted, its definitely not a black/white question.
14:41:01flaviuThe language is designed so that you can use whatever style you like.
14:41:17gokrI am a Smalltalker at heart, camelCase since 1980s :)
14:42:05ramnesflaviu: you know that "do what you want" never makes readable code :)
14:42:32flaviuramnes: Of course, your personal style should stay consistent.
14:42:39gokrAlso, IMHO you can't argue that a single identifier is easier/harder to read - its the code as a whole that is interesting. And then, I (humble opinion) tend to think that camelCase holds the identifiers "together" better.
14:43:15gokrBut either way, I just reacted to your view that there was some sort of "fact" that one was superior than another :)
14:43:42flaviuramnes: But the idea is that if some library author decides to do stuff like `underscores_everywhere` and you prefer camelCase, you can keep your code consistant
14:44:42BlaXpiritflaviu, and that author will be looked down upon -_-
14:45:01ramnesI really like the PEP about naming styles
14:45:33ramnesand in my question, I was actually wondering if there is such a document for nim
14:45:43ramnesnot really saying that snake_case is superior
14:46:18ramneslike I said, I'm just asking a question, don't really want to go in an infinite debate :)
14:46:55flaviuhttps://github.com/Araq/Nim/wiki/NEP-1-%3A-Style-Guide-for-Nimrod-Code
14:47:11*repax joined #nim
14:47:30flaviuIt's intended for the compiler and standard library, but there's no reason that it can't be used elsewere.
14:47:46ramnesnice
14:48:28*jpoirier joined #nim
14:49:10*jpoirier quit (Client Quit)
14:52:22ramnesit's funny how it nim feels heavily inspired by Python, like NEP instead of PEP
14:52:51ramnesbut still change things without explaining, like that naming convention
14:53:27ramnes(and I don't mean to be harsh or to troll, seriously)
14:53:50ramness/it//
14:54:08BlaXpiritit's harder to find a language it was not inspired by
14:54:52ramneswell, this might be biased since I'm a Python developer :p
14:54:52repaxThere have been much discussion on naming
14:56:00repaxThe steps away from T and P prefixes were very welcome
14:57:05BlaXpiritand instead we get even longer suffixes -_-
14:57:21*willwillson quit (Ping timeout: 244 seconds)
14:57:28flaviuBlaXpirit: IMO, you shouldn't have to use a suffix
14:57:34ramnes:D
14:57:47flaviuDecide if you want your type to be a ref or a value, and stick with it.
14:58:01BlaXpiriti have been able to avoid it quite successfully lately, but i'm afraid it won't always be the case
14:59:35*bjz joined #nim
14:59:36ramnesfor what kind of project would you absolutely use nim instead of an other language?
14:59:39flaviuBlaXpirit: Well, many languages get along fine treating everything as a ref.
15:00:08BlaXpirit(and i ended up looking for an alternative to such a language...)
15:01:10repaxWhy not simply use the ptr and ref keywords?
15:01:53repaxAs well as `var`
15:02:35repaxThe need for specific ref prefixes are very uncommon
15:03:08flaviurepax: Because `new` is annoying to use, and you can't use the type construction syntax with prefixes.
15:03:20repaxramnes, lately, wherever I can
15:03:38EXetoCflaviu: you mean, without them? well you can actually
15:03:47flaviuThat's why I wrote https://gist.github.com/flaviut/1ae1d7deac4c57d0a84c
15:03:51EXetoCwith another parenthesis pair
15:04:24flaviu.give EXetoC type Typ = object; val: int; discard (ref Typ)(val : 1)
15:04:27MimbusEXetoC: <no output>
15:04:33flaviuwait, what?
15:04:43EXetoC:-p
15:04:45flaviuhuh, that must have been implemented recently.
15:05:13flaviuI still like box better though
15:08:03EXetoCBlaXpirit: there are so many other aspects to a language though - major ones that matter
15:08:35BlaXpiritit's not the prefixes themselves, it's the confusion that they cause
15:08:58flaviu.eval "1.2.3.4.5.6".split('.').map(strip)
15:09:01Mimbusflaviu: eval.nim(3, 24) Error: type mismatch: got (seq[string], proc (string, bool, bool): string{.noSideEffect.})
15:09:11flaviubut the last two bools are optional.
15:09:40BlaXpiritbugs are everywhere
15:10:02*bjz quit (Ping timeout: 250 seconds)
15:11:21*saml joined #nim
15:11:27EXetoCBlaXpirit: there are many other things a newcomer has to learn
15:11:44EXetoCwhat do you think about Obj/ObjRef/ObjPtr?
15:12:04BlaXpiritEXetoC, yeah, there are many undocumented things a newcomer has to learn
15:12:04EXetoC*Foo
15:12:15*vqrs joined #nim
15:12:24EXetoCand then FooObj
15:12:43BlaXpiritwhat do you mean, what I think about them
15:12:45EXetoCthat's a temporary issue, but ok good point
15:13:17EXetoCBlaXpirit: yes, that's the replacement. the primary type would just be Foo, and then you would introduce some of the others if necessary
15:13:42BlaXpirithow do I know if it's necessary?
15:14:00BlaXpiritwhat if i make a library and think it is not necessary to make the object type public
15:14:36BlaXpirit(which is exactly what i did)
15:15:38flaviuBlaXpirit: Then I suppose your users will have to stop worrying about that small inefficiency.
15:16:08EXetoCyes, you can either add them later, or the user can, or the user can just do (ref Foo)
15:16:15BlaXpiritnope
15:16:36BlaXpiriti mean, the first part - yes, the rest - nope
15:17:19flaviuHas anyone written a dynamic typing library?
15:17:33EXetoCyou'd like to avoid ref Foo at all costs?
15:17:49repaxIs this really a problem with nim? No matter what language you use you have to consider the boundary between API and implementation
15:17:51BlaXpiritEXetoC, you misunderstood... i wasn't clear enough
15:18:09BlaXpiritI'd like to avoid having these different types at all costs
15:18:10EXetoCrepax: right
15:18:33vqrsIs anyone using nim for JavaScript stuff?
15:18:35BlaXpiritwhich is why i enforce object-type-only for some and ref-type-only for others
15:18:37EXetoCBlaXpirit: then do so if you choose. I'm just saying that it's new convention
15:19:08flaviuvqrs: only project I know of is the package list on the nim website.
15:19:19BlaXpiritbut I have a scarier problem at hand
15:19:22BlaXpirit"usage of a type with a destructor in a non destructible context"
15:19:43EXetoCBlaXpirit: I don't know how that approach is any different
15:19:50vqrsflaviu
15:19:56vqrsflaviu How do you mean?
15:20:20BlaXpiritnim-lang/packages
15:20:32BlaXpiritno, that's not it
15:20:46flaviuvqrs: http://nim-lang.org/nimblepkglist.js
15:21:10flaviuit runs on this page: http://nim-lang.org/lib.html
15:21:12*bjz joined #nim
15:21:13BlaXpiritdon't scare people like that
15:21:14EXetoCBlaXpirit: you mean, because the basic type would then sometimes not be exposed? then maybe it would be a good idea to always define it
15:21:32vqrsI see
15:21:34BlaXpiritEXetoC, so it's just a ton of boilerplate
15:22:02*tane joined #nim
15:22:42EXetoCmaybe. I don't think many people have adhered to this convention yet
15:23:32BlaXpiritI think a JS minifier is a must-have in any nim-js pipeline
15:24:32repaxSounds useful
15:25:28BlaXpirithttp://marijnhaverbeke.nl/uglifyjs http://nim-lang.org/nimblepkglist.js result is 53.6% of original
15:25:50BlaXpiritnobody's gonna look at it anyway
15:26:12BlaXpiriti mean actively read it
15:26:27flaviuIt could be even smaller, if a more advanced compiler was used
15:26:49BlaXpiritlol
15:26:51flaviuthere's lots of stuff in the global scope that doesn't need to have long identifiers.
15:26:53BlaXpiritit just pollutes namespace
15:26:54onionhammeri would use closure compiler
15:26:56onionhammertoo
15:26:58BlaXpiritthat's compiler's fault
15:26:58onionhammersee which gives smaller results
15:27:04onionhammerhttps://developers.google.com/closure/compiler/
15:27:05BlaXpiritit should be wrapped in anonymous function
15:27:10flaviuI can't get closure compiler to work.
15:27:14onionhammerhttp://closure-compiler.appspot.com/home
15:27:17flaviuCompilation did not complete successfully. See warnings pane for details.
15:27:37vqrsI was looking for a powerful language for a single page application, and Nim looks nice, but http://nim-lang.org/backends.html#the-javascript-target makes it sound like it's not a very good idea
15:27:49onionhammerfor advanced it didnt, hm
15:28:33onionhammerdoesnt look like valid js to me..
15:29:03onionhammerwhoa.. did not know JS had labels
15:29:05onionhammerthats crazy ;)
15:29:12BlaXpiritno goto though
15:29:24onionhammeryeah
15:29:33onionhammerthats where the closure compiler is hanging up
15:30:09EXetoCvqrs: what do you think is missing?
15:30:18BlaXpiriti don't understand that code
15:30:25BlaXpiritthere is a bunch of function definition
15:30:28BlaXpiritbut where is "main"?
15:30:51vqrsEXetoC:It sounds like I can't make use of virtually the entire standard library.
15:32:04BlaXpiritthe main question is, can js libraries be used
15:32:23flaviuBlaXpirit: All the code that is not in a function is main
15:32:38vqrsThat, too. The page only shows a rudimentary funciton call to JS, not however whether the JS object model can be accessed from within Nim
15:32:41BlaXpiritflaviu, it's hard to tell because of no indentation xD
15:32:47*z1y quit (Ping timeout: 265 seconds)
15:33:28BlaXpiritvqrs, I can't find even that
15:33:35BlaXpiritpls link to "rudimentary funciton call to JS"
15:33:45vqrsBlaXpirit: http://nim-lang.org/backends.html#javascript-invocation-example
15:33:52kokozedmanhey guys... how do I do a C : return *((uint32_t*)(addr)) in nim? addr is an arbitrary pointer
15:33:53BlaXpiritthank you
15:34:08BlaXpiritcast[ptr uint32] i think
15:34:24BlaXpiritcast[ptr uint32](addr)[] i think
15:34:25gokrvqrs: Amber smalltalk is quite cool (one page app)
15:34:36kokozedmanBlaXpirit: ok, thanks
15:35:16BlaXpiritah, vqrs
15:35:21EXetoCit's just that addr is a keyword
15:35:27vqrsgokr: Hmm the overview sounds nice
15:35:31BlaXpiritso you have to predefine all functions and it has to be static
15:35:36BlaXpiritnope nope, not usable for js, sadlt
15:35:39BlaXpiritsadly
15:35:48gokrvqrs: I know Nicolas Petton who created Amber. Its used for www.smalltalkhub.com
15:35:58BlaXpiritnot that i would want to confine myself to a compiled language if it's all gonna perform even worse than default
15:36:15gokrIts a very clean Smalltalk and the cool part is that the IDE runs "live" in your browser
15:36:24gokrSo you can code as you go.
15:37:14flaviuWell, I got rid of all the code it kept whining about, but it still fails
15:37:33BlaXpiritwhatever
15:37:50vqrsWell, I'm going to write a compiler that runs in the browser, and visualizes its execution step by step, and for correctness' sake I wanted some more bells and whistles than JS has... I looked at TypeScript so far and that didn't look too shabby
15:38:01BlaXpiritthe js target really, really, really should output everything wrapped in a function+call
15:38:03*bjz quit (Read error: Connection reset by peer)
15:38:29BlaXpiritguys, the best thing that tries to hide JS's horrors is LiveScript
15:38:33BlaXpiritplease just trust me
15:38:33gokr vqrs: Do look at Amber. Its already a compiler that runs in a browser :)
15:39:00EXetoCsome people seem to have nothing but praise for js
15:39:11EXetoCbut that's true for everything I guess
15:39:13gokrvqrs: Check this: http://amber-lang.net/learn.html
15:39:17gokrInteractive tutorial.
15:39:29vqrsgokr: I will, the language is set to be Eiffel though, it's a Bachelor's Thesis
15:40:00gokrvqrs: Either case, the Amber compiler is a full multistage compiler with an IR etc, so ... it should be useful to study.
15:40:10BlaXpiritdoes the "Got 5 minutes?" part refer to the time it takes to load?
15:40:11gokrAnd its written in itself.
15:40:18vqrsBlaXpirit: Fair question
15:40:45gokrNote that I don't think the tutorial is stripped/minified etc.,
15:40:57gokrAny "one page app" will have a bit of loading time I guess.
15:41:11gokrAlso, the latest Amber and IDE etc is newer than those pages.
15:41:12BlaXpiritno but it seriously loads for minutes
15:41:15vqrsI'm waiting a minute now...
15:41:15gokrWhat?
15:41:31gokrOh, then it must be broken
15:41:46BlaXpiritit loads for a minute and then just stops download and is simply broken
15:41:51BlaXpirityay
15:41:57flaviuYeah, there's a message in the console
15:42:01flaviuit looks broken
15:42:17vqrsyep
15:42:17gokra pity.
15:42:27gokrBut you can check the old IDE by clicking that button on the main page
15:42:51gokrAnd in fact, on www.smalltalkhub.com - you can get into the IDE and browse all the code of that site.
15:43:31flaviuNeat. Is the code stored as an AST?
15:43:45gokrThe code is stored compiled.
15:43:55gokrIf you hit the console on www.smalltalkhub.com
15:43:58gokrAnd type in:
15:43:59gokrsmalltalk.Browser._open()
15:44:09gokrAnd hit enter, you get the IDE up. Then you can browse the code.
15:44:29gokr(agian the older IDE, the new is called Helios)
15:44:55gokrEvery time you save a method it will be compiled into js and "hooked in".
15:44:57vqrssmalltalk.Browser is undefined here
15:45:35gokrChrome?
15:45:40gokrIt works for me in Chrome.
15:45:41vqrsYeah, that explains it I guess: http://puu.sh/e6EsZ/7d5ea5c6f2.png
15:46:28gokrinteresting
15:47:26gokrWeird.
15:47:30gokrIt works for me.
15:47:37vqrsMaybe you have it cached?
15:47:40def-works for me as well
15:47:48gokrSmalltalkhub is an Amber app - that uses REST to talk to a REST based server that uses MongoDB.
15:48:03gokrSo the whole UI is in Amber.
15:48:21gokrvqrs: I may, but I doubt def- has
15:48:32vqrshmm
15:48:56vqrsnow it works...
15:49:23gokrIts a sortof github kinda site but for Smalltalkers.
15:49:35gokrNicolas wrote it - same guy who created Amber.
15:52:17gokrSorry for the offtopic flurry, but its a very nice example of a language on/in js (not just a trivial transformation).
15:52:38BlaXpiritit never works out
15:55:43*bjz joined #nim
15:56:48gokrBlaXpirit: What do you mean?
15:57:11vqrsgokr: Shame the tutorial is down...
15:57:23BlaXpiritgokr, "a language on/in js (not just a trivial transformation)." never works out
15:57:36gokrvqrs: I can alert them on the list
15:57:45vqrsgokr: Thanks
15:57:56samlwhy not?
15:58:06gokrvqrs: But it a pretty clean Smalltalk, so any tutorial on Smalltalk
15:58:59gokrBlaXpirit: Its kinda interesting to claim that "it never works out" for a language that actually runs a site with over 2000 repositories and almost 2000 register accounts.
15:59:41vqrsI've never used SmallTalk before, so I it's kinda hard to judge for me whether I should go down that road
16:00:25BlaXpiritno, it is not hard
16:01:25vqrsYou like being cryptic, eh?
16:01:33*kapil__ quit (Quit: Connection closed for inactivity)
16:01:49BlaXpiritbeing direct would've been worse
16:02:41*darkf quit (Quit: Leaving)
16:03:06gokrvqrs: Its kinda like Ruby since Ruby is a Smalltalk "clone" in a different syntax
16:03:50gokrAs usual, its all about what you want to do. Smalltalk has been successful in many different contexts. But its very different from Nim of course.
16:04:43gokrvqrs: Good starting place: www.world.st
16:05:21vqrsgokr: Currently doing this: http://amber-smalltalk.github.io/trysmalltalk/ Based on the name "prof stef" I guess that it's the same
16:05:39gokrAh, great. Yep, same.
16:06:22*gour quit (Remote host closed the connection)
16:07:45*gour joined #nim
16:10:49BlaXpirittook me long enough to realize that my library has memory leaks virtually everywhere
16:11:15BlaXpiritwho would've thought {.override.} is so relevant
16:11:31BlaXpiritand now that I added it, I'm getting "usage of a type with a destructor in a non destructible context" for no reason
16:11:34*bjz quit (Ping timeout: 250 seconds)
16:11:56BlaXpiritare destructors even a popular thing? are there alternatives maybe?
16:12:24BlaXpiritbecause i do need to destroy ptr object when it goes out of scope
16:15:25*bjz joined #nim
16:15:31EXetoCpointers are unmanaged. you could either do it manually or wrap the type
16:15:58BlaXpiritI'm gonna need a destructor either way.
16:16:38EXetoCdestructors are experimental
16:16:45BlaXpiritwhat does that mean?
16:17:06BlaXpiritnot experimental in general
16:17:24BlaXpiritI'm interested for the outlook of community on destructors, the progress of their implementation, etc
16:17:39BlaXpiritin any case... is this a bug? https://bpaste.net/show/bcf10f3a5640
16:18:05BlaXpiritoh, should've added the error message. it's "(8, 5) Error: usage of a type with a destructor in a non destructible context"
16:18:05EXetoCdon't you need {.experimental.} in order to use destructors now? they simply might not work as expected in some cases
16:18:43BlaXpiritEXetoC, they seem to work nicely when I don't reassign variables
16:19:10BlaXpiritat least the rest of my code compiled and memory leaks were gone
16:19:40*hakand_ joined #nim
16:20:02BlaXpiritoooh I have an idea. I wish I could let users of my library choose whether to activate destructors or not
16:20:14*hakand quit (Ping timeout: 245 seconds)
16:20:16EXetoCit's yet another thing that might not have priority over other things
16:21:11BlaXpiritI'm pretty sure I know how to conditionally apply a pragma, but what about passing options to modules?
16:21:39*matkuki joined #nim
16:22:14BlaXpirit--symbol?
16:23:47EXetoCI don't know, but I've only used --define so far
16:26:04BlaXpiritsure would be nicer to define it in code
16:28:54BlaXpiritdefine is the thing. thanks.
16:31:25*dyu quit (Quit: Leaving)
16:32:27matkukiHappy new year guys!
16:33:12dv-that was two weeks ago matkuki
16:33:27BlaXpiritoptional destructors, not too shabby https://bpaste.net/show/d62540a0a074
16:33:31samlmatkuki, happy birthday
16:35:05matkukiYes I know, I haven't been on this channel for some time :)
16:36:29matkukiWhy does array access with an enum member require an .ord to be added? example:
16:37:01matkukia[MyEnum.en.ord], instead of just a[MyEnum.en]
16:37:28EXetoCthat works if it's an array that takes MyEnum indices
16:38:01BlaXpiritmatkuki, enums members are not numbers
16:38:36*jefus_ joined #nim
16:39:11matkukiBlaXpirit: Can you explain in more detail? I'm new to Nim.
16:39:48BlaXpiritwhat is MyEnum.en?
16:40:24BlaXpiritit's a thing, a concept, just one of MyEnum's options. it is not a number
16:40:27*bjz quit (Ping timeout: 265 seconds)
16:40:48BlaXpiritso why are you surprised that an operation that wants a number does not accept something that is not a number?
16:41:07EXetoCsome languages have more relaxed semantics
16:41:20EXetoCbut I approve of the added type safety
16:41:41matkukiEXetoC: That's why I was a little confused.
16:42:01matkukiBlaXpirit: Got it, thanks.
16:42:11*jefus quit (Ping timeout: 256 seconds)
16:42:19EXetoCit's similar to having a "T = distinct int", where T is not an int, but if you want the underlying value then you have to do "val.int"
16:44:55matkukiEXetoC: When is this useful?
16:45:51EXetoCmatkuki: you could prevent something like this for example: "10.kg + 5.miles"
16:46:20matkukigood example, thanks
16:46:44EXetoChad those not been distinct, but then it would be exactly the same as "10 + 5"
16:48:20EXetoCimplicit conversions can be defined with converters, but that should be done sparingly, so as to not create needless confusion
16:51:42BlaXpiritwhy does nim have to converge from posix-defined command line arguments specification?
16:51:47BlaXpiritdiverge*
16:52:25ldleworkto keep you on your toes
16:52:31ldleworkBlaXpirit: I don't think Araq is a big fan of posix
16:52:41BlaXpiritand even in parseopt2 error handling seems nonexistent
16:52:44BlaXpiriti don't understand
16:52:53BlaXpiritdoes it just accept any options and
16:53:08BlaXpiritleave almost everything to you?
16:53:21BlaXpiritgeez
16:53:32BlaXpiritnot even an automatic help message generation?
16:53:54ldleworkBlaXpirit: settle down
16:54:00*gokr quit (Quit: Leaving.)
16:54:45BlaXpiritsomeone really should check out docopt
16:56:01*kniteli joined #nim
16:56:12BlaXpiritldlework, how can I settle down, when the language with the most potential suffers from such silly things
16:56:27ldleworkBlaXpirit: I mean, you've been here for a while
16:56:39BlaXpiriti still keep getting surprised
16:57:03ldleworkIt should come as no surprise Nim is full of these wierd edges that require careful handling
16:58:02BlaXpiritdoes nim compiler command line interface actually use this thing?
16:58:15BlaXpiritthat explains why it's so wonky
16:59:30flaviuEXetoC: In that case, mightn't an implicit converter between kg and g be a good idea?
16:59:31*enquora joined #nim
16:59:50BlaXpiritflaviu, they should be the same type
16:59:53flaviuso you could add 100.g + 1.kg
17:00:03*brson joined #nim
17:00:14BlaXpiritproc kg(x) = G(x:x)
17:00:24ldleworkflaviu: I think that's what they were saying so but to not go over board
17:00:24BlaXpiriti mean proc g(x) = G(x:x)
17:00:37BlaXpiritproc kg(x) = G(x:1000*x)
17:00:41flaviuYeah, I think that BlaXpirit has the best solution here.
17:01:03flaviubest to keep the units consistent
17:01:26BlaXpiritG is like distinct float
17:01:26EXetoCflaviu: why not overload the operators?
17:01:35BlaXpiritand no idea why i wrote "x:" there
17:01:46flaviuEXetoC: Combinatorial explosion.
17:02:02BlaXpiritkg(x) = Grams(1000.0*x)
17:02:29flaviuBlaXpirit: Yes, I understand
17:02:49BlaXpiriti just wanted to write it out better
17:03:44BlaXpiritseriously though, should I look into porting docopt to Nim?
17:04:27flaviuBlaXpirit: Please do. parseopt's syntax is unconventional and the api is meh too.
17:04:41BlaXpiritlol syntax is the least of its problems
17:04:52BlaXpiritthat module probably has like 20 lines of code because it just does almost nothing
17:05:19*Matthias247 joined #nim
17:05:38EXetoChttps://github.com/acolley/docopt.nim.git
17:05:40repaxweight is just *one* type. Use templates to implement others too (length, energy, etc)
17:05:48BlaXpiritEXetoC, oh.
17:06:07def-repax: I did something like that: https://github.com/def-/nim-units/blob/master/units.nim
17:06:30BlaXpiritcrazy
17:06:34BlaXpiriti like it
17:06:43repaxdef-, looks very nice!
17:07:01flaviuYeah, really impressive
17:07:22flaviualthough it looks like you forgot to add a flag to turn off tests.
17:08:27def-flaviu: yeah, the whole thing was more of a test, should clean it up a bit
17:08:48BlaXpiritdocopt.nim - 1 star on github
17:08:52BlaXpiritis the situation really that dire?
17:09:26flaviudocopt.nim doesn't seem to have tests
17:09:39EXetoCI've never heard anyone mention it
17:09:43flaviubut docopt provides a test suite: https://github.com/docopt/docopt/blob/master/testcases.docopt
17:09:46EXetoCit might not have been announced
17:10:21BlaXpiritit seems unfinished
17:10:29BlaXpirittons of todo
17:11:10*hakand__ joined #nim
17:11:10*hakand_ quit (Read error: Connection reset by peer)
17:11:11flaviuyep: "# TODO: finish"
17:11:16BlaXpiritD:
17:11:38flaviuBlaXpirit: So get to work!
17:11:46EXetoCthat TODO sure carries a lot of weight
17:11:52BlaXpiriti've been working 5 days and nobody wants to check out my library
17:11:57BlaXpirit:<
17:12:23BlaXpiritwell i haven't really announced it, but yeah
17:12:24EXetoClink?
17:12:30EXetoCright.. :p
17:12:35BlaXpirithttps://github.com/blaxpirit/nim-csfml
17:13:04flaviuI'm not interested in making games at the moment, but maybe a short example would be good?
17:13:05EXetoCI'm pretty sure fowl would've accepted PRs, but ok
17:13:09EXetoCor were there any other issues?
17:13:11flaviuoh, there are examples
17:13:18def-flaviu: pretty nice examples even
17:13:18BlaXpiritthere sure are examples
17:13:28BlaXpirit1 doesnt work because i added destructors and there is a bug
17:13:31BlaXpiritgonna fix it soon
17:13:41BlaXpirit(bug in nim, seems likely)
17:13:57BlaXpiritEXetoC, there are many issues
17:14:15BlaXpiritthe main ones I've written as issues on fowl's library
17:14:28BlaXpiritbut it's just manually maintained or even not maintained in some places
17:14:39BlaXpirithuman error is likely
17:15:19flaviuIt's also more fun to start from scratch, right? :P
17:15:23BlaXpirityes
17:15:39BlaXpiritwell in this case it also was easier
17:16:01BlaXpiriti did learn a lot from the other library though
17:18:13*willwillson joined #nim
17:18:30repaxIs there a principle behind the variance in naming convention: new_RenderWindow() vs newSoundBufferRecorder()
17:19:03BlaXpiritrepax, I write examples in 2 different styles
17:19:19BlaXpiritthe library itself adheres to official style guide as far as i'm aware
17:19:23*goobles quit (Quit: Page closed)
17:19:25BlaXpiritbut some examples i use my own preferred style
17:19:37repaxOk, just wondered
17:19:43BlaXpiritrepax, underscores are ignored in nim btw
17:19:49repaxI know
17:19:53flaviu#fcf8f4 looks really great. Nice choice boydgreenfield.
17:20:07BlaXpiritwha
17:20:13repaxBut sometimes one might want to put emphasis on something
17:20:39*bjz joined #nim
17:21:57BlaXpiritflaviu, took me long enough to figure out that you're probably talking about documentation
17:22:03flaviuoh, yes.
17:22:13flaviuthe background color
17:24:24*gokr joined #nim
17:24:49*gokr_ joined #nim
17:24:59BlaXpiritAnd if someone is still looking at my library, make sure to nitpick.
17:25:03*gokr1 joined #nim
17:25:26ldleworksimple.nim(3, 32) Error: type mismatch: got (int literal(800), int literal(600))
17:25:43BlaXpiritokay, that's not good..?
17:25:58gokr1BlaXpirit: Help me evolve lapp then
17:26:10BlaXpiritgokr1, sorry?
17:26:34gokr1https://gitlab.3dicc.com/gokr/lapp
17:26:47gokr1It uses the synopsis (= help message) as the grammar
17:27:00gokr1Originall ported to Nim from Lua by Steve Donovan
17:27:01BlaXpiritgokr1, but that's what docopt does
17:27:11gokr1docopt?
17:27:14BlaXpiritwhy is your library good and why why not port docopt and why i
17:27:19BlaXpiritwhy is your library good and why not port docopt
17:27:37gokr1I didn't know about docopt - and lapp was already (as I said) ported by Steve
17:27:43BlaXpiritokay
17:27:49gokr1I simply fixed it from a bit of rot - and improved it a bit.
17:27:58gokr1I use it in blimp
17:28:51*gokr quit (Ping timeout: 264 seconds)
17:29:01flaviuI personally like docopt better
17:30:17gokr1Seems neat
17:30:21gokr1I hadn't heard of it
17:30:36BlaXpiritI updated nim-csfml so that snakes example should work now
17:30:42BlaXpiritit's my favorite
17:31:44BlaXpiritooh it might be a cool idea to implement a compile-time option parser
17:32:11BlaXpiritdocopt for C works by generating C code using Python :|
17:32:12flaviuCool, yes, but it'll be a lot more work
17:32:22BlaXpirithow cool of a showcase would it be though
17:32:33BlaXpiriti have no idea if it's even possible
17:32:39flaviuof course it is
17:32:58flaviuif nothing else, you could use parseStmt
17:33:21flaviuthen it's just standard string mangling
17:35:12BlaXpiritldlework, so please tell me more about that error
17:35:12*yglukhov___ quit (Read error: Connection reset by peer)
17:35:17*yglukhov____ joined #nim
17:36:28BlaXpiritproc videoMode*(modeWidth, modeHeight: cint, bitsPerPixel: cint = 32)
17:36:36BlaXpiritcan you not call it videoMode(800, 600) ?
17:37:08flaviugokr1: your lapp library doesn't appear to be in pacakges.json
17:37:24flaviuYou should submit it: https://github.com/nim-lang/packages/compare
17:38:47*bjz quit (Read error: Connection reset by peer)
17:39:13ldleworkBlaXpirit: I'm just running your master branch
17:39:16ldleworkand doing
17:39:20ldleworknim c simple.nim
17:39:31BlaXpiritwell that's not good
17:39:42BlaXpirityou can do cint(800), cint(600)
17:39:52BlaXpiritbut i thought you can pass int literal to cint arguments
17:40:04BlaXpiritit's pretty lame if you can't......
17:40:20BlaXpiritbut it works on my system, and on def's system
17:40:36ldleworkit wants three ints
17:40:39ldleworknot two
17:40:46ldleworkcsfml.videoMode(width: cint, height: cint, bpp: cint): TVideoMode
17:41:15BlaXpiritldlework, you're using fowl's library
17:41:21BlaXpiritD:
17:41:34BlaXpiritthe T gives it away
17:41:51ldleworkThat sounds like a problem with packaging then
17:41:55ldleworkWell I guess not
17:42:08BlaXpiritit's quite a problem that they're named the same :|
17:42:46ldleworkhow do you do a nimble install from source?
17:42:54BlaXpiritgo into the folder
17:42:56BlaXpiritnimble install
17:43:01BlaXpiriti should mention that too, huh
17:43:31BlaXpiritldlework, but the way I'm doing it is --path:../src
17:44:24*yglukhov____ quit (Ping timeout: 240 seconds)
17:55:50*bjz joined #nim
17:58:16ldleworkBlaXpirit: I installed csfml 2.2 from source but I get
17:58:24ldleworkcould not load: libcsfml-window.so
17:58:28BlaXpiritldlework, is there such thing as csfml 2.2?
17:58:35ldleworkyeah its the latest version
17:58:35*hguux_ quit (Ping timeout: 272 seconds)
17:58:45BlaXpirithttps://github.com/LaurentGomila/CSFML/releases
17:58:58*phira quit (Excess Flood)
17:59:03ldleworkhttp://www.sfml-dev.org/download/sfml/2.2/
17:59:07ldleworkI take it csfml is something else?
17:59:13BlaXpirityes
17:59:20*phira joined #nim
17:59:28*Sphax quit (Quit: CYA!!)
17:59:41BlaXpiritldlework, it looks like you had used fowl's library before
17:59:53BlaXpiritdid you not have those libraries already installed?
17:59:59ldleworkalright
18:00:32BlaXpiriti'm gonna try to help you in private messages cuz this is offtopic
18:00:37*ARCADIVS quit (Quit: ARCADIVS)
18:01:07*rpag joined #nim
18:01:07*hguux_ joined #nim
18:06:16*dts|pokeball quit (Quit: Leaving)
18:06:36*dts|pokeball joined #nim
18:07:37*dts|pokeball quit (Remote host closed the connection)
18:07:57*dts|pokeball joined #nim
18:08:50*dts|pokeball quit (Remote host closed the connection)
18:09:05*dts|pokeball joined #nim
18:10:19*skyfex quit (Read error: Network is unreachable)
18:10:56*skyfex joined #nim
18:11:48*iivvoo quit (Ping timeout: 265 seconds)
18:12:33*dts|pokeball quit (Client Quit)
18:14:13*EastByte_ quit (Ping timeout: 265 seconds)
18:15:03*CARAM__ quit (Ping timeout: 244 seconds)
18:16:11*Varriount|Busy joined #nim
18:16:26*EastByte_ joined #nim
18:17:05Varriount|BusyMeep.
18:17:14BlaXpirithi
18:17:47*dtscode joined #nim
18:17:58*CARAM__ joined #nim
18:18:11*iivvoo joined #nim
18:18:29ldleworkI wanted to share this all with you: http://labs.echonest.com/Uploader/index.html?trid=TRXKEZN13AF58CD0A8&thresh=9
18:19:00ldleworkyou're welcome
18:21:05*hakand__ quit (Quit: Be back later ...)
18:22:28*gour_ joined #nim
18:25:19*bjz quit (Ping timeout: 256 seconds)
18:25:22*Trixar_za quit (Ping timeout: 244 seconds)
18:25:42*gour quit (Ping timeout: 245 seconds)
18:27:58*Trixar_za joined #nim
18:34:02*superfunc joined #nim
18:39:52*yglukhov____ joined #nim
18:42:33*gour_ is now known as gour
18:43:04*bjz joined #nim
18:43:42Varriount|BusyHrm. Decisions, decisions...
18:45:33superfuncjust curious, on variant types, why can't the names clash across discriminators?
18:48:19superfuncas in: Term = ref object ... case kind : TermKind ... of Succ: t1 : Term .... of Pred: t1 : Term
18:49:12Varriount|Busysuperfunc: I think it's an implementation detail, and an ambiguity issue
18:49:37ekarlso-flaviu: yo
18:49:43flaviuhi
18:50:00superfuncVarriount|Busy: Ok, I just wanted to make sure there wasn't some flaw in doing it that way I was missing
18:52:20BlaXpiritsuperfunc, Varriount|Busy, I just recently also ran into that
18:53:20superfuncI've been doing a small writeup on implementing simply typed LC in nim to add some documentation to the language.
18:53:30Varriount|BusyLC?
18:53:37superfuncHopefully I'll get it done in the next few days, still a few more things I need to read
18:53:42superfunclambda calculus
18:54:21superfuncso far my Nim implementation is much faster, and equally as clean as my old Ocaml one
18:54:30*tgkokk joined #nim
18:54:44def-superfunc: nice, anything online yet?
18:55:16superfuncI'll ping you in the next couple days I'm ready to show it
18:55:17*bjz quit (Ping timeout: 245 seconds)
18:55:45*ldlework is now known as superproc
18:56:16*superproc is now known as ldlework
18:57:02superfunchad I known I'd be so into nim... lol
18:57:15ldleworkhehe
18:59:28*tgkokk quit (Ping timeout: 264 seconds)
19:04:00*tgkokk joined #nim
19:04:26*bjz joined #nim
19:04:56*SplinterOfChaos joined #nim
19:07:16onionhammerVarriount|Busy deciding on what to work on next? :)
19:07:23onionhammerVarriount|Busy cuz I have an idea
19:08:56Varriount|Busyonionhammer: What is it?
19:09:12onionhammernew NimLime release
19:09:17Varriount|Busyonionhammer: I was thinking about working on IDE Tools, since people on the forum seem to be clamoring for it.
19:09:31onionhammerthat would be awesome
19:09:42Varriount|Busyonionhammer: Sure we can't just set the package control to just use the head revision all the time?
19:09:43onionhammerI could help you test that too
19:09:56onionhammerim not sure - i didn't submit it to package control
19:10:04onionhammerim not sure we want to do that either ;)
19:10:20onionhammeralso I think some of your stuff might have gotten borked over the past several months
19:10:27Varriount|Busyonionhammer: ?
19:10:45onionhammerjust thnk you should retest it, not sure specifically
19:10:51onionhammerif you havent already retested latest
19:11:02onionhammerthink there was something with ##
19:11:06onionhammeriirc
19:11:06Varriount|Busyonionhammer: I accounted for the executable renaming, I think.
19:11:22Varriount|BusyWhen I get home I'll test it.
19:11:25onionhammerokay
19:12:08Varriount|Busyonionhammer: At the moment, in my spare time, I'm designing a filepath module.
19:12:15onionhammerinteresting
19:12:35Varriount|BusyThe problem is both storing things efficiently, *and* allowing extensions...
19:13:25Varriount|BusyFor instance, I plan on storing the parts of a path in a single string, with each part prefixed by an integer. The only problem is, where do I store a drive (when on windows)?
19:15:28def-Varriount|Busy: what about ropes?: http://nim-lang.org/ropes.html
19:16:48Varriount|Busydef-: Ropes are trees. Part of my goal is to *minimize* references.
19:16:53def-alright
19:17:01onionhammerhm nim or nimlime isnt happy with spaces in path on windows
19:17:03onionhammer:)
19:17:10onionhammerduring build
19:17:50onionhammerVarriount /c/Path/On/Windows ?
19:20:34flaviuAre ropes really effective at improving performance compared to giant char vectors?
19:21:02Varriount|Busyflaviu: Ropes are good for many large strings.
19:21:44Varriount|Busyflaviu: They can help save space. It's one of the tme vs space tradeoffs
19:21:47Varriount|Busy*time
19:23:22*bjz quit (Read error: Connection reset by peer)
19:24:43*tgkokk quit (Ping timeout: 255 seconds)
19:28:29*gsingh93 joined #nim
19:29:35BlaXpiritlol so i just installed nim on Windows and it can't compile anything
19:29:48BlaXpirit.eval echo "ok" # not even this
19:29:48Varriount|BusyBlaXpirit: How, and did you install a compiler?
19:29:53MimbusBlaXpirit: ok
19:30:38*tgkokk joined #nim
19:30:57BlaXpiritI downloaded Windows installer 32bit and installed on Windows 7 64bit virtual machine. I had MinGW installed apparently but also checked to install MinGW in Nim installer
19:31:24Varriount|BusyBlaXpirit: And what happens when you try to compile something?
19:31:28BlaXpiritC:\Nim\lib/nimbase.h:385:13: error: size of array 'assert_numbits' is negative typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof (NI)*8 ? 1 : -1];
19:31:43Varriount|BusyBlaXpirit: That means it's still picking up your previous compiler.
19:32:06*bjz joined #nim
19:32:10BlaXpiritVarriount|Busy, I don't think there was anything wrong with that compiler
19:32:13Varriount|BusyThe 'add to path' option *appends* to your path
19:32:37Varriount|BusyBlaXpirit: That error occurs when the bit-ness of the Nim executable and the bit-ness of the C compiler don't match.
19:32:45BlaXpiritbut I think it's 32bit
19:33:02Varriount|Busy" I had MinGW installed apparently but also checked to install MinGW in Nim installer"
19:33:25BlaXpiritI only install 32 bit things
19:33:33BlaXpiritalthough who knows..
19:33:50Varriount|BusyBlaXpirit: Please check.
19:33:58BlaXpiritwish I knew how
19:34:21BlaXpiritI see mingw32 everywhere
19:36:01Varriount|BusyBlaXpirit: That doesn't necessarily mean anything. The 64 bit version of Mingw32 has a similar folder layout to the 32 bit version
19:36:38Varriount|BusyBlaXpirit: What does 'gcc --version' print out?
19:37:00BlaXpiritI did a SET PATH=C:\Nim\dist\mingw\bin;%PATH% and it works now. thanks.
19:37:39BlaXpirithm interesting, Varriount|Busy
19:37:54BlaXpiritI didn't even have that old compiler in PATH, that special Nim shortcut seems to add it
19:38:00*tgkokk left #nim ("Textual IRC Client: www.textualapp.com")
19:38:10Varriount|BusyBlaXpirit: Huh? What old compiler?
19:38:20BlaXpiritthe old mingw that i had installed
19:38:26Varriount|BusyHm...
19:38:55Varriount|BusyBlaXpirit: The shortcut leads to a batch file. Could you gist the contents of it please?
19:38:57BlaXpiriti never added it to PATH but when i start Nim command line shortcut, it initializes the session by prepending that external mingw to the beginning of PATH and its own is near the end
19:39:57BlaXpirithttps://bpaste.net/show/a162a51233a7
19:41:04BlaXpiritwhen i start my normal cmd, mingw32-gcc does not exist
19:41:25BlaXpiritwhen i use this batch file/shortcut, it is mingw32-gcc (GCC) 4.8.1
19:41:31Varriount|BusyBlaXpirit: Um, I don't see where it's prepending the external mingw?
19:41:40BlaXpiritVarriount|Busy, that surprised me too
19:42:57BlaXpiritno, I'm misinterpreting something
19:43:35BlaXpiritvery sorry for the confusion
19:43:49*flaviu quit (Read error: Connection reset by peer)
19:43:50BlaXpiritI actually have gcc (rev5, Built by MinGW-W64 project) 4.8.1
19:44:01BlaXpiritand it is present in PATH
19:44:19BlaXpiritshould've just checked everything
19:45:10*flaviu joined #nim
19:45:19BlaXpiritbut that still doesn't explain why it doesn't prefer its own GCC
19:45:54BlaXpiritah because I change directory
19:46:02BlaXpiritNIMRODPATH=. duh
19:46:11BlaXpiritthat shouldn't be the way it is
19:46:18Varriount|BusyHrm, your right.
19:46:38*Varriount|Busy makes another note of what to when he gets home
19:46:46BlaXpiritthx
19:50:33BlaXpiritcool stuff. nim-csfml works on Windows!
19:52:39BlaXpiritdidnt even have to mess with compilers or anything, CSFML dll binary download works
19:52:49BlaXpiritnot on Linux, though
19:52:59Varriount|BusyBlaXpirit: Make sure to test with a mingw64 compiler
19:53:17BlaXpiritVarriount|Busy, why?
19:53:33Varriount|BusyBlaXpirit: Platform differences
19:53:46BlaXpiritI will notbut i have 64 bit on linux anyway
19:55:32BlaXpirityeah, i should've installed 64bit first, then uninstalled and left 32bit permanently
19:55:44BlaXpiritdon't want to redo it twice though
19:58:21Varriount|BusyBlaXpirit: You know, you could fix the compiler script, and then send it to me.
19:58:40Varriount|BusySince it's going to take me about half an hour to get home
19:59:58*BlaXpirit quit (Read error: Connection reset by peer)
20:00:17*Varriount|Busy quit (Quit: Page closed)
20:00:48*BlaXpirit joined #nim
20:01:31*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
20:02:10BlaXpiritVarriount, I have no idea what to fix
20:04:19BlaXpiritI mean, `SET NIMRODPATH=D%` is an OK fix as long as you make sure current directory path is set correctly in the shortcut
20:04:27BlaXpiritI mean, `SET NIMRODPATH=%CD%` is an OK fix as long as you make sure
20:04:35BlaXpirit%C apparently is something
20:09:54*superfunc quit (Ping timeout: 250 seconds)
20:16:51*flaviu quit (Remote host closed the connection)
20:17:08*flaviu joined #nim
20:18:08*flaviu quit (Remote host closed the connection)
20:18:22MyMindhttps://twitter.com/macromates/status/552134978692472832
20:18:23*flaviu joined #nim
20:22:12*hasenj joined #nim
20:24:24*bjz quit (Ping timeout: 244 seconds)
20:41:16*flaviu quit (Remote host closed the connection)
20:41:30*flaviu joined #nim
20:41:59*flaviu quit (Remote host closed the connection)
20:42:18*flaviu joined #nim
20:49:12*hasenj quit (Quit: hasenj)
20:49:19onionhammerhttp://forum.nimrod-lang.org/t/721
20:51:29*nande joined #nim
20:51:45*Mat4 joined #nim
20:51:51Mat4hello
20:53:51flaviuWhy does https://github.com/nim-lang/nits exist?
20:54:19BlaXpiritD:
20:54:25flaviuAlso, a redirect for http://nim-lang.org/nimrodc.html would be good.
20:56:01flaviuhttps://github.com/nim-lang/nimble/blob/master/developers.markdown makes no mention of tests.
20:56:13flaviuWhat is the recommended directory structure for that?
21:09:44*gour quit (Remote host closed the connection)
21:10:22*jpoirier joined #nim
21:12:07*matkuki joined #nim
21:12:48ekarlso-flaviu: u wanna look at the packages thing again ? :p
21:13:07ekarlso-i'm gonna push a patch for the license thingie
21:13:07flaviuekarlso-: Sure, let me pull
21:13:39ekarlso-flaviu: lemme push first :p
21:13:41ekarlso-will notify u
21:20:09matkukiHow do you convert a C pointer to a static string to something that can be used with "echo"?
21:20:34matkukiI trying to pring the OpenGL version using glGetString(GL_VERSION)
21:20:45matkukisorry, print
21:21:25EXetoCcast to cstring?
21:22:04EXetoCand then it will be converted to string by echo
21:22:13EXetoCwhich calls $ implicitly
21:22:50matkukiGives me "SIGSEGV: Illegal storage access."?
21:23:20matkukiAlso tried "cast[ptr cstring]"
21:23:25BlaXpiritis there some C parser for nim that gives AST of C?
21:23:53repaxmatkuki, are you sure that the pointer is non nil?
21:24:17repaxand can you read its content as, say an int?
21:25:10EXetoCmatkuki: does it return nil?
21:25:25EXetoCit might
21:25:27matkukijust a sec...
21:26:09repaxBlaXpirit, have you looked at clang?
21:26:14BlaXpiritno
21:26:16EXetoCbut the proc should then raise an GL error, unless something else is going on
21:26:20repaxsorry, didn't see the nim part
21:26:36BlaXpiritwhat does c2nim use
21:26:37matkukiEXetoC: If I use "== nil" it returns false
21:27:24BlaXpiritrolls with its own..
21:27:32BlaXpiritmatkuki, give code pls
21:27:58repaxmatkuki, echo cast[int](versionString[])
21:28:14EXetoC?
21:28:25Mat4is someone here interested in cross compilation for Parallax Propeller MCU's ?
21:28:37matkukiI'm using the nim-lang/opengl library.
21:28:42matkukiThe code is var tmp :cstring; tmp = cast[cstring](glGetString(GL_VERSION)); echo(tmp)
21:30:35def-matkuki: https://www.opengl.org/wiki/FAQ#What_is_an_OpenGL_context_and_why_do_you_need_a_window_to_do_GL_rendering.3F
21:30:48EXetoCit didn't return nil though
21:31:57*Amrykid joined #nim
21:32:00repaxpossible reasons: 1) the address can't be read at all by the process. 2) it's not null-terminated
21:32:32BlaXpiritsomething is wrong again :(
21:32:33EXetoCyou could print the first 20 chars or something, one by one
21:32:38BlaXpirit$ nimble install c2nim
21:32:52BlaXpiritnim not found
21:33:00BlaXpirit(Looking for nim (>= 0.10.2))
21:34:53BlaXpiritany ideas?
21:35:17BlaXpiritnim -v 0.10.3
21:35:43BlaXpiritah damn, i probably have old nimble
21:36:56BlaXpiritnow it says c2nim.nim(11, 33) Error: cannot open 'llstream'
21:37:37matkukirepax: also tried "glGetString(GL_SHADING_LANGUAGE_VERSION​)" and "glGetString(GL_VENDOR​)", same error.
21:37:49BlaXpiritmatkuki, give code pls
21:38:00BlaXpiritwhy are you making it hard for everyone?
21:38:33BlaXpiritoh, you gave 1 line
21:38:36EXetoCyou compared the output of glGetString to nil directly? though it shouldn't matter
21:38:43matkukihttp://pastebin.com/3e3eASRa
21:38:46BlaXpiritbut I want a complete example so i can try and tweak
21:38:52EXetoCBlaXpirit: that problem has remained for some time
21:38:58BlaXpirit:(
21:39:04EXetoCbecause the compiler is not being included in the installation
21:39:14matkukino sorry wait...
21:39:29EXetoCit is indeed easier to just add the bin dir to the path
21:39:55BlaXpiritEXetoC, ?
21:39:59BlaXpiritwhich path
21:40:07BlaXpiritthe normal one?
21:40:14matkukihttp://pastebin.com/hw8t3ChR
21:40:17matkukiline 132
21:40:46EXetoCBlaXpirit: yes. that would be the simplest "installation"
21:40:48EXetoCfor now
21:40:58BlaXpiritah
21:41:07BlaXpiriti thought maybe i could fool nimble with PATH somehow
21:41:09BlaXpiritok thx
21:41:10EXetoCbut maybe you can copy the compiler dir to that lib dir
21:41:30EXetoCand I could update the build script if it then works
21:42:02*Amrykid quit (Changing host)
21:42:02*Amrykid joined #nim
21:42:12EXetoCI think it would be best if it was /usr/lib/nim/lib though, in that case
21:42:23BlaXpiritokay, matkuki, i can run it and get sigsegv. will look.
21:42:41matkukiBlaXpirit: Great, thanks!
21:44:22BlaXpiritglGetString(GL_SHADING_LANGUAGE_VERSION) returns 61
21:44:23BlaXpiritokay
21:44:42BlaXpiritwrapper is broken, matkuki
21:44:46BlaXpiritvery very broken
21:44:55BlaXpiritopengl.nim
21:44:56BlaXpiritproc glGetString(name: GLenum): GLubyte
21:45:10BlaXpiritactually is ptr GLubyte
21:45:19EXetoCcrap
21:45:32BlaXpiritEXetoC, who writes wrappers like that, srsly
21:45:38EXetoCme?
21:45:54BlaXpiriti thought my wrapper was not ready
21:46:08BlaXpiritnow i think otherwise :p
21:46:14matkukiI noticed that. I'm not that good at Nim yet, I thought the conversion was implicit or something.
21:46:29EXetoCit would be very confusing
21:46:50flaviuBlaXpirit: Yes, your wrapper is excellent!
21:46:57flaviuMost are nothing more than c2nim output.
21:47:17Mat4what's the status of c2nim (and where can I found it) ?
21:47:58BlaXpiritMat4, you can find it in google. 2nd search result https://github.com/nim-lang/c2nim
21:48:06BlaXpiritwait
21:48:09BlaXpirityou mean "status"?
21:48:42BlaXpiritwell it's definitely not gonna translate C code, it's mostly just for headers, and not perfect even at that, last time i've tried
21:49:14renesac|awaythere is some improvment ideas on GSOC 2014 proposal
21:49:21renesac|awayfor c2nim
21:49:27*renesac|away is now known as renesac
21:50:56BlaXpiritflaviu, i wish someone would use it xD
21:51:13Mat4I need wrapping the standard libraries of the propGCC compiler for using Nim for cross-compilation
21:51:27EXetoCsome things were fixed the last couple of months
21:51:57matkukiBlaXpirit, EXetoC: yup, with adding "ptr" to the glGetString return type it works.
21:52:02EXetoCthe biggest issue I had was the unsupported ##, and multiline macros
21:52:32Mat4ok, I will how well the sources are converted
21:53:03BlaXpiritMat4, it will not convert sources well
21:53:09BlaXpiritonly C header (.h) files
21:53:49BlaXpiritEXetoC, do you think I could take advantage of clex, cparse somehow?
21:54:15BlaXpiritbecause i don't understand it at all :|
21:55:32EXetoCno idea
21:56:07*johnsoft quit (Ping timeout: 245 seconds)
21:56:44ekarlso-any people here good at webdesign ? :)
21:57:20*johnsoft joined #nim
22:01:40EXetoCI'm alright at developing functional websites
22:02:11EXetoCbut I've never bothered to learn how to do fancy stuff with css since it's so quirky
22:02:27matkukiEXetoC: Should I open an issue on github for glGetString?
22:03:17ldleworkEXetoC: amen
22:03:17EXetoCsure
22:03:21EXetoCmy wrapper generator must be broken. I hope I can find it again
22:03:41EXetoCbut I'll have to look at what else is broken
22:04:27matkukiI'm going to be playing with opengl for a while, will report if I find anything else.
22:05:55flaviuI can't say I'm good at CSS, but things typically turn out at least reasonable-looking.
22:05:55BlaXpiriti should try to pair some of this with sfml :3
22:06:46BlaXpiritI'm so tempted to just steal an OpenGL piece of code from somewhere, but the licenses, those damn licenses
22:07:08BlaXpiritthere is a lot of code under MIT, but can I publish it in my repo under zlib license?
22:07:09EXetoCno one will notice :>
22:08:45flaviuIs there some way to disable `Info: instantiation from here`?
22:09:05BlaXpiritwhy
22:09:15ldleworkEXetoC: :P
22:09:40flaviuBlaXpirit: Because it's useless and irritates me.
22:09:50flaviuI suppose grep will suffice :P
22:11:06*Mimbus quit (Read error: No route to host)
22:11:10flaviuAs there looks like there's no way to turn off ProveInit either
22:12:09*flaviu left #nim (#nim)
22:12:12*flaviu joined #nim
22:12:40*Mimbus joined #nim
22:12:50BlaXpiritmatkuki, where did you get that code that you pasted from?
22:13:41BlaXpiritalso, any particular reason why you're using SDL? :p
22:13:49ldleworkIts better.
22:14:01ldleworkPackaged better, for one.
22:14:25matkukiBlaXpirit: a little modified from "nim-lang/sdl2/examples/sdl_opengl_example.nim"
22:14:35BlaXpiritthank you, matkuki
22:17:22matkukiI'm want to make a game. Nim looks and feels great to me. I already have a prototype is Python/SDL2. I kinda like SDL2.
22:18:09dtscodeis nim good for writing games?
22:18:31BlaXpiritdtscode, probably
22:18:42BlaXpiritthat's what I'm expecting to use it for
22:18:49dtscodeinteresting
22:19:21ldleworkmatkuki: I too am using Nim for games
22:19:27BlaXpiritmatkuki, are you going for 3D?
22:19:42*enquora quit (Quit: enquora)
22:20:27dtscodeldlework, can i see an example?
22:20:27matkukiBlaXpirit: not yet, I'm just starting to play with OpenGL. The game will be primarily 2D. For now
22:21:01BlaXpirit"primarily" 2D ?
22:21:58AraqBlaXpirit, Mat4 c2nim does translate function bodies as well
22:22:14repaxI have an sdl2 wrapper with nicer names for procs and types (i.e. no T/P prefixes etc): https://github.com/repax/sdl2
22:22:19matkukiIdlework: Good to know. How far have you come?
22:22:23Araqit's not perfect, but when you know its limitations you can convert thousands of lines easily
22:22:37ldleworkmatkuki: I've cloned Qix and I'm working on a Lights Out! clone with a friend
22:23:00ldleworkmatkuki: I'm working on my own little game library similiar to pygame
22:23:13Araqand I'm making it compile 'template' right now
22:23:38BlaXpiritldlework, sfml..?
22:24:15matkukiIdlework: That's great. Keep it up! I'm currently working out the art direction for the game.
22:24:36Araqrepax: put it on nimble
22:24:51*superfunc|busy joined #nim
22:25:02repaxAraq, I've sent a pull req to dom
22:25:16Araqit's usually merged within a day
22:25:17BlaXpiritI do not see why "sdl2" is in standard library
22:25:38AraqBlaXpirit: graphics.nim uses sdl and is still in the stdlib
22:25:47BlaXpiritgraphics, eh
22:26:05repaxHopefully, most libraries will move over to the new naming convention
22:26:20ldleworkBlaXpirit: no, I'm not impressed with sfml, I use SDL
22:26:31Araqrepax: that's already happening afaict
22:26:46BlaXpiritldlework, what exactly are you not impressed with?
22:26:51ldleworkBlaXpirit: the packaging for one
22:27:02BlaXpiritlol
22:27:08BlaXpiritwhat is wrong with packaging?
22:27:18ldleworkthere is none?
22:27:24BlaXpiritin my experience SDL has been much, much harder to get working
22:27:26ldleworkyou get some folders with the headers and libs in them
22:27:31BlaXpiritwhat do you mean "there is none"
22:27:34ldleworkyou have to install them by hand
22:27:35matkukiBlaXpirit: For now it's just 2D, maybe I'll add a depth of field element or something to it later.
22:27:40BlaXpiritldlework, no..?
22:27:40dtscodeBlaXpirit, i get sdl working pretty easily
22:27:51ldleworkBlaXpirit: point to the debs I can install sfml 2.1
22:28:01ldlework(official debs)
22:28:24BlaXpiritldlework, lol you think everyone is supposed to make official debs for everything?
22:28:43ldleworkBlaXpirit: I'll stick with SDL then
22:28:48BlaXpiritfacepalm
22:29:09BlaXpiritthat's like saying "i'll stick with Windows then"
22:29:16flaviuI'm using fsanitize, and the GC is causing a "stack-buffer-overflow" at lib/system/gc.nim:888
22:29:22ldleworkIf you say so. Notice how I'm unmoved.
22:29:42Araqflaviu: how do you think conservative stack marking works?
22:29:46*dtscode is moved at ldlework's steadfast unmovingness
22:30:00repaxYou all move upwards on my screen
22:30:02BlaXpiritoh look, ldlework https://launchpad.net/~sonkun/+archive/ubuntu/sfml-stable
22:30:10*tane quit (Quit: Verlassend)
22:30:15BlaXpiritseems abandoned though -_-
22:30:30ldleworkBlaXpirit: I don't think I'll be asking my users to install a PPA for a project that can't provide packages
22:30:48BlaXpiritldlework, you can't be serious here
22:30:59ldleworkBlaXpirit: you keep saying that, and yet I keep using SDL
22:31:06Araqldlework: *we* don't provide packages
22:31:14Mat4BlaXpirit: There are similar projects like this out there
22:31:18BlaXpiritwhy do you think a developer is supposed to make packages for every single distro?
22:31:21ldleworkAraq: sure, but we're not even 1.0
22:31:23Mat4(even for C++)
22:31:34ldleworkAraq: and you've asked people to do so
22:31:38ldleworkso we're ahead of the SFML project
22:31:40Araqldlework: in opensource land, few things are
22:31:40ldlework\o/
22:31:52BlaXpiritldlework, look, if your sh**ty distro doesn't have packages, that's nobody else's fault
22:31:54ldleworkAraq: how does it feel to be ahead of the game?
22:32:04ldleworkBlaXpirit: does your OS have packages for SFML 2.1?
22:32:10BlaXpirityes
22:32:16ldleworkneat which OS?
22:32:23BlaXpiritArch Linux
22:32:25ldleworkAnd who maintains them?
22:32:40flaviuldlework:
22:32:41Araqldlework: I don't know the opposite feeling.
22:32:42flaviuSven-Hendrik Haase
22:32:43dtscodearch is really awesome about keeping its repos upto date
22:32:48ldleworkAraq: ;P
22:32:50BlaXpirithttps://www.archlinux.org/packages/community/x86_64/sfml/ Sven-Hendrik Haase
22:32:51dtscodeAraq++
22:33:03dtscodenow if arch could just be more stable :/
22:33:13BlaXpiritsorry for offtopic tho :(
22:33:19flaviudtscode: You just aren't l33t enough ;)
22:33:28ldleworkBlaXpirit: cool! I hope it works well for you.
22:33:47dtscodeflaviu, probably :} i will admit to having lost entire arch installations on my hdd before
22:33:57BlaXpiritldlework, you probably should go back to C++ though, because distros don't have packages for nim
22:33:59dtscodei did use manjaro though
22:34:07ldleworkBlaXpirit: I'm not looking to distribute Nim
22:34:09BlaXpiriti don't know why i said "back"
22:34:19dtscodeBlaXpirit, didnt ubuntu use to have a nimrod compiler package?
22:34:25flaviuBlaXpirit: Relax. He's not required to use your package if he prefers SDL.
22:34:31ldleworkBlaXpirit: hey I have an idea, lets be a complete shitass
22:34:48BlaXpiriti'm just asking for any reason whatsoever why you prefer sdl
22:34:56ldleworkBlaXpirit: and I gave you one
22:35:00ldleworkdid you ask so that you could combat me
22:35:02ldleworkand put me down
22:35:10*saml_ joined #nim
22:35:18ldleworkOr are you literally offended in CFML's place?
22:35:42*saml quit (Ping timeout: 265 seconds)
22:36:47superfunc|busywhy you gotta keep ruffling feathers dude, just chill
22:36:52*adam_s joined #nim
22:37:59ldleworkdtscode: this is a game I'm helping my friend write to help him learn how to use Nim: https://github.com/dustinlacewell/lights-out
22:39:06dtscodeawesome. ty
22:39:14ldleworkI don't remember where we left off, or if it is in a working state
22:43:51flaviuIs there a way to convert an exception to a string?
22:44:18flaviuNot getStackTrace, but to the same format that gets printed
22:45:05*vendethiel joined #nim
22:45:38flaviuauxWriteStackTrace isn't exposed anywhere :/
22:46:54*tinAndi joined #nim
22:48:45*superfunc|busy quit (Ping timeout: 265 seconds)
22:49:04Araqflaviu: when I expose all the good stuff that is internally used people complain about the shitty API design :P
22:49:27flaviuWell, I guess `auxWriteStackTrace` isn't a good thing to expose.
22:49:39Araqsee newException. was some internal helper, people wanted it badly
22:49:53Araqgot exported and now we have better means and confused users
22:50:04flaviubut something like `$`(ref Exception) that returns the exception name, message, and stacktrace as a single string.
22:50:22BlaXpiritthe main concern is bloating system module
22:50:31BlaXpiritpeople won't complain about separate modules
22:51:00AraqBlaXpirit: ldlework does just that.
22:51:11flaviuBlaXpirit: Exceptions are already part of system.nim, and `$` is just omitted functionality IMO.
22:51:26BlaXpiritwell exceptions should be part of system
22:51:35BlaXpiritthat's for sure
22:51:59BlaXpiritbut defining `$` for exceptions in any particular way is not good
22:52:23ldleworkWell I don't complain that system.nim is too bloated
22:52:27flaviuBlaXpirit: The way that the compiler outputs it on the console is the correct way to define `$`
22:52:44ldleworkI just think that we could mitigate those who do thing it is bloated by refactoring everything to depend on the preamble rather than system.nim
22:52:54ldleworkwe can then break up system.nim into more focused modules
22:53:08BlaXpiritflaviu, I'd rather just see exception message and optionally type
22:53:08ldleworkand not have to import basic string and sequence mainipulations
22:53:56Araqldlework: that's however even this way for scripting langs: import os, os.path, re, sys
22:54:18Araqis my typical first python line
22:54:24ldleworkI don't think those things should be in this preample
22:54:28ldleworknote you don't do
22:54:47ldlework"import basic_string_features" "import things_that_make_sequences_minimally_useful"
22:55:12flaviuldlework: Try out numpy
22:55:21flaviuthat's what you end up doing
22:55:24EXetoCmatkuki: only glGetString and glGetStringi have similar signatures in gl.xml, so let's hope those are the only mistakes
22:55:25ldleworkflaviu: numpy isn't a language
22:55:40EXetoCmatkuki: you could edit it directly via github if you want to, otherwise I'll fix it
22:55:44ldleworkflaviu: numpy is a library for a specific collection of domains
22:55:49ldleworkodd analogy
22:55:59ldleworkThis is a threshold question
22:56:04ldleworkWe already have things in system.nim
22:56:09ldleworkand we already have shit in stdlib
22:56:11matkukiEXetoC: I already opened an issue.
22:56:34ldleworkso there's already a line, I think our line is just *so ever slightly* crossed into the inconvenient zone
22:56:57ldleworkEspecially compared with default functionality in things like Python, or even modern system languages
22:57:02EXetoCmatkuki: I don't see how that makes any difference, but I'm looking into it
22:57:40ldleworkThere's only a handful of things I'd move from sequtils and strutils into core, but there is the bloated argument, so my response is lets refactor the core.
22:57:50*Matthias247 quit (Read error: Connection reset by peer)
22:58:22BlaXpiritPython probably would have more things imported by default, by an order of magnitude, if we actually considered how many methods every built in type has
22:58:33BlaXpiritbut it's not a problem because documentation is logically separated
22:58:44Mat4I think splitting the system module is advantageous. Possible in different levels of system support
22:58:57ldleworkhttps://docs.python.org/2/library/stdtypes.html#string-methods
22:59:17ldleworkWhile Python's string type does have about 2 dozen methods, they are all hardcore fundamental operations you want to do on strings
22:59:24ldleworkAnd Python has a 'strutils' module too
22:59:43BlaXpiritno..?
23:00:08ldleworkThere are a couple I'd take off of Python's string type if I was redesigning PYthon in order to make this argument
23:00:16ldleworkbut only like 3 or 4 that seem like anachronisms
23:00:33ldleworkBlaXpirit: no..? what?
23:00:34*BillsPC quit (Remote host closed the connection)
23:00:35*dtscode quit (Quit: ZNC - http://znc.in)
23:01:02*dts|pokeball joined #nim
23:01:31BlaXpiritI don't know any such "strutils" module, and there is no other module that is like nim's strutils
23:01:50ldleworkhttps://docs.python.org/2/library/string.html
23:01:58ldleworkBlaXpirit: better disagree before you're sure
23:02:14BlaXpiritjust look at that module and what it defines -_-
23:02:31BlaXpiritI wasn't wrong, in any case
23:02:31AraqMat4: splitting system.nim has been tried at least twice now. it's harder than it looks and at the end of the day doesn't help much. but ymmv
23:02:34ldleworkStuff that doesn't belong on the type?
23:02:59EXetoCmatkuki: done
23:02:59BlaXpiritldlework, it just defines string constants!
23:03:07ldleworkBlaXpirit: and... several other things
23:03:09ldleworkgod you are lazy
23:03:19ldleworkplease stop participating in public debate until you can have a better attitude
23:03:23ldleworkseriously
23:03:39BlaXpiritwhat other things are there that are not available without importing it?
23:03:51ldleworkcapwords?
23:03:52BlaXpiritjust Template, it seems
23:03:54ldleworkformatting?
23:04:04BlaXpiritformatting is available as a method of str
23:04:09ldleworkall of the deprecated functionality ives there
23:04:22ldleworkBlaXpirit: string.Formatter
23:04:31matkukiEXetoC: Great, thanks.
23:04:37ldleworkBlaXpirit: this is what happens when you take a fundamentalist position, just to argue
23:04:41ldleworkwhat the fuck is your actual position?
23:05:58matkukiEXetoC: By the way, when you say edit directly via github, what do I need to do? I'm haven't used github that much.
23:06:27ldleworkEXetoC: when looking at files on github, there is usually an edit button nearby
23:06:47*superfunc joined #nim
23:07:02EXetoC*matkuki
23:07:10ldleworkright, sorry :)
23:09:11matkukiI don't see the button. I see only "Raw", "Blame", "History" and a few others.
23:09:30ldleworkmatkuki: are you a contributor to the repo?
23:09:50ldleworkmatkuki: its the little pencil icon
23:11:18EXetoCnot everyone knows what a pencil is anymore
23:11:28ldleworkhehe
23:11:58matkukiIdlework: Oh I see. Sorry, I'm new to this. Got it for next time!
23:13:30*saml_ quit (Read error: Connection reset by peer)
23:25:21*saltylicorice joined #nim
23:26:51Araqhi saltylicorice welcome
23:28:29*z1y joined #nim
23:28:59*repax quit (Quit: repax)
23:32:05*z1y quit (Client Quit)
23:36:57*dts|pokeball quit (Quit: Leaving)
23:37:50MyMindI tried to compile aporia on os x and got:
23:37:52MyMindCustomStatusBar.nim(41, 24) Error: undeclared identifier: 'False'
23:37:54MyMindFAILURE: Execution failed with exit code 256
23:38:11EXetoCmatkuki: do you know about the automatic error checking?
23:38:18*dtscode joined #nim
23:38:21EXetoCfor the opengl interface
23:38:23AraqMyMind: used aporia from github?
23:38:32MyMindnimble install aporia
23:38:35*dtscode quit (Remote host closed the connection)
23:38:38Araqshould be fixed since a few weeks
23:38:48matkukiEXetoC: No, how does it work?
23:38:58*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0/20141125180439])
23:39:02Araqmaybe nimble doesn't use the latest commit but some "official stable" commit?
23:39:14*dtscode joined #nim
23:39:15*saltylicorice quit (Ping timeout: 256 seconds)
23:39:24flaviuMyMind: nimble install aporia@#head
23:39:24MyMindmaybe
23:41:18MyMindflaviu: that command doesn't work on zsh it does on bash
23:41:25EXetoCmatkuki: you call a gl function and don't think more about it
23:41:33def-MyMind: "aporia@#head"
23:41:42EXetoCit's actually a massive wrapper, created with the help of a macro
23:41:43flaviuMyMind: ZSH does something special with # iirc, just escape it.
23:42:14MyMindaporia installed succesfully
23:43:12MyMindcould not load: libpango-1.0.dylib
23:43:48matkukiEXetoC: the "wrapErrorChecking" macro?
23:43:53EXetoCmatkuki: yes
23:44:11matkukiI'm just now looking at the code.
23:44:27EXetoCI could've just done it without a macro since I was generating from the spec, but where's the fun in that?
23:44:43Mat4have someone tried compiling Nim with Visual C ?
23:45:02matkukiEXetoC: :)
23:45:05AraqMat4: iirc Demos at least does that regularly
23:46:45Araqand I'll do it in a few days too
23:47:35flaviuIs there a way to get the exception name other then casting?
23:48:27Araqflaviu: dunno, why is that so important? you cannot do much with the name
23:48:47*dtscode quit (Quit: ZNC - http://znc.in)
23:49:07flaviuAraq: unittest.nim's exception handling is inadequate. It's best to give as much information as possible to the user.
23:49:29*dtscode joined #nim
23:49:51Araqflaviu: unittest itself is inadequate
23:50:04flaviuYeah, but at least it can give me a stack trace.
23:50:23Araqif brokenCode: writeStackTrace()
23:50:27ldlework:(
23:50:42Araqeverything can give you a stacktrace, it's a simple call
23:50:59flaviuI still don't like it, but ok.
23:51:23ldleworkDon't stack traces usually include what went wrong?
23:51:38ldleworkNot just "someone called writeStackTrace from here --->"
23:51:57Araqldlework: getStackTrace(someException) then
23:52:14ldleworkAraq: ah okay
23:52:28*johnsoft quit (Ping timeout: 255 seconds)
23:53:14*johnsoft joined #nim
23:55:12*adam_s left #nim ("Leaving")
23:58:18flaviuNice commit: https://github.com/flaviut/Nim/commit/7f02174ded35fc39f93657fbceb2a3dcd3885304 :P
23:58:41flaviuI have no idea what happened there