<< 19-05-2015 >>

00:00:01Araqflaviu: oh yeah. you're right
00:00:03dom96dtscode: yay, I like questions.
00:00:06vikatonbecause I probably have the least amount of programming experience here
00:00:27dom96flaviu: oh yeah! That is exciting.
00:00:27dtscodeWhat resources did you use when you went to implement the async* libs?
00:00:40dom96flaviu: We should make that into a proper github feature request
00:00:46Araqthe _ syntax is something we should copy
00:00:56Araqcan we then remove the => ?
00:01:00flaviudom96: Like https://github.com/Araq/Nim/issues/2179?
00:01:07dtscodeWe have => syntax?
00:01:10dtscodeD:
00:01:16dtscode2c#4me
00:01:17dom96dtscode: msdn, posix docs, googling "async winapi" "async posix" mostly.
00:01:17Araqdtscode: in future.nim
00:01:28dtscodedom96: Thanks.
00:01:35Araqdom96: you also read a couple of articles
00:01:43dtscodeAraq: Ah... yeah I would never go in there
00:01:58dom96Araq: oh dear. Were you watching me?
00:02:08def-I think that's the first time I've seen someone looking for a Nim developer: http://www.guru.com/jobs/mobile-library-for-nim-lang/1128547
00:02:09flaviuSometimes you want to label your params, like `(a, b) => (b + a) * a`
00:02:10dom96Araq: Also, we can never remove =>
00:02:11Araqdude, we're the same person
00:02:56dom96def-: damn, is this for real?
00:03:19def-dom96: looks like it, but never heard of that website before
00:03:46Araqdef-: can you write the FAQ destroying the petty "nil checks missing" argument?
00:04:15dom96def-: seems a bit odd though
00:04:23def-Araq: I don't have much knowledge for either side of the argument and didn't bother to read into it because it's not very relevant for me personally
00:04:40flaviuThe budget on that listing is low for something that's supposed to work with both ios and android.
00:04:41def-so better not
00:04:57dom96def-: kind of vague, and Nim isn't exactly the obvious language to use for iOS and Android dev.
00:05:07dom96and what flaviu said
00:05:59dtscodeWhy wouldn't nim work well with android/IOS?
00:06:15flaviudtscode: That person wants both, from the same codebase.
00:06:32dtscodeWell thats just stupid
00:06:57flaviuYep, and IOS/android is really close to uncharted territory for Nim anyway.
00:07:08dtscodeActually, you know what would be great? One standard format for apps. An app-protocol as it were
00:07:15Araqno it's cool and works.
00:07:20flaviudtscode: Like webapps?
00:07:26dtscodeflaviu: Phone apps
00:07:35Araqit's called ... er ... cannot remember
00:07:49flaviudtscode: So a webview to a webapp published in an app store?
00:07:57Araqbut it's based on Mono and a commercial product
00:08:02Araqand it works
00:08:16flaviuXamarin?
00:08:20dtscodeflaviu: I guess that would work. I'm more referring to the meta of it
00:08:29Araqflaviu: yeah
00:08:41def-at least nim + sdl2 seems perfectly fine for android, didn't try iOS
00:09:04dtscodesdl works on android too?
00:09:09flaviuHave people seen https://h2o.github.io/?
00:09:10dtscodeOr has it always?
00:09:13dtscodeYes
00:09:18flaviuIt got posted on reddit today, seems neat enough.
00:09:29def-dtscode: You've seen my post? http://hookrace.net/blog/porting-nes-go-nim/
00:09:44dtscodedef-: I have not. Thanks :D
00:10:02dtscodeAt some point in the future I was going to write an emulator in Nim. Maybe a gameboy one.
00:10:10def-dtscode: dom96 is writing one already
00:10:11flaviuAn MIT web server supporting tls, http2? yes please.
00:10:17dtscodedef-: I know.
00:10:23def-dtscode: I know because i wanted to write one too and then went for NES instead
00:10:47dtscodeI wouldn't mind doing NES. I just want to do Gameboy because I will actually use that
00:11:03dtscodeflaviu: Ah is that why its so good? Because its MIT?
00:12:06flaviudtscode: Yes, permissive license, excellent performance, http2. All I need to do now is see how horrible the C api is ;)
00:12:18dtscode:D
00:12:46dtscodeLook at me talking when theres Nimbus2 work to do
00:16:04dom96def-: dtscode: might take a while for me to finish mine
00:16:27dtscodedef-: Lets tie him up with nim issues until we finish ours
00:16:43vikatoncan I delete the folder the nim tarball created in my root folder now?
00:16:46def-dtscode: I'm not going to write another emulator
00:16:49vikatonnow that its exported or nahh?
00:16:54def-vikaton: nope, keep it!
00:17:04vikatonawe :(
00:17:05dtscodeThats where the stdlib is isn't it?
00:17:10def-vikaton: the binary and stdlib is in there, you need it
00:17:11vikatonyeah
00:17:23vikatoncould I cp it to PATH ?
00:17:25def-vikaton: by exporting it you just tell your shell where to find the nim binary
00:17:42def-no, you would also have install the standard library, there's an install.sh script for that
00:17:54vikatonok
00:18:11dtscodeYou know... depending on how often coopernurse rebuilds his docker image, we technically don't have to build nim anymore
00:18:12def-but it's better to add the nim-bin path to PATH instead of installing it
00:18:16dtscodejust run the docker image
00:20:38*gsingh93 joined #nim
00:21:31vikatonahh shoot
00:21:47vikatoncodeanywhere.com doesnt have Nim support in their text editors :(
00:26:32*vendethiel joined #nim
00:26:44def-vikaton: ekarlso was working on something like that for Nim, not sure what happened to it
00:27:01vikatonfor codeanywhere?
00:27:13def-ah wait, I thought codeanywhere is something else, oops
00:27:20vikatonlol
00:27:44flaviuHas anyone figured out a functioning implementation of python's "enumerate"?
00:28:08def-flaviu: pairs?
00:28:49flaviudef-: I have an iterator, not a type.
00:29:04flaviuI need a `iterator enumerate[T](iter: iterator(): T): tuple[i: int, val: T]`.
00:30:54def-flaviu: probably a template if you want it to work with inline iterators
00:31:53vikatonuhhh
00:32:11dtscodeDamn it I got distracted again
00:32:12vikatonCC: yup
00:32:12vikatonError: unhandled exception: The system cannot find the file specified
00:32:12vikaton [OSError]
00:32:23vikatonWhat file? :S
00:32:31flaviuvikaton: Your C compiler.
00:32:37flaviuDo you have gcc/clang installed?
00:32:49vikatonoh damn
00:32:51vikaton!
00:33:33vikatonI dont have MinW installed
00:33:41dtscodeYou're on windows?
00:34:17vikatonYeah
00:34:52flaviuvikaton: I thought you mentioned a bashrc?
00:35:10vikatonflaviu: thats my linux vps
00:35:16vikaton: ]
00:35:41vikatonI switched over to Windows since codeanywhere didnt have Nim support for syntax
00:37:50*ir2ivps10 quit (K-Lined)
00:38:31vikatonWhats a valid indentation ?
00:42:11vikatonnvm
00:45:51*gsingh93 quit (Ping timeout: 276 seconds)
00:47:45*vendethiel quit (Ping timeout: 240 seconds)
01:06:26dtscodeWhich call would be more expensive? startsWith on a string of no more than 10 characters or split an arbitrary string on ' '?
01:08:41renesacsplit, you have to do memory allocation, copy, etc
01:09:22renesacand parse the whole string
01:11:36dtscodeYeah I figured.
01:11:41dtscodeDamn. Oh well
01:13:34flaviudtscode: Also, that whole "premature optimization" thing. You're writing an IRC bot, a few extra nanoseconds are nothing compared to the network.
01:13:48dtscodeflaviu: Its not nanoseconds this time
01:14:35dtscodeAlthough, it might be just calling the docker image takes a bit of time, but I'm working on it
01:15:39renesacstring joining is usually much more a performance problem than spliting, because it is easy to program a algorithm with quadratic time complexity
01:19:05*brson quit (Quit: leaving)
01:19:36*brson joined #nim
01:38:06*brson quit (Quit: leaving)
01:38:18*brson joined #nim
01:44:49*Fernandos quit (Quit:  ➾ EXIT ⌨)
01:49:42*brson quit (Quit: leaving)
01:53:14vikatondo you guys think Nim will be adopted in the market post 1.0 and afterwards?
01:54:21filwityes
01:56:17vikatonNice
02:11:15*dtscode quit (Ping timeout: 264 seconds)
02:15:29*darkf joined #nim
02:21:34*notfowl quit (Excess Flood)
02:22:28*notfowl joined #nim
02:25:35*johnsoft quit (Ping timeout: 256 seconds)
02:26:17*johnsoft joined #nim
02:56:17*dddddd quit (Ping timeout: 244 seconds)
03:30:23*pregressive quit (Remote host closed the connection)
03:30:38*pregressive joined #nim
03:34:49*Perelandric quit (Ping timeout: 246 seconds)
03:35:01*notfowl quit (Excess Flood)
03:35:28*notfowl joined #nim
03:40:16*notfowl quit (Excess Flood)
03:41:28*notfowl joined #nim
03:43:09*saml_ quit (Ping timeout: 245 seconds)
03:44:19*endragor joined #nim
03:55:07*intra quit (Ping timeout: 256 seconds)
03:57:14*Jesin quit (Quit: Leaving)
04:07:04*milosn quit (Read error: Connection reset by peer)
04:07:08*milosn_ joined #nim
04:08:25*BlaXpirit joined #nim
04:08:45*notfowl quit (Excess Flood)
04:21:40*TEttinger joined #nim
04:25:58*notfowl joined #nim
04:26:52*notfowl quit (Excess Flood)
04:29:28*notfowl joined #nim
04:31:34*ddl_smurf quit (Quit: ddl_smurf)
04:34:00*pregressive quit (Remote host closed the connection)
04:41:01*BlaXpirit quit (Quit: Quit Konversation)
04:46:07*vendethiel joined #nim
04:52:25*Varriount_ joined #nim
04:55:07*Varriount quit (Ping timeout: 244 seconds)
05:04:02*milosn_ is now known as milosn
05:10:00*yglukhov________ joined #nim
05:12:52*yglukhov________ quit (Client Quit)
05:13:31*vikaton quit (Quit: Connection closed for inactivity)
05:27:34*yglukhov________ joined #nim
05:33:32*yglukhov________ quit (Quit: Be back later ...)
05:55:23*jackv joined #nim
06:00:55*vendethiel quit (Ping timeout: 256 seconds)
06:16:08*solidsnack joined #nim
06:16:10*solidsnack left #nim ("Textual IRC Client: www.textualapp.com")
06:16:31*solidsnack joined #nim
06:22:18*strcmp1 quit (Ping timeout: 256 seconds)
06:24:39*ingsoc joined #nim
06:25:39*vendethiel joined #nim
06:26:38*strcmp1 joined #nim
06:43:15*yglukhov________ joined #nim
06:48:31*vendethiel quit (Ping timeout: 256 seconds)
06:50:01*gokr joined #nim
06:58:38*Ven joined #nim
06:59:37*kokozedman joined #nim
07:08:05*Ven quit (Read error: No route to host)
07:08:35*endragor_ joined #nim
07:11:45*endragor quit (Ping timeout: 256 seconds)
07:12:44*strcmp1 quit (Ping timeout: 245 seconds)
07:21:21*strcmp1 joined #nim
07:26:05*vendethiel joined #nim
07:38:17*bjz joined #nim
07:41:58*Ven joined #nim
07:49:57*vendethiel quit (Ping timeout: 265 seconds)
07:59:47*ddl_smurf joined #nim
08:01:18*OnO joined #nim
08:03:57*coffeepot joined #nim
08:05:54*Trustable joined #nim
08:11:14*solidsna_ joined #nim
08:11:23*solidsnack quit (Read error: Connection reset by peer)
08:15:18*endragor_ quit (Remote host closed the connection)
08:15:47*endragor joined #nim
08:19:49*ddl_smurf quit (Quit: ddl_smurf)
08:20:44*solidsna_ quit (Ping timeout: 256 seconds)
08:25:28*yglukhov________ quit (Ping timeout: 255 seconds)
08:26:04*yglukhov________ joined #nim
08:28:04*dt__ joined #nim
08:29:35*dt__ left #nim (#nim)
08:42:42*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:43:01*bjz joined #nim
08:51:52*wb joined #nim
08:59:52*ddl_smurf joined #nim
09:05:42*TEttinger quit (Ping timeout: 276 seconds)
09:07:32*NemeXis joined #nim
09:07:39*NemeXis left #nim (#nim)
09:13:30*IronY joined #nim
09:18:43*polde quit (Read error: Connection reset by peer)
09:20:35IronYso
09:20:38IronYLol
09:20:45IronYWhat would one build in nim
09:20:50IronYwhats it primary niche?
09:21:03*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:21:52*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:22:27*polde joined #nim
09:23:27*bjz joined #nim
09:23:29coffeepotI'm only a neophyte so someone else might be able to answer better, but it's a systems language with high level syntax, so everything from kernels and games to web and scripting
09:23:41IronYyeah was looking at the git hub trending
09:23:51IronYnes emulator written in nim compiled to js
09:24:03IronYthats purty neat
09:25:51coffeepotI came to Nim because it's statically typed and compiled, but is more like python in it's high level approach.
09:26:10coffeepotalso yeah compiling to javascript is nice
09:28:56coffeepotnim focuses on efficiency and expression with a clean syntax, so for me that is it's niche.
09:31:47IronYno thats fair enough
09:32:05IronYlearning now
09:32:14IronYcompiler and nimble installed
09:32:26coffeepotit's one of the most enjoyable languages I've ever used tbh :)
09:32:43IronYwhat did you do has a starter get to know the language project
09:32:46ekarlsotoo bad it doesn't get more attention :p
09:33:41IronYYou need a flashy website and a podcast series for that ekarlso
09:33:59IronYand you have to throw out words, like elegant, and expressive
09:34:14coffeepotI started by writing a game that is gradually growing, but atm am trying write a higher level wrapper for sql server
09:34:50IronY'metaprogramming'
09:35:07IronYthe founder introduces it as ' a programming language he made in his spare time, because he can '
09:35:15IronYthats something i can get behind lol
09:35:22filwit:)
09:35:43filwitwe'
09:35:46filwitwhoops...
09:36:23coffeepotimo it's fair enough to use "elegant, expressive and efficient" when describing nim, as despite sounding 'buzzwordy' it really describes the takeaway experience from using it
09:37:01Araqcoffeepot: wow that's really nice. thank you. :-)
09:37:46AraqIronY: I'm preparing lots of material for oscon, which answers more of these questions. i hope.
09:37:51coffeepotAraq you're welcome, thanks for sticking to your principles and generating something that's made me love programming again!
09:38:00IronYAraq, is this you in the video I am watching
09:38:05IronYhttp://www.infoq.com/presentations/nimrod
09:38:10Araqyes
09:38:19IronYThis is why I live irc. well done sir, well done
09:39:31IronYlive = love that is
09:39:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:42:47*TEttinger joined #nim
09:55:48*bjz joined #nim
10:03:25*boopisaway is now known as boop
10:08:16*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:10:18*bjz joined #nim
10:15:55*bjz quit (Ping timeout: 256 seconds)
10:36:51*vendethiel joined #nim
10:41:22kokozedmanIronY, from Madagascar here, building router applications with Nim... and best of all: it works, and efficient, and simple and expressive, and everything in between
10:41:48kokozedmanOpenWrt platform based on uClibc
10:41:59IronYvery very nice
10:42:09IronYclosed source?
10:42:37kokozedmanyes, closed unfortunately for the time being
10:45:26IronYhow the hell does this compile down to javascript
10:45:30IronYlike in the sense of the nes emulator
10:46:01IronYI just dont get how u get a low level static typed langauge to a javascript canvas
10:48:14def-IronY: Looked at the article? http://hookrace.net/blog/porting-nes-go-nim/
10:48:51IronYLOL
10:48:59IronYwell that was exactly what I was looking for
10:49:06*bjz joined #nim
10:52:13flaviuIronY: Keep in mind the NEW emulator uses emscripten
10:52:30*BlaXpirit joined #nim
10:52:39flaviuNim also has it's own JS backend, but it's still experimental
10:54:10*vikaton joined #nim
10:57:12def-emscripten works pretty great, except Nim's GC doesn't seem to work (yet)
10:58:43synthmeatso, how would something like js2nim (like c2nim) work with either emscripten or some native js backend?
10:59:15synthmeatc2nim is quite useful tool
11:00:48synthmeator, better question maybe - how would you use external js libraries in nim, with emscripten/native js backend?
11:01:17def-you can use importc as with the C backend
11:01:24*tmku quit (Ping timeout: 276 seconds)
11:01:47def-synthmeat: see here for example: http://hookrace.net/blog/what-is-special-about-nim/#compile-to-javascript
11:02:00*vendethiel quit (Ping timeout: 272 seconds)
11:04:05synthmeatbut no any sort of automatic wrapper?
11:05:19coffeepotI'm thinking of writing an API server for some functions at work that'll serve up JSON. Is Jester suitable for this or would I be better off just using httpserver?
11:06:42coffeepotI like the Jester way of doing things but wondering if it might be a bit of overkill for a simple server
11:07:16coffeepotalso am thinking it's more orientated towards html and pages
11:07:49*tmku joined #nim
11:10:22def-synthmeat: haven't seen any js2nim
11:10:27*vendethiel joined #nim
11:10:47def-I think the JS backend still needs some love to work well
11:12:20*TEttinger quit (Quit: Leaving)
11:12:33synthmeatdef-: any particulary glaring things that emscripten misses?
11:28:52*endragor_ joined #nim
11:29:04*endragor quit (Read error: Connection reset by peer)
11:32:54*vendethiel quit (Ping timeout: 272 seconds)
11:35:15*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:35:42*dddddd joined #nim
11:48:45*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
11:49:11def-synthmeat: I only noticed the GC, but haven't experimented much
11:50:53*Ven joined #nim
12:00:07*vendethiel joined #nim
12:01:54*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:06:42*Kingsquee quit (Quit: Konversation terminated!)
12:09:45*banister joined #nim
12:13:03*Ven joined #nim
12:17:44*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:21:21*BitPuffin|osx quit (Ping timeout: 276 seconds)
12:24:11*TEttinger joined #nim
12:24:58*vendethiel quit (Ping timeout: 272 seconds)
12:36:34*milosn quit (Quit: leaving)
12:39:03Araqmore opinions please: https://github.com/Araq/Nim/pull/2700
12:42:35TEttingerI think california's almond farmers should be taxed for their heavy water usage
12:42:40TEttingerwrong kind of opinion?
12:52:13Araqheavy water is delicious
12:55:25Araqbut also expensive
12:55:29synthmeatyeah, ```toUTF8()``` and ```validateUtf8()``` within the same file looks funky
12:55:53Araqso they shouldn't pay a tax
12:56:06synthmeati just assumed nim-way is to uppercase only the start of the word, even if it's an acronym
12:56:30strcmp1Araq, all governments should eliminate taxes and fund themselves through state-owned businesses :p
12:56:35Araqsynthmeat: yeah I added this rule to our style guide
12:57:53*boop is now known as boopisaway
12:58:24synthmeatsweet
13:08:23*vendethiel joined #nim
13:08:50*intra joined #nim
13:22:32*derkirche joined #nim
13:22:36*derkirche left #nim (#nim)
13:40:14*phira quit (Ping timeout: 245 seconds)
13:45:28*phira joined #nim
13:45:29*phira quit (Excess Flood)
13:45:58*phira joined #nim
13:46:00*phira quit (Excess Flood)
13:46:27*phira joined #nim
13:46:30*phira quit (Excess Flood)
13:46:57*phira joined #nim
13:46:58*darkf_ joined #nim
13:46:58*darkf quit (Disconnected by services)
13:47:00*phira quit (Excess Flood)
13:47:05*darkf_ is now known as darkf
13:47:26*phira joined #nim
13:47:29*phira quit (Excess Flood)
13:48:01*phira joined #nim
13:48:03*phira quit (Excess Flood)
13:48:27*phira joined #nim
13:52:47*BitPuffin joined #nim
13:59:32*gsingh93 joined #nim
14:00:28*pregressive joined #nim
14:00:28*pregressive quit (Client Quit)
14:01:16*pregressive joined #nim
14:05:41*Strikecarl joined #nim
14:25:04vikatonNim doesnt have % ?
14:25:08vikatonits only mod?
14:26:22def-vikaton: right, similar to add/&&, or/||, etc
14:26:59def-There is %% for unsigned modulo: http://nim-lang.org/docs/system.html#%%,IntMax32,IntMax32
14:27:26*endragor_ quit (Ping timeout: 276 seconds)
14:27:31vikatonIs it possible to alias mod for % ?
14:28:27def-template `%`(x, y): expr = x mod y
14:37:36vikatonoh niiice
14:38:23vikatonare templates expensive?
14:38:58coffeepotafaik templates are just advanced inlining?
14:39:40*yglukhov________ is now known as yglukhov
14:40:15*yglukhov quit (Quit: Lingo: www.lingoirc.com)
14:40:30*vendethiel quit (Ping timeout: 272 seconds)
14:40:35*yglukhov joined #nim
14:40:56Araqvikaton: no runtime overhead, it's just a macro
14:41:39coffeepotmore info http://nim-lang.org/docs/manual.html#templates
14:43:48coffeepot(so, not just advanced inlining ;) )
14:44:11def-In this case it simply replaces any invocation of `%` with mod at compile time, that's all
14:45:06*OnO joined #nim
14:49:46*OnO quit (Client Quit)
14:50:42vikatonCoool
14:52:00*darkf quit (Quit: Leaving)
14:53:37vikatonequivalent of "(0..1000).select { |x| (x % 3 == 0) || (x % 5 == 0) }.sum" in Nim?
14:53:47vikaton.select is kind of like.filter in Rust
14:55:37def-vikaton: you want a functional version or imperative?
14:56:03vikatonBoth would be nice, though I'll go with functional
14:56:09vikatonJust Funtional actually
14:58:39*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
15:00:10def-vikaton: https://gist.github.com/def-/dd15da453001af9ce7a1
15:00:57vikatonthanks def-
15:01:03def-the imperative is much more performant, no heap/GC allocations etc
15:01:38def-if my iterutils started working again they would work instead of sequtils as well
15:02:15vikatonI thought NIm had '|'
15:02:35def-what's that?
15:02:54vikatonLike in python, I or C++'s II
15:02:57vikaton||*
15:03:02vikaton|*
15:03:07def-nope, just "or"
15:03:26def-ah, you can use | at type level
15:03:44def-if your proc accepts "int8 or uint8" you can also write "int8 | uint8"
15:05:26vikatondef, if I use templates on your example like template `|`(x, y): expr = x or y
15:05:45vikatonI would get a type mismatch error of (bool, intliteral) etc
15:06:02def-yes, you would have to write (XXX) | (YYY) i assume
15:06:06def-with brackets
15:06:11vikatono
15:06:33def-I would recommend to get used to Nim's or/and/mod instead
15:07:10vikatonhmm
15:07:34vikatonAraq, have you ever told Github to chnage Nimrod to NIm ?
15:08:19federico3vikaton: yes
15:08:34def-vikaton: They can't rename it for internal reasons, but it will eventually be fixed: https://github.com/github/linguist/pull/1936
15:09:11Araqvikaton: I'm pretty sure I didn't. but others did.
15:10:29vikatonah Ok
15:11:01*yglukhov quit (Ping timeout: 258 seconds)
15:17:02def-vikaton: oh, and you can write the functions the other way around in Nim: https://gist.github.com/def-/dd15da453001af9ce7a1#file-foo-nim-L13
15:18:18vikatonoh nicee
15:19:42*milosn joined #nim
15:19:54coffeepotalso you don't need to use brackets as def- shows, so you can write: echo "stuff", "stuff".echo or echo("stuff)
15:20:23coffeepotabsolutely love this feature of Nim
15:20:48*drewsrem joined #nim
15:21:08*the9to5 joined #nim
15:21:46def-coffeepot: actually that's one of the common criticisms of Nim, but I agree that it's nice when you use it to increase readability
15:22:33coffeepotyeah I see it criticised by every comment I've seen personally are "I haven't used Nim but this puts me off".
15:22:37drewsremI'm trying to get a simple async-example working where two async-procs simultaneously output characters to stdout (one faster, one slower), however, it seems that it's not working. Maybe if someone would be so kind and have a quick look: http://ix.io/iEF
15:22:58coffeepotin practice once you know about UCS it all flows, for me at least
15:24:13def-drewsrem: what's the expected output and what does it do?
15:25:02drewsremdef-, basically the async part of main should output .........#.........#
15:25:28drewsremInstead it outputs: .#.#.#.#.#.#.#.# ...
15:26:02drewsremi.e. the async-proc that writes . sleepAsync's shorter then the one for # but they both seem to wait for the same time
15:27:04drewsremSo it seems that both procs run simultaneously, but they sleepAsync for the same time, tho one is written to sleep 1/10 of the other
15:29:14drewsremWhen I let them sleepAsync for much longer it seems to work. - Almost seems that it's impossible to sleepAsync below a whole second?
15:30:42dom96try using while true: pool(1) instead of runForever()
15:30:45dom96drewsrem: ^
15:30:57dom96s/pool/poll/
15:31:04dom96The default timeout for poll is 500ms
15:31:21drewsremThat outputs ".#" and then stops
15:32:36drewsremah
15:32:37drewsremsorry
15:32:39drewsremI've misread
15:33:08dom96you shouldn't discard futures btw
15:35:15dom96also, fast_fill_async and slow_fill_async won't run until fast_fill and slow_fill are finished.
15:35:37dom96async does not create multiple threads
15:35:56def-while true: poll(1) looks good
15:36:23coffeepotis async timeslicing?
15:36:31drewsremdom96, right I just intended to notice the different rates at which they output
15:36:56drewsremdom96, thanks, that worked perfectly
15:37:04dom96Good :)
15:37:10drewsremWhy shouldn't I discard futures?
15:37:30def-drewsrem: http://nim-lang.org/docs/asyncdispatch.html#asyncdispatch-discarding-futures
15:37:46drewsremdef-, thanks, should've read more carefully
15:41:15drewsremOn a related note, I tried to create a short template that would shorthand writing "await sleepAsync" expecting something like C-macros but got bit because "await" apparently only works in async-pragma procs?: http://ix.io/iEK
15:41:40drewsremI guess I'd have to look into macros?
15:43:40Araqasync is a rather heavy transformation, no idea how you think you can 'await' to work without it
15:44:54drewsremAraq, my goal was to just abbreviate having to write "await sleepAsync" everytime with something shorthand
15:45:21drewsremWas just curious tho, it's not an actual issue
15:45:30Araqah, the old "async" needs to be able to see the 'await' problem
15:45:56dom96drewsrem: I would suggest creating a proc for that. Something like proc slp(time: int): Future[void] = sleepAsync(time)
15:45:56dom96, you will still need to write the 'await' though.
15:45:57Araqyeah we'll get rid of that one. eventually.
15:46:18dom96or you can write 'yield' instead of 'await' in your template, but that's hackish.
15:46:38dom96Async templates here we come :P
15:46:39drewsremthanks for the response, the codebase is so small, I might just sed-replace it for now
15:52:32*Arrrrrr joined #nim
15:55:12*polde quit (Ping timeout: 276 seconds)
15:57:50*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:06:56*Perelandric joined #nim
16:09:06*vendethiel joined #nim
16:20:51vikatonThere's something weird with Nim's http server example
16:21:00vikatonit only reads
16:21:39vikatonhow Can I change it so?
16:21:49*fizzbooze joined #nim
16:28:02ArrrrrrWhat do you mean by "it only reads", reads what
16:33:12*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:33:39vikatonfor example
16:33:43vikatonhere lemme gist
16:35:47*nimster joined #nim
16:38:02vikatonArrrrrr: https://gist.github.com/Vikaton/d11d27d98a7090336256
16:38:59ArrrrrrIt sould return hello world you mean
16:39:20vikatonit does in the browser
16:39:50vikatonbut wrk doesnt function properly with it, like it does with any other language
16:39:55*boopisaway is now known as boop
16:47:48drewsremIs it possible to read the value of the Future in the Futures callback anon-proc ?
16:48:26drewsremAh, it clearly is
16:49:34*fizzbooze quit (Ping timeout: 272 seconds)
16:56:42vikatonany solution?
16:56:49*vendethiel quit (Ping timeout: 258 seconds)
16:56:50def-vikaton: works with the asynchttpserver
16:57:03def-http://nim-lang.org/docs/asynchttpserver.html
16:57:52def-Or at least I thought so
16:58:10def-but not sure why the old httpserver is broken
16:58:53*vendethiel joined #nim
17:00:10vikatonWell it works
17:00:53vikatonnim asynchttpserver performs the same as Crystal, and beats Rust's Hyper in hello world micro benchmark
17:01:03vikatonfyi, nothing meaningfull as always
17:01:13*ingsoc1 joined #nim
17:01:19def-Not meaningful, but good to hear: https://github.com/def-/nim-http-speedup
17:01:30*gsingh93_ joined #nim
17:02:53*ingsoc quit (Ping timeout: 265 seconds)
17:04:45*leru joined #nim
17:05:21def-ok, the problem is that httpserver implements http 1.1 wrongly and doesn't keep the connection alive
17:05:56*leru quit (Client Quit)
17:06:01ekarlsovikaton: Crystal ?
17:06:03*leru joined #nim
17:06:03*nimster quit (Quit: Page closed)
17:06:21ldleworkThe language everyone is jumping the Nim ship for.
17:06:23vikatonekarlso: http://crystal-lang.org
17:06:53vikatonldlework: Are you sure? I think many people use both of them as the same time
17:06:59vikatonthose who use both anyway
17:07:12ldleworkjust trolling
17:07:23ldleworktoo tired to see it through
17:08:12def-in the httpserver.nim there are some comments about "# XXX we ignore "HTTP/1.1" etc. for now here"
17:08:16def-I guess that's the culprit
17:12:25*yglukhov_ joined #nim
17:14:55vikatonWhats the difference between templates and macros in Nim?
17:16:34*strcmp1 quit (Quit: Leaving)
17:17:09ldleworkvikaton: templates are lexical, macros are procs that take and return AST.
17:17:32ldleworkYou can implement any template as a macro.
17:17:41ldleworkBut you do all the work yourself.
17:18:11vikatonI see
17:21:29*vendethiel quit (Ping timeout: 256 seconds)
17:27:00*ingsoc1 quit (Quit: Leaving.)
17:27:08*ingsoc joined #nim
17:30:05*strcmp1 joined #nim
17:30:24*vendethiel joined #nim
17:55:08*OnO joined #nim
18:01:13*brson joined #nim
18:01:29*kokozedman_ joined #nim
18:04:27*kokozedman quit (Ping timeout: 250 seconds)
18:05:57*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
18:07:06*OnO joined #nim
18:09:59*BitPuffin quit (Ping timeout: 246 seconds)
18:31:53*Jesin joined #nim
18:40:22*skyfex____ joined #nim
18:41:36*brson_ joined #nim
18:42:25*brson quit (Ping timeout: 264 seconds)
18:42:56*skyfex___ quit (Ping timeout: 265 seconds)
18:44:02*brson_ quit (Client Quit)
18:44:16*brson joined #nim
18:56:57*Jesin quit (Ping timeout: 265 seconds)
19:11:13*xender left #nim ("WeeChat 1.0")
19:26:17*ChrisMAN quit (Remote host closed the connection)
19:26:36*Jesin joined #nim
19:40:27*ChrisMAN joined #nim
19:41:47*Arrrrrr quit (Quit: Page closed)
19:50:44*ingsoc1 joined #nim
19:50:54kokozedman_How again do I create a TThread that takes no argument? TThread[] is invalid
19:51:16*ingsoc quit (Ping timeout: 255 seconds)
19:54:34Araqkokozedman_: TThread[void]
19:54:54kokozedman_Araq, thanks
19:55:38kokozedman_Araq, by the way, about the thread channel, has it been overhauled yet? last time I was told it needed some update for performance
19:57:08Araqno, but I did some tests and on my machine thread+channel is on par with 'spawn' with all its compiler magic
19:57:23Araqso it's not that bad
19:59:17*BlaXpirit quit (Remote host closed the connection)
20:01:08*gsingh93 quit (Ping timeout: 256 seconds)
20:01:09*gsingh93_ is now known as gsingh93
20:01:11*BlaXpirit joined #nim
20:19:02*xender joined #nim
20:19:36xenderDoes Nim have namespaces?
20:20:02xenderIf so, is it possible to disable automatic namespace polluting on import?
20:20:08def-xender: every module is in its namespace
20:20:16def-yes, use from module import nil
20:20:31ldleworkWhat does that do
20:20:40xenderIn Python, to pollute my namespace, I have to do "from foo import *" instead of "import foo". In C++, i have to explicitely write "using namespace bar".
20:20:54Araqin Nim you write from foo import nil
20:21:05xenderdef-, Araq: Oh, okay... That seems strange, but if it's the only way...
20:21:07def-xender: in Nim the opposite is the default, but you're not forced to use it
20:21:16ldleworkDoes that make ufcs a bit strange?
20:21:25xenderHm, why is it really the default?
20:21:27ldlework(or impossible?)
20:21:29def-ldlework: indeed, operators also don't really work then
20:21:36xenderIt looks like a regression to C cavemen times
20:21:41*ldlework hugs Nim
20:21:58Varriount_Araq: "I won't use my dictatorship superpowers, so vote away"
20:22:03*Varriount_ is now known as Varriount
20:22:15*leru quit (Quit: Nettalk6 - www.ntalk.de)
20:22:16Araqxender: use from foo import nil. you'll eventually learn why it's stupid and not the default.
20:22:54Araqbut for now: BE AFRAID.
20:22:59ldleworkxender: 'methods' are not really methods in Nim. When you import T you get none of the functions that work with T.
20:23:17ldleworkxender: so if you have to go through the module namespace, you can't do T.foo()
20:23:30ldleworkYou'd have to do, M.foo(T)
20:23:32ldleworkor whatever
20:23:48ldleworkI guess, 't' to indicate an instance of T
20:23:51def-and even if you just do "import strutils", you can still use strutils.toLower
20:24:06xenderldlework: Ouch. So, Nim looked like a nice language for me, but that design flaw seems to completely undermine that position :(
20:24:09ldleworkYou'll just clobber any other toLower
20:24:15dom96That is a pity.
20:24:26ldleworkxender: I too wrestle with swallowing it.
20:24:33dom96Perhaps it's time to discuss introducing 'use module' to be equivalent to 'from module import nil'
20:24:36ldleworkBut not quite enough to undermine my interest.
20:24:40dom96but with the added bonus that it works with UFCS
20:25:03ldleworkdom96: its that last part that is the source of all the trouble isn't it?
20:25:07dom96then everyone will be happy, right?
20:25:17ldleworkIf the last part wasn't a problem, I don't think xender would have a problem typing "from foo import nil"
20:25:38dom96I think that typing 'from foo import nil' would still become annoying.
20:25:42def-dom96: no, then they will want the colon after if/for removed, tabs instead of spaces, full case-sensitivity, etc
20:25:52ldleworkdom96: Sure but the actual limitation is ufcs/divorced methods
20:26:06ldleworkhow you import just a module name is aesthetics
20:26:20Araqxender: please don't listen to #nim. try the language out anyway.
20:26:37ldleworkAraq: no one asked him otherwise
20:26:42dom96def-: People already want those things.
20:26:43Araqcontrary to what people seem to believe 'from foo import nil' does exist and works
20:26:53xenderldlework: Well, I was looking for a language that will allow me to write code that is 1. clean 2. portable. And as for cleanness, Nim looks worse than Python for me, but being compilable to JS beats it. But those namespaces are too much for me.
20:27:02ldleworkAraq: except now operators and ufcs is broken?
20:27:07xenderAraq: What about methods then?
20:27:12Araqldlework: why is it broken?
20:27:24Araqyou want explicit module.foo syntax, you get it.
20:27:31ldleworkAraq: from foo import nil; var t = foo.T();
20:27:35ldleworkHow do I call a method on t?
20:27:38ldleworkusing ufcs?
20:27:49dom96xender: Nothing stops you from writing module.foo instead of foo everywhere.
20:27:50Araqyou cannot but why it that a problem?
20:27:57ldleworkAraq: seriously, be real.
20:28:03xenderldlework++
20:28:05AraqI'm real.
20:28:09ldleworkNo one discouraged him from using the language.
20:28:13ldleworkYet you act like we did.
20:28:14*kokozedman_ quit (Ping timeout: 246 seconds)
20:28:32ldleworkAnd now you're pretending that a feature of your languae doesn't break when you use another feature of the language.
20:28:47xenderHm, can nazi namespace chacking be performed with some preprocessing layer?
20:29:06dom96Nazi? Let's not start calling things that please.
20:29:12Araqldlework: it's not broken.
20:29:21Araqit does what you asked it to do.
20:29:23ldleworkAraq: "ceases to work in the same way as if you didn't use the other feature"
20:29:45ldleworkC# would be sad.
20:29:47dom96Araq: I think ldlework wants something that is not quite as strict.
20:29:57Araqif you want module.foo, how is writing module.foo "broken"?
20:30:02ldleworkNo, I just don't want us to lie to people about Nim's limitations.
20:30:03dom96Araq: Something in between import foo and from foo import nil.
20:30:09def-dom96: i think that sounds like a reasonable compromise
20:30:12ldleworkPeople invest actual time, of their finite lives.
20:30:31ldleworkI don't care that it works the way it currently does. Like I said this problem doesn't entirely undermine my enjoyment of Nim.
20:30:47ldleworkIt just makes it have a corner that can never be rounded.
20:30:49dom96def-: no ufcs when using 'from foo import nil'?
20:31:02xenderYeah, I was thinking about making a game in Nim, but if that means I have to write unclean code, I'd be better going back to my modular origami...
20:31:18def-dom96: no, that method call syntax still works with a "use module"
20:31:34dom96def-: ahh, so you think my idea has some merit?
20:31:40def-right
20:31:45ldleworkIf you can make it work with "use module" then it doesn't matter what syntax you slap over it.
20:31:50dom96Cool. Time for an RFC then.
20:32:00ldleworkI thought the underlying problem is technically challenging?
20:32:04def-xender: how do you have to write unclean code? I'd say it's just not enforced that you write clean code (depending on your definition of clean)
20:32:24ldleworkdef-: I think he means inconsistent
20:32:44ldleworkufcs in any module not doing a nil import, namespace referencing in those that do
20:32:47dom96ldlework: In that case Araq will have an excuse to refuse the RFC.
20:32:51ldleworkAnd having to remember this
20:33:05ldleworkdom96: oh I thought the technically difficulty was already established in previous discussions, sorry
20:33:09ldleworktechnical*
20:33:21dom96ldlework: Perhaps it was. I was most likely missing during them.
20:33:23ldleworkI might be misconstruing fixpoint iteration during compilation
20:33:32xenderdef-: Okay, you're right, it's more a matter of not being enforced to write clean code. But i want such an enforcement when it comes to namespacing, unless I explicitely tell that I want to have a symbol from other namespace imported directly into current one.
20:33:51ldleworkxender: that is kind of the point of namespacing amirite?
20:34:16ldleworkxender: your ide will solve this problem
20:34:30dom96xender: would you still use Nim if you knew that there was an option not to enforce namespacing?
20:34:31xenderldlework: I don't use and IDE.
20:34:45dom96xender: but if there was also the opposite option (what I am proposing with 'use module')?
20:34:46*yglukhov_ quit (Quit: Be back later ...)
20:37:34flaviudom96: I think that there are actual important problems that need to be solved.
20:37:41*Matthias247 joined #nim
20:38:02dom96flaviu: I agree.
20:38:17dom96flaviu: Which is why Araq shouldn't implement this.
20:38:22xenderdom96: I've not really started using Nim for real, but being both high-level compilable to JS is enchanting. What I want is an option to enable a namespacing mode when top-level identifiers must be qualified unless explicitely from...imported, but "methods" (UFCS as ldlework calls it) work as they should.
20:38:26dom96flaviu: If somebody wants this badly enough they can implement this.
20:38:50xenderdom96: I don't mind an option to disable namespacing, I just wouldn't be using such an option.
20:39:02flaviuxender: Like D does it?
20:39:06dom96I know that sounds harsh, and I apologise, but Araq has been awesome at implementing many of people's wishes over the past few years.
20:39:50dom96It's unfair that there are bugs which prevent people who actually are using Nim *right now* from putting Nim in production.
20:40:27*yglukhov_ joined #nim
20:40:34def-and this isn't the first time this feature has been asked for
20:41:21ldleworkxender: I come from Python and wanted to use Nim for game programming as well. The biggest hurdle I had to overcome was the inability to have different types in different modules, refer to each other.
20:41:45dom96There are far too many cases of people coming in here, asking for a feature, Araq finally implementing the feature they asked for and then they simply disappear.
20:41:45ldleworkxender: so if you use a parent<->child relationship at all, in your design sensibilities, then you'll likely run into this limitation
20:42:09synthmeathey, um, how about we that want to game dev with nim pool up? there's like 3 different glfw wrappers already :D
20:42:16ldleworkxender: it can be overcome by moving types into the same module, but its annoying if you're super organized like I am. But again, not a reason to give up Nim entirely.
20:42:42Araqldlework: plus I showed you an acceptable workaround.
20:42:50ldleworkAraq: types.nim?
20:42:57Araqno. a real one.
20:43:02ldleworkThat seemed mostly acceptable, though gross to people I show it to
20:43:09ldleworkOh, I must have forgotten
20:43:16xenderflaviu: I'm not familiar with how D does it...
20:43:31Araqtype Forwarded = object of Foo
20:43:43Araqtype Useit = object x: ref Forwarded
20:43:50Araq# later in some other module:
20:44:02Araqtype RealOne = object of Forwarded
20:44:14flaviuxender: Neither am I, but my rough understanding is that they use different rules for symbol lookup in UFCS and standard calls.
20:44:30ldlework:3
20:44:41Araqyou need an object conversion then due to the subtyping
20:44:44dom96xender: Well then let's write an RFC on Github asking for this feature. Araq can then officially state his opinions on it, if he likes it then that's great, somebody can implement it.
20:44:54xenderldlework: You mean that you if you want to have circular dependency of symbols in type definitions, you have to define both types in one block, right?
20:44:55Araqbut that's a 1 line accessor
20:44:57ldleworkAraq: I think types.nim is a bit easier to reason about.
20:45:01ldleworkxender: yeah
20:45:28ldleworkxender: the way I deal with it, is I put literally all the types of my program into a single module, but put their methods and such in separate modules.
20:45:40ldleworkI then use a compiler flag to import types.nim implicitly everywhere
20:45:43xenderldlework: Hm, I think that maybe generics could help to work around it. And coming from Python, you should be already familiar with duck-typing, which is similar to generics.
20:45:46ldleworkThis problem mostly goes away then.
20:45:50ldleworkxender: it doesn't.
20:46:04xenderldlework: It won't work even with generics?
20:46:14Araqldlework: generics are a workaround too
20:46:24ldleworkThe problem is that using generics everywhere you need a single type is *more ugly* than any of the workarounds.
20:46:34ldleworkIt breaks the actual abstractions in the software you're trying to define and represent.
20:46:38ldleworkCan't say I would ever do that.
20:47:05Araqyou can also hide the type completely in a closure, depending on the concrete usage
20:47:19ldleworkYou have a bunch of code (IE, the generic types) that don't actually sovle anything related to the problem your software is trying to solve
20:47:25ldleworkJust work around limitations of the language you're using
20:47:26xenderldlework: Yeah, you're right, but on the other hand, duck-typing in Python works in similar way, but because it's implicit, it doesn't stand out that much and doesn't look ugly.
20:48:03ldleworkAt least the types.nim way, the language is actually getting out of the way by the time you're writing *your* code.
20:48:14*ldlework shrugs.
20:49:12*yglukhov_ quit (Quit: Be back later ...)
20:49:17ldleworkActually
20:49:23ldleworkInstead of fixed point iteration
20:49:32ldleworkWhy not just have the compiler scoop up all my defined types
20:49:47ldleworkAnd then compile/parse/whatever them as if they were in a single block in some implicit types.nim
20:49:56ldleworkAnd then effect them across my code the same way the flag does
20:50:02ldleworktada?
20:50:19Araqldlework: works when you ignore the fact that macros can generate types
20:50:22ldleworkMaybe the dollar tag on this feature goes down?
20:50:24ldleworkfuck.
20:50:32ldleworkAraq: hehe ok
20:51:06Araqbut it does work
20:51:09ldleworkI guess in that case, you still have all types available in all modules.
20:51:13Araqand is an acceptable tradeoff
20:51:14ldleworkBut that's a very tiny price to pay I guess
20:51:35ldleworkIt *would* allow me to reuse all the design experience from Python
20:51:47ldleworkAnd not introduce a third or fourth type where I'm used to just having a recursive relation.
20:51:54Araqin fact, I like the idea and will sleep over it
20:52:09*ldlework notices hair on his arm standing straight.
20:53:06Araq"yeah we fucked up that part of the language when it comes to macro interactions, but most langs have no macros, so there."
20:53:12ldleworkhaha
20:53:42ldleworkMaybe a pragma for type generating macros :3
20:53:59ldleworkOr maybe the compiler should be able to detect macros that produce type definitions or some insane shit
20:54:08ldleworkbut maybe less "hard" than doing fixedpoint iteration
20:54:43ldleworkI guess when it comes to macros detection of anything is a fool's errand.
20:55:31ldleworkAraq: the macro consequence is verrrrrrrrry tiny
20:55:47ldleworkAnd when do you care about recursive relationships across macros for /compiletime generated types/ anyway?
20:55:55ldleworkacross modules*
20:56:05Araqwell almost right.
20:56:16Araqthere is the famous 'class' macro ;-)
20:56:24ldleworkhmm yeah
20:56:27ldleworkouchies.
20:56:35ldlework"welll alll my types are defined using macros!"
20:56:46ldleworkI could see myself saying this in a few months
20:57:35ldleworkxender: you should at least now see Nim as intellectually interesting enough that you shouldn't leave so hastily :)
20:58:27xenderldlework: I got lost halfway through above discussion :P
20:58:33*the9to5 quit ()
20:58:43ldleworkxender: I only pretend to know what I'm talking about.
20:59:00xenderldlework: I like going intelectual only when it makes sense to do so. :P
21:00:16xenderldlework: You know, you can have long and interesting discussion about everything, but they can be pointless anyway. :P
21:04:11synthmeatseriously though, let's make a game framework
21:04:24synthmeatget something up for LD in august
21:04:31vikatonwuts LD
21:04:37synthmeatludum dare
21:04:58vikatono
21:06:24ldleworksynthmeat: if you wanna collaborate on a Nim LD I might be interested
21:06:24ldleworkMaybe we can get notfowl on board too
21:06:24synthmeati have a name and registered channel :P
21:06:24dom96I can get on board too
21:06:24dom96Love LD
21:06:25synthmeat"geronimo" was #2 choice, but loved "denim"
21:06:41synthmeatcurrently, def-'s there, and i just finished tutorial, part 1
21:06:43synthmeattwice :D
21:07:06vikatonxender: if you want to propose a Language chnage, submit an issue :P
21:07:08vikatonchnage*
21:07:18vikatons/chnage/change
21:07:20Araqhttps://wiki.haskell.org/Import just fyi.
21:07:21vikaton:[
21:07:39synthmeatlurk in #denim if ya wanna, we'll get something up by next LD
21:07:41AraqHaskell does it like Nim, and I've yet to read that Haskell is a regression to C times.
21:07:47def-all i did so far was make nim-glfw statically compile the GLFW library so you don't need to have it installed
21:07:47flaviuhttps://github.com/Araq/Nim/pull/2762
21:08:10dom96synthmeat: If I'm honest I prefer geronimo
21:08:15dom96mostly because Doctor Who.
21:08:25def-Araq: Haskell also has significant whitespace and still people always complain about Nim having it
21:08:38synthmeatdom96: yeah, me too, but there's apache project called geronimo, so uneccesary confusion
21:09:10dom96synthmeat: Is this what you are planning on calling the LD game?
21:09:22synthmeatdom96: no, some "high" level game framework
21:09:29ldlework'nimple' was the name of the game lib I'm creating
21:09:36dom96synthmeat: ahh cool
21:09:47dom96synthmeat: denim sounds good for that
21:09:48synthmeati think def- and i are aligned on 2d as focus, for now
21:10:55synthmeatsomeone with opengl chops on board would come in handy
21:11:15dom96Araq: Then again though, Haskell has no UFCS.
21:11:51dom96synthmeat: Are you planning on using just opengl for everything?
21:12:45synthmeatdom96: not sure i understand the question. everything would be opengl (es, or webgl subset of es) hardware accelerated, yes
21:13:06dom96synthmeat: I'm wondering if you will build on top of sdl or sfml.
21:13:30Araqdom96: not sure I see the point. Nim has no UFCS with 'from import' either.
21:13:53dom96Araq: Yeah, and that is the problem.
21:14:11synthmeatdom96: def- suggested sdl2, but with potential of swapping the "backends" for rendering/audio/whatnot. so, in spirit of that, we'd start with glfw for start, since it's lightest to start, and we'd need to make it "swappable" at some later point anyways
21:14:32dom96synthmeat: Sounds good.
21:14:55def-dom96: I think glfw makes sense because you don't need to install any dependencies: Get Nim + Nimble and you can immediately build stuff. SDL2 is heavier, but works on about every platform
21:15:27synthmeatglfw is so super sweet though
21:15:27Araq"Nim has this nice feature, UFCS, but unfortunately it doesn't work with from import. Haskell doesn't even have UFCS to begin with, so it's better."
21:15:27vikatonhow does c2nim work?
21:15:46dom96def-: cool. But won't you still need GLFW to static link it?
21:15:55def-dom96: nope: https://github.com/EXetoC/nim-glfw/blob/master/lib/glfw/wrapper.nim#L12-L52
21:16:19def-I pulled in the glfw source code, similar to nre for pcre and go's glfw wrapper
21:16:21dom96Araq: Yes, but xender/ldlework aren't saying that Haskell is better.
21:16:38dom96def-: oh, I see. Wow.
21:16:41Araqdom96: but you implied it.
21:16:48xenderI have not mentionned Haskell and I don't even know it o_O
21:17:35ldleworkYeah no comparative analysis was made :P
21:17:43dom96Araq: Would it be challenging to implement my proposal?
21:18:03Araqit's the same old "having no legs is an advantage cause then they cannot be broken" argument from you, dom96. I prefer to walk though.
21:19:19Araqdom96: I don't understand your proposal.
21:20:00AraqIn fact, I don't understand any proposal. you all seem to want 'from foo import nothing except this, that and that one over there'
21:20:35Araqand nobody has ever formalized this rule.
21:21:52dom96Araq: https://gist.github.com/dom96/f2b00b31378a65b59842
21:22:35dom96err, small mistake on that last line. Corrected it.
21:23:01ldleworkAraq: lol you're my favorite.... something
21:23:18ldleworkpld maybe :)
21:26:43Araqso ... instead of a.f(b) gettting rewritten to f(a, b) it gets rewritten to module.f(a, b) ?
21:27:28dom96if it's imported via 'use module' then yes.
21:27:42Araqthat's completely different from the "type based" imports that were previously discussed
21:28:02dom96Do you have a formal specification of those?
21:28:09Araqno.
21:31:03Araqdom96: the advantage of your proposal is that's much simpler then the previous ones. the disadvantage is that it doesn't address operators.
21:31:48dom96I think people can live without operators.
21:32:05flaviu:O
21:32:10dom96If they want to use them then they can just import them via from module import `[]`
21:33:24dom96Actually, thinking about it some more, perhaps they should just be imported.
21:33:36dom96The same way that they are when you use 'import module'
21:33:51Araqnah
21:34:19Araqfrom module import operators, ucfs
21:34:34Araqwe need a fancy way of spelling this ofc
21:35:47dom96hrm
21:36:07dom96use module (with operators) vs. from module use nil (no operators)
21:36:24vikatonWhy is Nim called Nim :)
21:37:03Araqfrom module import what_I_like
21:37:03*ingsoc1 quit (Ping timeout: 256 seconds)
21:37:40Araqvikaton: turned out the americans name their idiots after ancient kings
21:38:09xendervikaton: Because of an ancient game. Also, this makes it a PITA to search for Nim gamedev tutorials :>
21:38:27vikatonI see
21:39:18vikatonThats hilarious @ Araq
21:40:10dom96Araq: What do you think about my proposal though?
21:41:39Araqdom96: dunno. it suggests that method call syntax gives some additional namespace protections. but it doesn't.
21:42:41Araqso it's a "feeling good" feature which no connection to reality.
21:42:45Araq*with
21:42:57dom96Perhaps. But on the other hand it would be easy to implement from what I can tell.
21:44:20dom96It might be worth the good feelings.
21:44:25Araqso echo(a, b) is a bad namespace polution, but a.echo(b) is not?
21:46:07flaviu"UnpackNoneError" is a little awkward, anyone have any better ideas?
21:46:34Araqdom96: you're right. it seems rather easy to implement
21:47:16dom96flaviu: OptionEmptyError
21:47:27Araqflaviu: UnpackError
21:47:35dom96Araq's is better.
21:47:52dom96Araq: Yeah. That does seem a little odd.
21:48:01dom96Araq: Something to sleep over perhaps?
21:49:20ekarlsosleep, what's that dom96 :p
21:49:45flaviuHow is `foo[bar]()` parsed? Isn't this an ambiguity in the grammar?
21:49:49dom96ekarlso: Even Araq needs sleep every few months :P
21:51:56Araqflaviu: yes it is. fortunately "grammar ambiguity" is not a well defined problem so you can cheat easily.
21:53:00flaviuAraq: How is it not a well defined problem? two or more parse trees for the same input == grammar ambiguity.
21:53:14flaviuI can definitely see how cheating might work here though.
21:53:15Araqthe parse trees are not well defined.
21:53:22*ingsoc joined #nim
21:53:54Araqyou don't have to distinguish between "generic application" and "array access"
21:54:07Araqfor nim it's just "nkBracketExpr"
21:54:35flaviuAh, I see.
21:54:40*the9to5 joined #nim
21:56:54federico3dom96: the Debian pkg requires a little updating but I'm currently on holidays for a month
21:57:07dom96federico3: oh cool. You're here.
21:57:29dom96federico3: I see. What about those security issues?
21:57:38federico3On and off ;)
22:01:09*pregressive quit (Remote host closed the connection)
22:05:35*Trustable quit (Remote host closed the connection)
22:05:39*milosn quit (Quit: Reconnecting)
22:05:48*milosn joined #nim
22:06:30*gsingh93_ joined #nim
22:10:27dom96Araq: Right, well, i'm going to create an issue for this on Github anyway.
22:11:19AraqI don't look at the list of issues without a filter.
22:11:54*vendethiel quit (Ping timeout: 245 seconds)
22:12:33federico3they are not urgent for the first release
22:15:17dom96federico3: ok
22:18:20*the9to5 quit ()
22:18:58*boop is now known as boopisaway
22:21:27federico3dom96: regarding the security of csources, IIRC the contents of c_code changed compared with the previous release
22:22:28dom96federico3: they change regularly.
22:22:52*the9to5 joined #nim
22:23:10federico3all of them, it seems, not just the latest directory
22:23:26*Jesin quit (Quit: Leaving)
22:23:47federico3ok, not a problem for the moment
22:25:55*gsingh93 quit (Quit: Connection closed for inactivity)
22:25:58*vbtt_ joined #nim
22:25:58*Jesin joined #nim
22:26:01vbtt_hello
22:26:58Araqhi vbtt_ welcome back
22:27:37vbtt_thanks. just saw an interesting discussion in the logs
22:27:41vbtt_use, import etc.
22:28:21vbtt_i'm not quite sure why the current system is broken or lacking
22:30:38Varriountvbtt_: My eyes tend to just glaze over when people start talking of such things.
22:31:12vbtt_why? it's important but nim made a choice
22:31:26*vendethiel joined #nim
22:31:34vbtt_i'm not sure what the argument against the choice is - are there real issues with import?
22:31:51Varriountvbtt_: I'm of the opinion that you're often better off trying to implement the change yourself, rather than persuading others to do it for you.
22:31:55vbtt_I'm used to Python - imports are explicit and 'import *' is discouraged, but python does not overload, it overwrites
22:32:17vbtt_Varriount:sure, but you need approval to be accepted
22:42:24*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
22:42:33*BitPuffin|osx joined #nim
22:44:16vbtt_instead of letting the importer specify what they want, why not let the exporter add tags to the symbols and let the importer specify which tags they want
22:44:48Varriountvbtt_: Can you clarify?
22:44:55*OnO joined #nim
22:45:19*OnO quit (Client Quit)
22:45:24*BlaXpirit quit (Quit: Quit Konversation)
22:45:24vbtt_let me preface with saying the current system is probalby fine, i'm just throwing out more suggestions tthat might be useful
22:46:33*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:47:28vbtt_e.g. https://gist.github.com/anonymous/1ee1957c021c86cdc355
22:47:52vbtt_another option is to use compile time predicate functions to specify what to import
22:48:18vbtt_from module_m import matching my_predicate_function
22:48:21Araqvbtt_: yeah I had that idea too. a macro to influence the import mechanism
22:48:30vbtt_from module_m import matching is_operator
22:48:59vbtt_that can subsume type based import (if I understand what they mean.. import all functions that apply on type X)
22:49:49vbtt_since you already have a compiler vm, using matching functions gives most flexibility IMO, assuming it can be done
22:50:08vbtt_.procs are compile time objects too, I'm assuming
22:50:21notfowlfwiw the import system works fine for me
22:50:31*brson quit (Quit: leaving)
22:52:05vbtt_also, having matching functions means any arbitrary users's specific requirements for the import feature can be just implemented by a matching function.
22:52:39vbtt_anyway, just wanted to mention the idea.
22:52:54vbtt_Araq:interesting - did you decide for/against the macro?
22:56:31gokrOne valid issue AFAICT is that its hard to import a "complete type". If you do oop style programming, then you typically want to import a "class", but there is no such concept today.
22:57:11gokrSo either you import * from that module, or you will have to pick each and every method/proc - as far as I understand it.
22:57:36gokrBut of course * goes a long way in practice.
22:57:55vbtt_right, if you can have predicates, you could do `from m import matching for_type(m.T)`
22:58:00vbtt_is * really that bad?
22:58:07gokrI don't think so
22:58:09vbtt_because it's automatically overloaded locally?
22:58:29gokrBut others are more disturbed by it - but not sure if thats rooted in practice or in theory :)
22:58:34def-vbtt_: i think the argument is that in big projects with many imports and many people working on it, it may be difficult to figure out where a proc came from
23:00:05vbtt_I used to think * is bad, specially because of my python history
23:00:18vbtt_but I think it's probalby ok for nim.
23:00:31vbtt_def-:that's an issue for tools to sovle
23:00:43vbtt_tools can be very accurate here
23:01:32def-yep, nimsuggest and ntags: https://bitbucket.org/behrends/ntags
23:01:36dom96ooh, first time ever a post in r/nim made it to my reddit front page
23:13:39onionhammerhm weird. nim is sigsegving while compiling parseutils
23:15:27Araqonionhammer: OOM?
23:16:13onionhammerAraq i probably screwed something up
23:16:40*vendethiel quit (Ping timeout: 264 seconds)
23:16:50Araqvbtt_: afaict the people with the most Nim code are the ones that are least concerned about how Nim's import works.
23:18:22*Matthias247 quit (Read error: Connection reset by peer)
23:18:59ldleworkThis is like Golang and generics.
23:19:03ldleworkSame form.
23:19:29Araqthis is like the strong spaces discussion. everybody agreed it's a bad idea and will lead to bugs. and the one guy who actually used the feature reported "the compiler is too picky then".
23:20:10Araqwhich is the opposite of "leads to bugs"
23:20:59Araqldlework: it has nothing to do with go and generics, but I know that's your favrourite example to back up whatever point you're trying to bring up.
23:21:25ldleworkLittle effort is required to see that you are making the same argument that Go programmers make for generics.
23:21:34Araqdisagreeing with you means it's like Golang's design.
23:21:39ldleworkIf only I would write more go
23:21:45ldleworkI would see I don't need a generics system
23:22:00ldleworkNeither of these arguments are mine
23:22:07ldleworkTheir yours and Go users, and they are of the same form.
23:24:54Araqeven if that would be true, it's completely irrelevant. "News: We added a different import mechanism in order to not be like Golang or people who argue for Golang."
23:26:06ldleworkspeaking of irrelevant, my point has nothing to do with golang's import system
23:26:10def-Araq: I think what ldlework is trying to say is just that the people who use a language often get used to its pecularities
23:26:24ldleworkyes
23:26:32ldleworksay what you mean "oh you'll get used to it."
23:26:37ldleworkthis isn't a technical defense of the import system
23:27:21ldleworknot that I'm demanding one, I was merely responding to the form of your statement
23:28:20ldleworkGolang programmers might be used to not having generics, but it doesn't change the objective universe where generics make a non-zero number of things easier to write.
23:29:02*sdw joined #nim
23:29:09ldleworkGetting used to, or otherwise writing in a style or manner that allows you to write programs under the conditions of Nim's existing import mechanics doesn't mean that alternative import mechanics will objectively become less flexible in a relative sense or whatever
23:29:36*Varriount is still clueless
23:29:46ldleworkIts just a crappy way to pee on everyone who disagrees with you.
23:30:10flaviuWhy not just drop the whole import discussion until 2.0? It's at least "good enough", and there are better things to focus on than bikeshedding over import.
23:30:20ldleworkflaviu: turns away users obviously
23:30:39ldleworknot that I suggest that be the major concern, but that is at least an observable effect
23:30:43ldleworkand you asked
23:30:52Araqldlework: and yet I've never heard "oh this sucks but I got used to it" either. if that's your argument.
23:31:09flaviuldlework: it was a rhetorical question :)
23:31:35ldleworkAraq: right, I remember when we did that poll
23:31:53ldleworksomeone should make that available on the website
23:32:34flaviuAnyway, this can all be solved with a linter that faults procs exclusively for types the module writer does not own.
23:33:34ldleworkflaviu: yeah, at least then, for the set of users we would otherwise lose, we can save the ones who depend on heavy IDEs
23:33:48flaviuldlework: linter != IDE
23:34:08ldleworkflaviu: okay the subset of people who run linters on their code as an external tool
23:37:13*the9to5 quit ()
23:38:45*the9to5 joined #nim
23:41:38*TEttinger quit (Ping timeout: 265 seconds)
23:42:07*Senketsu quit (Ping timeout: 265 seconds)
23:50:55reactormonkAraq, any documentation on the compiler caching?
23:54:40Araqldlework: The import mechanism changes you're after do not help with the problem of code navigation without an IDE, so it would be nice not to bring up more and more old arguments that have been addressed and IMHO in fact completely destroyed.
23:55:12Araqreactormonk: sorry, no, but you already know all the involved modules
23:55:30Araqgood night
23:55:36VarriountNight.
23:55:43ldleworkI was responding directly to flaviu.
23:56:35ldleworkAnd they really really really do, help IDE-less users. Namespacing does precisely the thing of letting you know where something came from.
23:56:42ldleworkNot sure how 'code navigation' came into this at all.