<< 03-12-2014 >>

00:01:07*Boscop quit (Ping timeout: 245 seconds)
00:04:39*c74d joined #nimrod
00:05:44flaviuI wrote a library to parse urls a while ago, if anyone who's working on the requests library cares.
00:05:51flaviuhttps://gist.github.com/68a49263688c47f5bc2f
00:09:04Joe_knockflaviu: Can you jump to #openssl quickly? We seem to be making progress
00:11:24*dts quit (Read error: Connection reset by peer)
00:12:36*dom96 quit (Excess Flood)
00:13:41*dom96 joined #nimrod
00:14:57*Matthias247 quit (Read error: Connection reset by peer)
00:15:52*vendethiel quit (Ping timeout: 255 seconds)
00:18:04ldleworkWait for ssl do I need to compile nim itself with support?
00:19:25flaviuNope, just your program
00:19:37ldleworkflaviu: is it just --ssl?
00:19:44flaviu-d:ssl
00:19:55ldleworkah
00:21:52ldleworkThis is why I like explicit exports
00:21:59ldleworkIn the httpclient there is a symbol CVerifyNone
00:22:05ldleworkhow can I know where it comes from
00:24:36EXetoCI don't they should be used when it's obvious, but I've noticed that almost no one qualifies symbols
00:26:20ldleworkits a bad trend, we should enforce a culture early
00:28:39ldleworkso uh...
00:29:17ldleworkflaviu: Joe_knock Araq https://gist.github.com/dustinlacewell/060bb0d3f7eee1c0ad4c
00:29:44ldleworkflaviu: there was never any bug at all
00:29:53ldleworkclient verification -is- implemented in our http client :)
00:29:57flaviuJust poor defaults?
00:30:03ldleworkyes, check the gist
00:30:05ldlework:P
00:31:05*vendethiel joined #nimrod
00:31:41Joe_knockyou guys left without saying thank you :(
00:32:47ldleworkpfff
00:32:54ldleworkhe didn't help at all :P
00:33:23flaviuldlework: So? He tried to help, and was very patient.
00:33:29ldleworkAgreed there
00:34:11Joe_knockIf the error gets repaired over the next few days, I'm going to make a PR in a comment saying "Thank you to byte_bucket from ##openssl for helping fix this issue"
00:35:14Joe_knockThat's the least we can do.
00:36:46ldleworkThere is no error
00:36:51ldlework:/
00:36:57Joe_knockSo it works?
00:37:01ldleworkYeah, it does
00:37:14Joe_knockWhere did that error come from?
00:37:22ldleworkWhat are you talking about?
00:37:34Joe_knockokay, I mean that "issue", not error, from the Issue opened on GH
00:37:54ldleworkJoe_knock: a user who didn't read the documentation, who fooled us all into thinking our software was worse than it really is?
00:38:18Joe_knockaah :-/
00:38:23Joe_knock:'D
00:39:01ldleworkWell I guess technically defaultSSLContext isn't documented
00:39:09Joe_knockI recall him mentioning that we shouldn't roll our own http client and instead use something like libcurl.
00:39:25Joe_knockIs there any reason why we aren't doing that?
00:39:30ldleworkI think he was trying to give advice in a situation where we clearly didn't even know what we were asking
00:39:47flaviuYeah, libcurl seems pretty easy to use. Not sure how it'd interact with async
00:40:08ldleworkGues
00:40:10ldleworkGuys
00:40:16ldleworkWe haven't rolled our own
00:40:36flaviuwe haven't?
00:40:39ldleworkOur socket module correctly (as least as far as this issue goes) utilizes openssl directly to do certificate verification
00:40:50flaviuThat's rolling our own..
00:40:55ldleworker..no?
00:41:09flaviuOpenssl is nearly impossible to use securly
00:41:32flaviuHe isn't referring to the actual TLS implementation, he's referring to the difficulty of using openssl properly.
00:41:34*ldlework steps out of the twilight zone and lets you guys have that philosophical discussion
00:41:58ldleworkflaviu: using libcurl solves literally nothing whatsoever
00:42:21Joe_knockldlework: So had we used libcurl, we'd be using a layer between openssl and the actual cert verification
00:42:24Joe_knock*?
00:42:28ldleworkWe use openssl for tls at the transport layer!
00:42:32ldleworkIt has nothing to do with http
00:42:43ldleworklibcurl is a red herring and has confused you
00:42:55flaviuhttp://curl.haxx.se/libcurl/c/https.html
00:43:07flaviulibcurl would simplify things considerbly
00:43:09*ldlework facepalms
00:43:23flaviuI suppose I'm misunderstanding what you mean?
00:43:35ldleworkflaviu: okay and what is our solution for non-http network applications that need tls support
00:43:43ldleworkhow does -libcurl- help us ?
00:43:55ldleworkour httpclient doesn't implement tls -at all-
00:43:58ldleworkour sockets module does
00:44:05ldleworkbecause tls is a transport security layer
00:44:08ldleworkand has nothing to do with http
00:44:14ldleworkor libcurl, an http client library
00:44:15Joe_knockthat makes sense
00:44:16*ldlework swirls
00:44:18flaviuOh, I see what you mean.
00:44:26ldleworkhehe okay
00:44:44ldleworkwe are correctly using openssl, for at least certificate hostname verification
00:44:52Joe_knocklibcurl would corner us if we wanted non-http apps
00:45:04ldlework(in the sockets module)
00:45:11ldlework(which everything else is built upon)
00:45:24Joe_knockldlework: as far as those 2 open issues on github goes, can we safely say they are "closable" ?
00:45:29ldleworkWell
00:45:41ldleworkI think so, he didn't give a different example for the chain verification
00:45:50ldleworkso while it looks right in the code, we don't have a differentiating test case
00:46:10flaviuAre we disabling all the stupid encryption algorithms like DES and Dual_EC_DRBG?
00:46:38Joe_knockWell I don't know if Araq is here or not, but I think these high priority issues have been considerably solved (or close to solving now).
00:47:02ldleworkflaviu: I think that any legitimate language should at some point have a proprietary security company audit their security libraries
00:47:33ldleworkNone of us are qualified to say whether everything is good
00:47:55Joe_knockSo 1.0.0 would be a good point to have this audit done.
00:47:59flaviuYeah, but we can at least fix the low-hanging problems
00:48:10ldleworkflaviu: we could just make things worse
00:48:22ldleworkyou have no idea if you're interpreting advice you're reading correctly
00:48:39ldleworkor if there are unmentioned considerations that contextualize the advice that you don't know
00:49:05flaviuDisabling DES and Dual_EC_DRBG will not make things worse. Dual_EC_DRBG is clearly backdoored, and DES was only half-terrible in the early 90s, these days it thoroughly broken.
00:49:29ldleworkflaviu: are they even enabled?
00:50:36flaviuI'm not sure
00:51:12willwillsonldlework: did you try your httpclient gist with a site that has a valid certificate?
00:52:39ldleworkohshit!
00:54:44Joe_knocktaram dish!
00:56:22flaviu'TLSv1+HIGH:!SSLv2:RC4+MEDIUM:!aNULL:!eNULL:@STRENGTH' looks good as a cipher list
00:56:59flaviuIt doesn't have any horrible stuff like DES, but it still supports windows XP, Iran, North Korea, and Cuba
00:58:09ldleworkHmm
00:58:12ldleworkwhat a useless error
00:58:44flaviunm, it doesn't support those countries. The RC4 key length must be <= 64 for it to be legal to export there
00:59:35*Puffin joined #nimrod
00:59:58ldleworkyeah no idea anymore, because its a generic error
01:01:26Joe_knockldlework: So where are we now?
01:01:54ldleworkJoe_knock: looks like if you turn validation on it rejects valid certificates
01:02:00ldleworkBut the error is a generic rejection
01:02:02ldleworkso I have no clue
01:02:40Joe_knockbut we have deduced that our implementation is in sockets.nim, so we know that something is "possibly" wrong there.
01:02:40*flaviu quit (Read error: Connection reset by peer)
01:04:08ldleworkhmm
01:04:14dom96The reason we are not using libcurl is because we don't want to depend on it.
01:04:18dom96and I hate dependencies.
01:04:24dom96I skimmed the discussion.
01:04:37*flaviu joined #nimrod
01:04:46flaviuWhere is `ErrErrorString()` even defined?
01:04:52dom96I hope you guys are not considering writing your own SSL lib though? :P
01:05:22flaviudom96: I'm 99% sure that "rolling your own" means rolling your own usage of openssl
01:05:30dom96Joe_knock: https://github.com/dom96/jester/blob/new-async/tests/newtest.nim
01:06:42flaviuYeah, I can't find a definition for ErrErrorString anywhere.
01:06:50*Puffin is now known as BitPuffin
01:07:04Joe_knockPerhaps if we let in the use of libcurl for now, we can at least have SSL running for http (which will be big for 1.0 and web apps built in nim)
01:07:26dom96we already have SSL running for HTTP
01:07:33flaviudom96: Not very well though.
01:07:39flaviuNo hostname verification is done.
01:08:02dom96Then it's time to fix that.
01:08:19flaviuhttps://github.com/iSECPartners/ssl-conservatory/blob/master/openssl/everything-you-wanted-to-know-about-openssl.pdf
01:08:33Joe_knockperhaps flaviu and ldlework shouldn't have left the openssl channel that quickly :'D
01:08:44Joe_knockdom96: thanks for sharing that link
01:08:54dom96Sure.
01:09:00flaviuIt's clear how openssl works, I hate to ask questions without doing my research
01:09:05dom96btw guys
01:09:14dom96Now that I am not around as much on IRC
01:09:27dom96Please email me if you have questions about the stuff I wrote.
01:09:31dom96like httpclient
01:09:35dom96jester
01:09:38dom96async
01:09:40dom96and the like
01:09:53dom96or tweet at me
01:10:23dom96(my contact info is available at http://picheta.me/aboutme.html)
01:14:43rpagdom96, why are you leaving irc, it's the only medium worthwhile
01:14:58dom96i'm not leaving
01:15:17dom96I'm just busier than usual so I don't have as much time to be active on it.
01:15:32Joe_knockIRC can become time-consuming.
01:15:58rpagless annoying than twitter though
01:16:05Joe_knockI shall sign up to the forum tomorrow, so hopefully you have email notifications available on it, dom96
01:16:12flaviu`let defaultSSLContext = newContext(verifyMode = CVerifyNone)`, wtf
01:17:37dom96Joe_knock: no email notifications there unfortunately
01:18:19ldleworkdom96: so, if you turn on peer verification with the httpclient, it rejects every certifiate, like google.com, etc
01:19:24flaviuBecause a certificate store isn't configured
01:19:55ldleworkThat could be why but I don't see any api exposed for it
01:20:09ldleworkthe SSLContext takes a cert and key file but that's for listening sockets
01:20:31EXetoCJoe_knock: lots of noise
01:20:59flaviuopenssl has `int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);`
01:21:05flaviubut it looks like nim doesn't expose it
01:21:16EXetoCand things have to be repeated all the time
01:21:28ldleworkflaviu: cool lets try that
01:21:43flaviuI can't find a simple, cross-platform way to get the OS certificate store. I think it'd be best to ship mozilla's with the installer
01:22:36Joe_knockEXetoC: Are repeat posts cleaned up/merged?
01:23:19Joe_knockflaviu: Why don't we focus on primary support for the dominant OSes we use? Or are we being liberal with all OS support?
01:23:58flaviuJoe_knock: Have fun, but it looks like libcurl also decided that was too much work.
01:24:05flaviuhttp://curl.haxx.se/docs/caextract.html
01:24:44Joe_knockso depending on libcurl makes us depend on mozilla :'D
01:24:47Joe_knockhaha
01:24:58EXetoCJoe_knock: talking about IRC
01:25:18flaviuI'm not saying we should depend on libcurl. I'm just saying that they looked at the problem, and decided the easiest path was to distribute their own.
01:25:36ldleworkflaviu: where is it on ubuntu
01:26:58*BitPuffin quit (Ping timeout: 255 seconds)
01:27:09Joe_knockEXetoC: That is true.
01:27:11flaviuI don't have any clue, sorry. try `find . -name *.crt`
01:28:23ldleworkNice!
01:28:25ldleworkflaviu: that works
01:29:11*flaviu quit (Read error: Connection reset by peer)
01:29:41Joe_knockI get some certs in .mozilla ?
01:29:45ldleworkah darn it
01:29:55ldleworknow it accepts the invalid cert
01:30:15ldleworkI added
01:30:17ldleworkdiscard SSL_CTX_load_verify_locations(newCTX, "/etc/ssl/certs/ca-certificates.crt", "/usr/share/ca-certificates");
01:30:21ldleworkto line 331 in sockets.nim
01:30:51*flaviu joined #nimrod
01:32:26flaviuThe second argument can be nil, but it lets a self-signed cert through for me too.
01:32:39flaviuOh, I see the problem
01:33:11flaviuThe cert is fine! It's for the wrong domain, and we haven't implemented checking for domain
01:34:31flaviuThere is identical code in `pure/sockets.nim` and `pure/net.nim`..
01:37:17*vendethiel quit (Ping timeout: 240 seconds)
01:39:36*BitPuffin joined #nimrod
01:57:18*vendethiel joined #nimrod
01:57:53*Joe_knock quit (Quit: Leaving)
01:58:32*willwillson quit (Remote host closed the connection)
02:02:41*darkf joined #nimrod
02:15:20*Demos joined #nimrod
02:16:24*brson quit (Ping timeout: 244 seconds)
02:19:19*vendethiel quit (Ping timeout: 252 seconds)
02:21:35*vendethiel joined #nimrod
02:24:13*q66 quit (Quit: Leaving)
02:24:45*superfunc joined #nimrod
02:25:23*BitPuffin quit (Ping timeout: 264 seconds)
02:28:44superfunchey everybody
02:37:32flaviuhey superfunc
02:44:25*vendethiel quit (Ping timeout: 258 seconds)
02:47:28*superfunc_ joined #nimrod
02:47:51*saml_ joined #nimrod
02:49:13*superfunc quit (Ping timeout: 246 seconds)
02:49:13*superfunc_ is now known as superfunc
02:53:20*vendethiel joined #nimrod
02:56:38*saml_ quit (Ping timeout: 250 seconds)
03:10:38*saml_ joined #nimrod
03:15:25*vendethiel quit (Ping timeout: 252 seconds)
03:19:28*saml_ quit (Ping timeout: 255 seconds)
03:19:53*kapil__ joined #nimrod
03:20:38ldleworkflaviu: did you come up with a patch?
03:21:43flaviuldlework: Not quite. I expect part of my patch to be rejected, and we need to figure out how we're going to distribute the certificates.
03:22:04flaviuldlework: https://github.com/Araq/Nimrod/issues/782
03:23:28ldleworkcool
03:25:41ldleworkI was just thinking of a website that features neat uses of the macro system, like DSL's and such
03:26:20flaviugist.github.com? :P
03:26:56ldleworkNot great for indexing, etc
03:27:17*enquora quit (Quit: enquora)
03:31:37*Var|Mobile quit (Ping timeout: 240 seconds)
03:31:59*saml_ joined #nimrod
03:32:16*vendethiel joined #nimrod
03:32:46ldleworkflaviu: what if you made a static github-pages website that used the github api to retrieve and create a gallery from files in the same repo but on the main branch :P
03:34:43ldleworkhmm I suppose you wouldn't need to do that
03:34:43flaviuldlework: If it used javascript, it'd be terrible for search engines. But github pages would work great.
03:35:10flaviuJust have people send PRs, and github would automatically render and deploy the pages.
03:35:13ldleworkyeah
03:35:18*EXetoC quit (Ping timeout: 256 seconds)
03:36:08flaviuI like to create an organization for this sort of stuff so that I get a cleaner url.
03:36:16ldleworkdo we have a nim organization yet?
03:36:34flaviuYes, nim-code
03:37:00ldleworkflaviu: I'm thinking we include a tiny script, so that when you add your page, you run the script, it generates a json file which drives some javascript so you can say, organize the examples by tag
03:37:10flaviuBut I want to make an org for a org-name.github.io url
03:37:15ldleworkYou know
03:37:21flaviuyes, javascript could be used to make the page more dynamic
03:37:23ldleworkGithub is totally cool about giving people usernames they deserve
03:37:25ldleworkseriously
03:37:38flaviuhuh?
03:37:45ldleworkgithub.com/nim/ hasn't ever done any activity
03:37:56ldleworkthey would totally give us nim if we asked
03:38:17flaviuWhy would we want it?
03:38:19ldleworkwhen I asked for one, they replied in a day
03:38:25ldleworkwhy wouldn't we?
03:38:36flaviuBecause Nim is a project, not a user
03:38:43ldleworkwhat?
03:39:12ldleworkI'm saying they would give us the 'nim' namespace for the organization
03:39:15ldleworkif we simply asked
03:40:05flaviuI don't see the point, but I have no control over Nim's direction anyway.
03:40:23*saml_ quit (Ping timeout: 264 seconds)
03:40:25flaviu"nim-snippets"?
03:40:57ldleworknimblets
03:41:10flaviuAlready taken
03:41:46flaviuClever though
03:42:18ldleworknimlets is available, but it doesn't seem as good
03:43:12ldleworkah its not so bad
03:43:14ldleworknimlets
03:43:46flaviuWhat's the pun there?
03:44:07ldleworkthere is none, its just short and memorable
03:44:10ldlework'scriptlets'
03:45:15flaviuOk, sounds good
03:49:43ldleworkWhat I like about this, is we can set a style guide for what kind of tags are good
03:49:58ldleworkso we can keep the number low and congruent
03:52:42ldleworkflaviu: how do you think it should work?
03:53:35flaviuThere is a special header with tags and such
03:54:04ldleworkthe 'compile' script recurses the filesystem, and creates a json map?
03:54:08flaviuUser creates a PR, if the PR is merged, a build tool takes all the header info and condenses it into one javascript object.
03:54:10flaviuyep
03:54:25ldleworkwe should implement that in Nim
03:54:28ldleworkusing nimr
03:55:10flaviuSure, why not. I use wercker for nim-by-example, perhaps we can use that
03:55:26ldleworkI mean come on :P
03:55:41ldleworkflaviu: we should make it so each file is a compile-able and runnable nim example
03:55:53ldleworkso the meta-data goes into nim comments at the top or something?
03:56:06ldleworkthat way you can clone the repo and try stuff out
03:56:37flaviuI guess that'd work, although there would be less friction if we just directly used markdown
03:57:10flaviuinstead of parsing nim to html, just parse markdown to html
03:57:46ldleworkI mean
03:57:56ldleworkwe can just do something extremely simple
03:58:05ldleworka convention where the very first line is a list of tags
03:58:10ldleworkwhat else is needed?
03:58:32ldleworkthat way, I can clone the repo, and run the example I just looked at with nim c -r theexample.nim
03:58:33ldleworkthat's huge
03:58:55ldleworkpeople don't need markdown for their examples do they?
03:59:12flaviuNo, you're right. I was thinking about allowing more explaination
03:59:14ldleworkWe should just have nim code, with explanations in comments
03:59:30flaviubut people can just manually wrap their comments, it's not that bad.
03:59:36ldleworkyeah
03:59:56ldleworkIt'll get people into the nim code quicker, etc
04:00:03flaviuhttp://nimlets.github.io/ doesn't work for you, does it?
04:00:14ldleworknope
04:00:14*j3rky joined #nimrod
04:01:11flaviuanyway, good night. I added you to the organization btw
04:01:25ldleworko/
04:05:53*flaviu quit (Ping timeout: 264 seconds)
04:38:17*vendethiel quit (Ping timeout: 240 seconds)
04:46:51*gmpreussner joined #nimrod
04:47:07*vendethiel joined #nimrod
04:47:35*j3rky quit (Ping timeout: 264 seconds)
04:52:42*superfunc quit (Quit: Connection closed for inactivity)
04:54:13*edayo_ joined #nimrod
05:03:21ldleworkIs there a way to get nim to read from stdin?
05:08:37ldleworkodd, I can't do: self.setrule(self.ruleno() - 1)
05:08:38ldlework?
05:09:18ldleworknevermind
05:23:41*gmpreussner quit (Quit: Konversation terminated!)
05:24:03*edayo_ quit (Quit: Leaving)
05:32:33*j3rky joined #nimrod
05:33:03*Demos quit (Read error: Connection reset by peer)
05:40:20*c74d quit (Remote host closed the connection)
05:45:10*BlaXpirit joined #nimrod
05:45:22*dts joined #nimrod
05:53:25*c74d joined #nimrod
05:53:35*darkf_ joined #nimrod
05:54:47*vendethiel quit (Ping timeout: 264 seconds)
05:55:19*darkf quit (Ping timeout: 258 seconds)
05:56:33*vendethiel joined #nimrod
06:04:57*j3rky quit (Quit: Konversation terminated!)
06:05:16*darkf joined #nimrod
06:07:12*darkf_ quit (Ping timeout: 258 seconds)
06:09:16*c74d quit (Remote host closed the connection)
06:13:24*c74d joined #nimrod
06:17:53*vendethiel quit (Ping timeout: 264 seconds)
06:20:00*vendethiel joined #nimrod
06:36:51*brson joined #nimrod
06:51:25*c74d quit (Remote host closed the connection)
06:53:13*skyfex quit (Quit: (null))
06:53:44*skyfex joined #nimrod
06:55:44*c74d joined #nimrod
07:04:04*vendethiel quit (Ping timeout: 250 seconds)
07:16:33*vendethiel joined #nimrod
07:17:13*c74d quit (Remote host closed the connection)
07:19:17*gokr_ quit (Ping timeout: 240 seconds)
07:20:52*brson quit (Quit: leaving)
07:21:30*c74d joined #nimrod
07:21:59*gokr_ joined #nimrod
07:24:15*dts is now known as dts|pokeball
07:35:03*BlaXpirit quit (Quit: Quit Konversation)
07:38:17*vendethiel quit (Ping timeout: 264 seconds)
07:44:40*vendethiel joined #nimrod
07:49:42*gokr_ quit (Read error: Connection reset by peer)
07:52:40*gokr_ joined #nimrod
08:10:42*c74d quit (Remote host closed the connection)
08:12:40gokrMorning!
08:13:26gokrldlework: Reading from stdin works fine for me, however, readAll does not, at least not on win32.
08:13:56ldleworkgokr: I mean streaming code into the compiler through a pipe on the commandline
08:14:09ldleworkcat foo.nim | nim c -r --
08:14:14ldleworksomething like that
08:14:51*c74d joined #nimrod
08:17:16dts|pokeballdoes that make much sense for a compiler though?
08:17:20dts|pokeballto read from stdin?
08:18:27gokrldlework: blimp that I wrote can be used as a filter with git
08:18:32gokrAFAIK git pipes into it.
08:18:54ldleworkhey how do I reverse a sequence or iterate it backwards?
08:19:07gokrI used "allinput = readAll(stdin)" and that worked fine, but not on win32
08:19:57gokrThis had to do with how readAll first tries to find size of "the file" and it fails on win32. But fix was simple, I just plucked out the readAllBuffer proc from system.nim (IIRC) and used it without that "find size trick".
08:20:09gokrI should create an issue for that btw.
08:21:47gokrldlework: In algorithm module you find reverse()
08:21:55ldleworkgokr: does that work on sets?
08:22:06gokrEh, waf?
08:22:28ldleworkgokr: I want to iterate a set backwards somehow
08:22:31ldleworkerr
08:22:33ldleworksorry
08:22:35ldleworkseq
08:22:37ldlework:(
08:22:39ldleworkits late
08:22:56*dts|pokeball is now known as dts
08:23:12gokrIf a parameter has type openarray - a seq works fine.
08:23:30gokrI really should publish my seq article.
08:23:41ldleworkneat
08:24:37gokropenArray is a bit of an "odd bird" but I interpret it as "a type I can use only for parameters - and then it will work fine for both array and seq".
08:25:12gokrSo basically, any time you declare a parameter as seq, you may probably really want to use openArray.
08:25:20gokrI guess.
08:26:09gokrldlework: You also have reversed() (not the "d")
08:26:32ldleworkI have built a basic windowing system for libtcod
08:26:44gokrreverse is destructive, reversed gives you a reversed copy. I like that btw, similar to Smalltalk naming.
08:30:10gokrIn Smalltalk we have do: and reverseDo: - in Nim ... perhaps we could make "reverse iterators" in Nim too.
08:31:04ekarlso-does nimrod feel like python ?
08:33:24*c74d quit (Remote host closed the connection)
08:34:00gokrSo people sometimes say. I am a Smalltalker, so I compare with that.
08:35:08gokrIt doesn't feel like Smalltalk though, that would be a "stretch" to say the least. But it does have lots of "dynamic taste" although being a fast efficient statically typed language.
08:35:38gokrIt also feels like a very strong "foundation" for evolving it further.
08:36:11gokrI mean, adding more behaviors to core types like seq etc, is very easy.
08:37:41*c74d joined #nimrod
08:37:51gokrekarlso-: Did you see my articles I have written recently?
08:37:55gokrMight be of interest.
08:38:08Araqekarlso-: at one point you need to install it and use it
08:38:54ekarlso-Araq: :P
08:39:01ekarlso-doing rust atm (:
08:39:08Araqit's a super python without the warts :P
08:39:20Araqfor instance, we have multi line lambdas
08:39:23ekarlso-https://github.com/ekarlso/rust-dns/
08:39:28Araqand non broken scoping
08:39:29ekarlso-maybe i'll do the same for nim
08:41:17Araqha
08:41:27AraqI open a random file
08:41:39Araqas expected it's full of "unwrap!"
08:42:34Triplefoxrust is an exciting! language
08:44:31Araqand this is exactly what happens when you totally ignore usage statistics
08:44:50*bjz joined #nimrod
08:44:55Araqhow many times to I need to be reminded that "unwrap" is a macro?
08:46:15Araqthis is language design driven by fear which I loathe
08:46:15ekarlso-Araq: not my problem that it's like that :/
08:48:39gokrekarlso-: Araq critiques Rust, not you :)
08:48:46ekarlso-gokr: heh :p
08:48:49ekarlso-Araq: how does one easily install nim ?
08:49:06gokrekarlso-: The best I would say is to install from source.
08:49:27gokrAnd *not* install it - just keep the clone where it is, and add "nim" to your path.
08:49:39gokrekarlso-: What platform are you on?
08:49:58ekarlso-ubuntu :p
08:50:01gokrGreat
08:50:07gokrSo, see http://goran.krampe.se/category/nim/
08:50:21gokrEspecially: http://goran.krampe.se/2014/10/15/bootstrapping-nim/
08:50:45gokrBut... that is a detailed article basically summing up the 10 lines you need to run to bootstrap it - described at the download page.
08:51:13ekarlso-no built deb's yet ? :P
08:51:40gokrThere may ... be, but its easier following different branches like this.
08:52:14gokrAnd also - Nim finds everything relative to the location of the binary "nim" (the compiler).
08:52:29gokrThus, its easier if you don't move it to some... /usr/local/bin yadda
08:52:45gokrIf its kept in the clone's "bin" dir, then it finds libraries etc in the clone.
08:53:48*c74d quit (Remote host closed the connection)
08:54:08gokrI generally also like debs - but... for programming tools like this, I find it nicer to have the clone and build from it. Especially since its so easy.
08:54:13*bjz_ joined #nimrod
08:54:25ekarlso-:p
08:54:32ekarlso-i guess it changes once it's stable :p
08:54:46*bjz quit (Read error: Connection reset by peer)
08:54:57*bjz_ quit (Read error: Connection reset by peer)
08:55:16gokrldlework: Regarding reverse iteration of a "set" (yeah, I know, a typo) I think they actually have an order since its a bit set, the iterator in system.nim should be easily copied and modified to run in reverse :) :)
08:55:48gokrAnd generally, all those core iterators seem trivial to copy and create reverse variants of.
08:55:49*bjz joined #nimrod
08:56:26gokrI am guessing things like this would be put in say sequtils etc
08:57:35gokrekarlso-: There are instructions on how you can install it too, but... not many seem to use it that way. :)
08:59:17*c74d joined #nimrod
08:59:49*Trustable joined #nimrod
09:00:00*Trustable quit (Read error: Connection reset by peer)
09:01:06*Trustable joined #nimrod
09:02:33Araqekarlso-: older releases have ubuntu packages
09:03:36Araqbut I don't see the point. software installation on unix like systems is inherently broken IMO
09:04:32*bjz quit (Ping timeout: 256 seconds)
09:04:37*bjz_ joined #nimrod
09:07:39*dts is now known as dts|pokeball
09:08:19gokrAraq: Still... in *practice* it works quite well in Debian/Ubuntu.
09:08:37dts|pokeball<Araq> but I don't see the point. software installation on unix like systems is inherently broken IMO
09:08:40dts|pokeballcare to expand?
09:09:00gokrSimply because of all the man power making it work.
09:09:28Araqgokr: that's exactly the way to put it.
09:09:34Araqit works by brute force
09:09:37gokr(while I was chatting I ran an upgrade btw, Ubuntu evidently upgraded a whole slew of apps)
09:10:11Araqdts|pokeball: well spreading everything over the file system and then needing software to manage this mess is completely backwards
09:10:12gokrSo... I agree with you that splitting stuff up like that, all over, is definitely less than "neat". But still, it works. Can't be denied.
09:10:29dts|pokeballAraq, meh... i guess so
09:11:13Araqwhen I say "doesn't work" I usually mean "works much less effective than an existing alternative solution" :P
09:11:14gokrIs it Arch that keeps it all in one place? Never played with it.
09:12:08gokrBut I used Lunar Linux for some years, and some things are clearly lacking IMHO. Lunar tools actually were slicker in some parts, like for example easily showing history on a given package.
09:12:43gokr(clearly lacking in apt I mean)
09:12:58*uber quit (Quit: bye)
09:13:48gokrLunar tracked all files that was installed by using... that tool that tracks all files created, can't remember what its called. That was neat.
09:13:53*vendethiel quit (Ping timeout: 258 seconds)
09:15:06ekarlso-do you have to use .unwrap() all the time in nim as well ?
09:15:28*c74d quit (Remote host closed the connection)
09:15:48*MightyJoe quit (Ping timeout: 258 seconds)
09:16:32gokrEhm, what's unwrap? :)
09:17:00ekarlso-:p
09:17:02ekarlso-hah
09:17:06ekarlso-is there a intro thing ?
09:17:17gokrAraq: Gobolinux uses one directory per app and has redesigned the filesystem layout. But.. I thought it was some other distro that did that too.
09:17:35gokrYeah, 1 sec
09:17:57gokrhttp://nimrod-by-example.github.io
09:18:09gokrhttp://learnxinyminutes.com/docs/nim
09:18:41gokrAnd http://nim-lang.org/documentation.html of course, has two tutorials etc
09:19:31gokrMy articles also explore OO and some other things, so not written primarily as tutorials, they are probably quite nice to get started too.
09:19:38*c74d joined #nimrod
09:22:49gokrAh, NixOS is similar.
09:22:56*Etheco joined #nimrod
09:28:20ekarlso-gawd, so many languages :P
09:30:57*c74d quit (Remote host closed the connection)
09:38:10*MightyJoe joined #nimrod
09:39:40*c74d joined #nimrod
09:40:10*rpag quit (Quit: Leaving)
09:41:48*johnsoft quit (Ping timeout: 250 seconds)
09:42:02*johnsoft joined #nimrod
09:45:11*vendethiel joined #nimrod
09:45:19*rpag joined #nimrod
09:45:52*c74d quit (Remote host closed the connection)
09:48:43gokrekarlso-: Ah, unwrap - I googled it. Yeah, its because Rust (and Go) has IMHO insane primitive error handling.
09:49:04gokrNim has a decent regular exception model.
09:49:18ekarlso-oh, even more lovely!
09:49:19gokrIt doesn't shove itself down your throat like the one in Java though.
09:49:35gokryes, its a big, big plus for Nim.
09:49:43gokrI have an article brewing on that too :)
09:50:24gokrOne very cool thing that Nim has - but AFAIK its still finding its full set of use cases - is "effect tracking".
09:51:03*khmm joined #nimrod
09:51:10gokrThis mechanism can be applied to exceptions, so you can declare that a proc must never raise say some Exception.
09:51:32gokrThen the compiler will track and statically verify that you don't accidentally call something that calls something that.... may raise that.
09:53:18gokrAraq can correct me if I am wrong, I haven't used this yet, but its a very slick system AFAICT. It means you can maintain control in libraries - without getting into the insane situation of checked exceptions in Java.
09:54:03*bjz_ quit (Quit: Textual IRC Client: www.textualapp.com)
09:54:16*c74d joined #nimrod
09:54:27*bjz joined #nimrod
09:57:12*khmm quit (Ping timeout: 258 seconds)
10:02:01*khmm joined #nimrod
10:06:47ekarlso-2so, does nim have anything like http://crates.io ?
10:07:15dom96No, just https://github.com/nim-lang/packages
10:07:30ekarlso-:/
10:08:20*c74d quit (Remote host closed the connection)
10:10:57dom96ekarlso-: Why so sad? You could be the one to create a crates.io for Nim ;)
10:11:06dom96Wouldn't that be a fun project?
10:11:52gokrIts just a web frontend, right?
10:12:22dom96I think they also store the packages on their server.
10:12:26gokrSlightly... annoyed with the trend to come up with funny words for everything. crate... sigh.
10:13:27*c74d joined #nimrod
10:14:51ekarlso-:P
10:14:56ekarlso-what name for nim haha ? :
10:29:15dom96packages.nim-lang.org? :P
10:31:53gokrYeah, I think packages are an ok name for... eh, packages.
10:31:57gokr:)
10:32:27dom96I agree :D
10:33:01gokrNot that I am a total conservative, but it just gets a bit out of hand it seems.
10:34:04ekarlso-is there db libs for nim ?
10:34:35gokrAraq: Stumbled onto this, gives internal error in compiler: echo(@[1,2].map(proc(x: int): string = $x))
10:35:08gokrAraq: And yes, I know, its not a string, but it shouldn't give an internal error, right? And I think it worked earlier.
10:35:43gokrIt seems to be a regression - there was some edit around there in compiler a few days back.
10:35:52gokrekarlso-: There are, but I haven't used them.
10:36:16gokrekarlso-: http://nimrod-lang.org/lib.html
10:37:53ekarlso-k
10:38:25gokrdom96: Btw, really like the simplicity in nimble, so we should take care of keeping it simple. Some federation mechanism would be neat though.
10:40:48ekarlso-nim.io ? :p
10:44:35gokrRegister!!! :)
10:45:18ekarlso-meh :p
10:45:27gokrAraq: I am fairly sure echo worked earlier (the implicit $ working) for results from map. It works now if I do echo($(..)) of course
10:46:14*bjz quit (Read error: Connection reset by peer)
10:46:33*bjz joined #nimrod
10:52:46*vendethiel quit (Ping timeout: 256 seconds)
10:54:09*dom96_ joined #nimrod
10:54:26dom96_gokr: Thanks. I am definitely intending on keeping it as simple as possible.
10:59:48*gokr about to publish my seq article... :)
11:13:51*vendethiel joined #nimrod
11:17:31*Araq0 joined #nimrod
11:17:57Araq0gokr_: well please create a bug report for it
11:18:23gokryeah
11:18:39Araq0and yeah, I changed how 'echo' works internally
11:20:42Araq0bbl
11:20:44*Araq0 quit (Client Quit)
11:23:12*BlaXpirit joined #nimrod
11:25:38*dts|pokeball quit (Ping timeout: 256 seconds)
11:26:14gokrHot off the press: http://goran.krampe.se/2014/12/03/nim-seq/
11:26:16gokr:)
11:39:24*flaviu joined #nimrod
11:41:29*EXetoC joined #nimrod
11:42:04*flaviu quit (Remote host closed the connection)
11:42:19*flaviu joined #nimrod
11:57:26*flaviu quit (Ping timeout: 250 seconds)
11:58:41*vendethiel quit (Ping timeout: 264 seconds)
12:00:14*vendethiel joined #nimrod
12:11:24*kapil__ quit (Quit: Connection closed for inactivity)
12:22:08*vendethiel quit (Ping timeout: 250 seconds)
12:23:34*vendethiel joined #nimrod
12:41:41*Araq0 joined #nimrod
12:42:40Araq0gokr_: nice but you really need to split up the code IMO
12:42:56Araq0or maybe change your syntax highlighting colors
12:43:03Araq0it's somewhat hard to read
12:44:11gokrReally? This time I didn't bother splitting and commenting in the article - just dumped the code to get it out there.
12:44:29gokrThe color scheme is ok on my laptop screen - but it may be too dark for other screens?
12:45:16dom96_I think it's fine.
12:45:35*vendethiel quit (Ping timeout: 252 seconds)
12:48:35gokrI think its the default scheme for Octopress.
12:50:19gokrhttp://ethanschoonover.com/solarized
12:50:36Araq0it's blue with different blue on blue and control chars are white
12:50:44Araq0it's horrible
12:51:50Araq0it needs much more contrast
12:55:19Araq0also and that's of course not your fault: the "in" in "for ... in" is not an operator
12:55:29Araq0but gets highlighted as such
12:56:00Araq0that's exactly what happens when you get category happy with syntax highlighting without having a smart parser
12:57:09Araq0which is why I prefer to have much fewer categories when it comes to syntax highlighting, but the rest of the world disagrees with me, of course
12:57:44*kostya_ joined #nimrod
12:58:20gokrI was just happy that I could use "nimrod" for code :)
12:59:49EXetoCI did replace that foreground color with something lighter from the palette when using solarized
13:00:18Araq0also 'var' is not highlighted, but 'let' is
13:00:28Araq0what kind of highlighter is that?
13:00:41EXetoCbut is that even the default foreground?
13:01:31EXetoCright, comments, and a lot of them
13:03:52Araq0and 'from' and 'import' are highlighted differently still
13:04:40Araq0my guess is that it comes from C where #include is a preprocessor directive and thus special
13:10:22*kapil__ joined #nimrod
13:12:41*khmm quit (Ping timeout: 272 seconds)
13:17:05*khmm joined #nimrod
13:20:45*BitPuffin joined #nimrod
13:22:41*vendethiel joined #nimrod
13:23:43EXetoCstuffing a variant object in a table gives me a C error about an undeclared symbol. do you know if something similar has been reported?
13:24:30EXetoCone such bug was closed 6 days ago. I'll update the compiler
13:26:36*untitaker quit (Ping timeout: 264 seconds)
13:31:51*untitaker joined #nimrod
13:44:37*vendethiel quit (Ping timeout: 252 seconds)
13:53:57*gokr_ quit (Ping timeout: 240 seconds)
13:53:57EXetoCthere's another bug though, regarding recursive variant types
13:54:32*gokr_ joined #nimrod
14:06:43*vendethiel joined #nimrod
14:06:50*darkf quit (Read error: Connection reset by peer)
14:07:26*darkf joined #nimrod
14:09:41*khmm quit (Ping timeout: 272 seconds)
14:15:35Araq0EXetoC: report it
14:16:33EXetoCI have
14:23:21*quasinoxen quit (Ping timeout: 244 seconds)
14:28:05*vendethiel quit (Ping timeout: 264 seconds)
14:28:06*gokr_ quit (Read error: Connection reset by peer)
14:28:26*quasinoxen joined #nimrod
14:28:56*gokr_ joined #nimrod
14:31:26*vendethiel joined #nimrod
14:36:05Araq0ty
14:47:48*darkf quit (Read error: Connection reset by peer)
14:48:16*darkf joined #nimrod
14:57:25*khmm joined #nimrod
15:03:17*khmm quit (Ping timeout: 240 seconds)
15:06:21*khmm joined #nimrod
15:10:14*khmm quit (Remote host closed the connection)
15:11:15*khmm joined #nimrod
15:13:12*vendethiel quit (Ping timeout: 245 seconds)
15:15:00*darkf quit (Quit: Leaving)
15:15:21*vendethiel joined #nimrod
15:27:02*dts joined #nimrod
15:31:24*kapil__ quit (Quit: Connection closed for inactivity)
15:32:37*BitPuffin quit (Ping timeout: 258 seconds)
15:36:49*zio_tom78 joined #nimrod
15:37:00zio_tom78Hi to everybody
15:37:12*vendethiel quit (Ping timeout: 252 seconds)
15:39:31zio_tom78Sorry, a silly question: I need to use ntoh on 64-bit integers. It seems that the standard library only provides ntohs (16-bit) and ntohl (32-bit). Does it exist, or should I implement one?
15:39:56zio_tom78(I import the "sockets" library to have ntohs and ntohl)
15:40:50*vendethiel joined #nimrod
15:41:32EXetoCzio_tom78: see the endians module
15:43:41*BlaXpirit-UA joined #nimrod
15:43:55*BlaXpirit-UA quit (Client Quit)
15:44:16*BlaXpirit-UA joined #nimrod
15:46:12zio_tom78EXetoC: Wow, thanks a lot! That's exactly what I was looking for!
15:46:43*BlaXpirit quit (Ping timeout: 252 seconds)
15:49:39*dts quit (Ping timeout: 252 seconds)
15:55:53Trustablegokr, thanks for another good article :) http://goran.krampe.se/2014/12/03/nim-seq/
15:56:09*BitPuffin joined #nimrod
16:03:07*vendethiel quit (Ping timeout: 255 seconds)
16:10:26*vendethiel joined #nimrod
16:18:59*dts joined #nimrod
16:19:08*dts is now known as dts|pokeball
16:23:36*gokr quit (Quit: Leaving.)
16:34:03*gour joined #nimrod
16:35:37*gokr joined #nimrod
16:36:10*zio_tom78 quit (Ping timeout: 256 seconds)
16:36:37*gokr_ quit (Ping timeout: 240 seconds)
16:52:41*gokr1 joined #nimrod
16:53:05*vendethiel quit (Ping timeout: 272 seconds)
16:54:34*Matthias247 joined #nimrod
17:02:24Araq0http://forum.nim-lang.org/t/650
17:02:32*vendethiel joined #nimrod
17:05:34*gour_ joined #nimrod
17:06:31*gour quit (Quit: Konversation terminated!)
17:07:42*gour_ is now known as gour
17:11:12gokr1Trustable: Thanks!
17:12:12ldleworkgokr1: just read it, agreed; great article
17:12:28ldleworkDo we have a good dictionary too?
17:13:21gokr1Its in the... tables module
17:13:36gokr1http://nimrod-lang.org/tables.html
17:14:00ldleworkew 'bnot'
17:17:56*quasinoxen quit (Read error: Connection reset by peer)
17:19:03Araq0ldlework: don't want to waste ~ for this really
17:19:18Araq0as it's so uncommon in Nim code
17:19:32Araq0(we have typed bitsets instead)
17:19:44ldleworkYeah but once you put 'bnot' into the language...
17:20:16Araq0well just make some noise on the forum about it
17:20:43EXetoC< 1.0 and all that
17:21:22Araq0well I don't pull these improvements out of my ass. these things produced bugs
17:23:14Araq0in the real world.
17:24:14Araq0note that most complaints are not about the real world, but about some fantasy land ("I can imagine this feature to cause bugs")
17:25:34*Stefan_Salewski joined #nimrod
17:25:43*vendethiel quit (Ping timeout: 245 seconds)
17:26:32Stefan_SalewskiOK, latest glib 2.40.2 wrapper is on github now, https://github.com/StefanSalewski
17:27:23*khmm quit (Ping timeout: 245 seconds)
17:29:05Stefan_SalewskiThis does not include GObject, I think I will keep them separate. GObject will follow, GDK3/GTK3 needs some fixes for new naming scheme stll and some cleanup, will follow...
17:29:26*Stefan_Salewski quit (Client Quit)
17:29:27Araq0Stefan_Salewski: yay! thanks a lot! please add them to Nimble/Babel
17:29:36ldleworkCan someone point me to where the "Strong Spaces" thing is described?
17:29:47Araq0it's somewhere in the manual
17:29:55ldleworkok
17:31:11*vendethiel joined #nimrod
17:31:20ldleworkheh that does seem like a bad idea
17:32:35EXetoCit's graet
17:32:58ldleworkhmm big thumbs down over here, I think
17:33:19Araq0well it's opt-in, so don't complain :P
17:33:30Araq0I still love it though
17:34:03gokr1So Stefan is making a full Gtk3 binding? That's very neat.
17:34:03ldleworkYeah, asking humans to count spaces
17:34:06ldleworkThat's going to be popular
17:34:37Araq0i+4 * 4
17:34:49Araq0who counts for this?
17:34:55Araq0it's obvious
17:35:02ldleworkyay for minimal examples
17:35:23ldleworkWho types two spaces?
17:35:28ldleworki+4 * 4
17:35:31ldleworkis more likely
17:35:34Araq0still obvious
17:35:44ldleworkWith this absolute minimal example, you're right
17:36:03Araq0echo $foo # common gotcha
17:36:10Araq0# but: works with strong spaces
17:36:32ldlework# except nobody can explain why until looking at the language spec
17:36:40gokr1Hmm... so people arguing for it will say "its neat, and its optional". But ... heh, if I read someone elses code, and it uses this. Hmmm. Sorry, don't like.
17:37:20EXetoCunless maybe someone is using 0, 1 and 2 spaces in the same expression
17:37:35gokr1It doesn't really sound like "principle of least surprise". Rather the opposite.
17:37:40EXetoCI don't know why you would allow that, but on one does that really
17:38:05Araq0ldlework: so? I need to look at the spec for the operator precedence table *now*
17:38:28Araq0for strong spacs, I don't
17:38:43ldleworkOf course you do, they still have precedence in equal spacing
17:38:43EXetoCgokr1: for experienced users or new users?
17:38:46gokr1Don't want to sound like a whiner... but this was something important we needed? To save typing some parens?
17:39:20ldleworkJust one more thing to make sure I don't typo
17:39:27ldleworkWhat an incredibly hard thing to debug
17:39:39ldleworkoff-by-one-space errors
17:39:44ldleworkfun
17:40:14*willwillson joined #nimrod
17:40:15EXetoCthey are not rare then?
17:40:48ldleworkEXetoC: that's hardly the point, its going to vary from author to author
17:41:06ldleworkAnd even if you don't mean to use them, if they ever become a part of the language, it will just be a prolific thing
17:41:11ldleworkeven if you intend to use it or not
17:41:24ldleworkalways use one space, to avoid the feature, except when you accidentally dont
17:42:01ldleworkchanging call semantics!
17:42:03ldleworkcrazy
17:43:09Araq0*shrug* it's just another of Nim's features that's ahead of its time
17:43:16Araq0perhaps by a decade
17:43:23gokr1Ehm.
17:43:30ldleworkBecause humans will be better at tedium then.
17:43:52ldleworkAnd come to learn to love debugging subtle bugs that have nothing to do with their implementation but the language itself.
17:43:55gokr1If it's about pleasing math people - then go "full retard" and do something like Fortress or something.
17:43:55ldleworkI see your point.
17:43:55EXetoCI find it easy to parse. most people don't?
17:44:09ldleworkEXetoC: its extremely subtle
17:44:23Araq0gokr1: it's about pleasing *me*, I like it
17:44:24ldleworkAnd tedious
17:44:54EXetoCbut the optionality is the problem, and so people shouldn't use it in production code imo, because then you need to remember if it has been enabled
17:44:58gokr1I like simplification. I like small languages. I don't like featuritis.
17:45:08gokr1EXetoC: Agreed.
17:45:15ldleworkparenthesis are not even a problem that anyone asked to be fixed
17:45:25EXetoCI would like at least some of these rules to make it into the language if we are to keep the command syntax. otherwise it just gets in the way
17:45:28ldleworkI've literally never heard anyone in any context ever complain about parens being used to specify precedence
17:45:40gokr1If its not optional, then I guess one can learn to be used to it. But being optional... it can come up and BITE whenever it pleases.
17:46:19gokr1ldlework: People tend to make fun of Smalltalk because you need to write "3 + (4 * 5)"
17:46:28EXetoCjust recommend that people use it only for the purpose of testing
17:46:46gokr1But Smalltalkers appreciate the simple rules of precedence and can live with a paren here and there.
17:46:48ldleworkStrong Spaces is totally going to be a thing Nim becomes known for
17:46:59Araq0as I said, this all fantasy arguments
17:47:05Araq0try it, report it doesn't work
17:47:14ldleworkAraq0: no doubt it does what it says
17:47:45gokr1Araq0: I don't think the real problem is understood until we have lots of Nim code - and a bit of it uses this here and there. And most of it does not.
17:48:03*ldlework looks at his own Nim code and sees varying usage of space in callsites and arithmatic statements
17:48:25ldleworklet me go visually insepct every line of Nim code I ever wrote :)
17:48:35Araq0gokr1: the question is: how do we get experience with the feature otherwise?
17:49:00Araq0how do *you* implement experimental features in a programming language?
17:49:03gokr1Araq0: At the same time, I like "new thinking" and radical shit. I just don't like corner cases, featuritis etc
17:49:32ldleworkI'm definitely all for clever new language things that make my life easier, yeah
17:49:49Araq0making it optional for now and see what's eventually out there is the only way to gain these insights IMO
17:50:47gokr1Araq0: Well, ok, I can buy that. Where exactly is this enabled btw, if you use it?
17:50:52ldleworkAraq0: could you potentially live with a Nim where this feature doesn't make the cut?
17:51:01Araq0ldlework: yes.
17:51:25EXetoCgokr1: probably only in the module containing the directory
17:51:47Araq0gokr1: I want koch.nim to use it :-)
17:51:51EXetoCsince that's where you define it, rather than with a nim argument
17:52:01gokr1So its at the top of a module or?
17:52:18Araq0the #! is only valid as the first line
17:52:48ldleworkForums could use search, but I bet that's hard
17:53:15gokr1"parser directive"... is that described somewhere?
17:53:17willwillsondidn't you see the post where some guy implemented it?
17:53:24EXetoCAraq0: if everyone would want to kill it with fire, would something be done about "echo $foo" still?
17:53:46Araq0you could even make your editor mark the code with some different background color when it encounters #! strongSpaces, but by then we should consider to remove the feature
17:53:49*vendethiel quit (Ping timeout: 255 seconds)
17:53:54willwillsonldlework: http://forum.nimrod-lang.org/t/622
17:53:57EXetoCldlework: the new forum has it. it'll go live soon I think
17:54:08ldlework:D
17:54:10EXetoCthere we go
17:54:29ldleworkwillwillson: I'm just starting to try to use the forum more
17:55:10gokr1willwillson: I have a hard time remembering to keep track of pull sources of info. Like web forums.
17:55:44EXetoCuse rss
17:55:58EXetoCI'll go do that now
17:56:04Araq0EXetoC: hrm, yeah I guess we can support 'echo $foo' but not 'i+1 * 3'
17:57:00*vendethiel joined #nimrod
17:57:07Araq0ldlework: btw you're wrong, people do complain about having to use () all the time, I certainly do
17:57:21ldleworkYou're the first I've seen
17:57:28Araq0in Delphi you're stuck with if (a = b) and (c = d) then ...
17:57:44ldleworkWhen typing a mathematical expression: A) type parens at the speed of thought B) spend extra minutes sitting there tinkering with space formatting
17:58:20Araq0except that I enjoy the formating anyway, because () is not really readable either when nested
17:58:31ldleworkWhen reading a mathematical expression: A) interpret parens at the speed of reading B) spend extra minutes parsing visually ambiguous spacing
17:58:32gokr1It's kinda funny, but I use *less* parens in Smalltalk than other languages (not the other way around) since in Smalltalk I trivially understand the precedence. In most other languages I always "make sure".
17:58:36Araq0it's exactly the old {} vs indentation argument
17:58:48EXetoCwell I don't find it difficult
17:59:16Araq0it's just that by now many people can accept indentation based syntaxes (many still cannot)
17:59:17EXetoChas this been discussed on the forums? if so, what percentage of people disagreed?
17:59:22ldleworkGive some non-trivial examples
17:59:38gokr1Araq0: Either way, keep up the good work. We can see how it pans out.
17:59:38EXetoCAraq0: very true
18:00:12ldlework(-b + sqrt(b * b - 4 * a * c)) / (2 * a);
18:00:19ldleworkThis is trivially parsable with the eye
18:00:28Araq0and it continues to work
18:00:32gokr1One issue is of course that people tend to have different "styles" when it comes to spacing in these expressions.
18:00:47ldleworkAraq0: how does it look with the parens removed?
18:00:56gokr1Some really like to fluff it up with spaces between every little thing.
18:01:29gokr1Perhaps we should just go "all the way" and move to "rendered code" :)
18:01:34EXetoCbut wouldn't x*y+z be the same as x * y + z?
18:02:17gokr1Ok, gotta go - I am freezing my hands off (in an ice rink) and time to play badminton :) cya guys
18:02:45*milosn quit (Ping timeout: 272 seconds)
18:03:18ldleworkDoes anyone want to give the Strong Spaces version of, (-b + sqrt(b * b - 4 * a * c)) / (2 * a);
18:04:02Araq0ldlework: well it's the same
18:04:10Araq0but you can write it as:
18:04:26Araq0-b+sqrt(b * b - 4 * a * c) / 2*a
18:04:49*gokr1 quit (Quit: Leaving.)
18:05:02Araq0or as -b+sqrt(b*b - 4*a*c) / 2*a
18:05:02*q66 joined #nimrod
18:05:21ldleworkOkay let me ask around
18:06:06*kostya_ quit (Remote host closed the connection)
18:06:36Araq0ldlework: we can even go so far to make it an error when + and * and the spaces disagree: a+b * 3 # invalid
18:06:55Araq0but I don't think it's necessary
18:07:45ldleworkAraq0: wouldn't the whole point be to be able to squish a plus b together to override the precedence of the multiplication?
18:07:59EXetoChm
18:09:01Araq0ldlework: yes, but + and * are not my primary concern. I long for the feature for | and & and %
18:09:27Araq0which means more special casing of course ...
18:11:12*vendethiel quit (Quit: q+)
18:11:18*Demos joined #nimrod
18:11:34*vendethiel joined #nimrod
18:12:00Araq0"foo $#"&"bar $#" % [a, b]
18:12:28Araq0vs: "foo " & "bar $#"%[a]
18:14:06Araq0putting () is babysitting the compiler when it ignores the spacing; then the compiler doesn't look at the code the way I do
18:20:37*milosn joined #nimrod
18:21:13ldleworkheh, from the initial impressions in some public places, I don't think I need to worry about whether strong spaces will be popular or not
18:22:15Araq0lol, as if I don't know
18:23:56ekarlso-hmm not many gh hits for nim vs rust
18:24:57EXetoCit wasn't long ago that the language was renamed
18:25:05ekarlso-rly ?
18:25:12*jhc76 quit (Quit: Leaving)
18:26:03Araq0ekarlso-: rust is backed by mozilla, Nim has no chance against it. but who cares as long as we can get a community big enough?
18:26:14ldleworkIn #python-offtopic a guy was raving about Rust (which I also really like too)
18:26:25ldleworkAnd I was like "I've love Rust but I've been writing Nim"
18:26:30ldleworkOhh what's that, he asks
18:26:43ldleworkSo I show him some simple Nim code implementing a basic state machine
18:26:55ldleworkHe's like Oh let me try to implement that in Rust
18:27:01ldlework40 minutes later...
18:27:07ldlework"I think I'll need unsafe for this"
18:27:31ldleworkRust is cool, but it has heavy cognitive costs, imo
18:28:05Araq0I don't mind the cognitive costs, I mind the language design by fear
18:28:25ldleworkI definitely don't want to spend time thinking about how to express my design in the language
18:28:36ldleworkI've already spent too much time thinking about that design in the first place
18:28:58ldleworkAnytime I waste not inputting solved design in my head, into compilable code in my editor, is time squandered
18:29:42Araq0you cannot use C++ for decades and then design a language. it doesn't work, you will fear everything. ;-)
18:29:43ldleworkNim is incredibly good at not having odd constructs that stop me and make me think too much about how to use them in the first place
18:29:53ldleworkSo I hope it keeps up with that
18:30:15Araq0well the design is pretty frozen, look at the list of upcoming changes
18:30:25Araq0these are all minor things
18:30:52ldleworkYeah definitely, I'm more just speaking emotionally than remarking on anything specific
18:31:03ldleworkI have written more code in the last few weeks than I have in several months
18:35:00ekarlso-just see theres a bigger community in rust but i guess thats much due to moz
18:35:41ldleworkekarlso-: its no surprise
18:37:49Araq0ekarlso-: yeah but again, afaict Nim will become big enough to sustain an ecosystem. Nobody switches from C# to Java just because Java's ecosystem is bigger.
18:38:13Araq0you only need to become big enough, you don't have to conquer the world
18:39:50Araq0Python is also much larger than Ruby but I can find a Ruby library for everything I need. Well that's my impression at least, I don't use Ruby.
18:40:25EXetoCtrue
18:50:42DemosYeah, nim does a really good job of getting out of the way, feels a little like C in that reguard
18:51:33*Trustable quit (Remote host closed the connection)
18:51:50ekarlso-i really like to have libs for most stuff
18:54:20EXetoCyeah well
18:58:14*Varriount joined #nimrod
18:59:55*hguux_ quit (Read error: Connection reset by peer)
19:00:13Araq0ekarlso-: the library situation is not bad and improving
19:01:37ldleworkEXetoC: you should write an article on how you performed the libtcod wrapping
19:01:43*superfunc joined #nimrod
19:01:46ldleworkas a guide for others who want to write additional wrappers
19:01:55ldleworkseems like it was a good usecase, multiple files, etc
19:01:57*hguux_ joined #nimrod
19:02:09EXetoCat least most of the people who are making things publically available seem to be writing libs
19:03:09VarriountAraq: Which is better: "type Bar = object of ref Foo" or "type Bar = ref object of Foo"?
19:03:12EXetoCldlework: what about that c2nim article?
19:03:28ldleworkEXetoC: its good but doesn't really fill in all the details
19:03:56ldleworkEXetoC: mentioning the transformations you had to make to the source and so on would provide a lot more insight than just 'hey there's a thing called c2nim' and some mere mentions that transformations were made
19:04:06ldleworkIts a good very high-level article
19:07:12Araq0Varriount: well these don't do the same
19:07:28Araq0your first Bar is an object, your second a 'ref object'
19:07:46ldleworkAraq0: where is the best explanation of all those things you can put after =
19:07:51Araq0inheritance is only allowed for 'ref object' because the underlying object type might be anonymous
19:08:08Araq0thanks to the Foo = ref object notation
19:09:00Araq0ldlework: I don't know what kind of advice you seek
19:09:28ldleworkAraq0: like, object, ref object, ref T, object of T, and so on
19:09:37Araq0there is not much when it comes to types, it either creates an alias or a new type
19:09:54Araq0'ref object', 'object', 'distinct' and 'enum' create new types
19:10:04Araq0all other introduce type aliases
19:11:02Araq0when you use 'of' you enable inheritance, otherwise 'object' is really just a C struct
19:11:27Araq0there are a couple of pragmas that influence it too, but the .pure, final stuff is mostly obsolete
19:11:45Araq0(we're quite bad at updating old code)
19:13:17Araq0there is lots of code out there that uses .inheritable when it really should not
19:13:29Araq0it should use 'of RootObj' instead
19:13:44EXetoCoh, it was renamed
19:13:56EXetoCnm
19:14:25Araq0unless you are me and know what you're doing and you really need .inheritable without 'of RootObj' :P
19:15:31EXetoCI always forget to add byCopy to C types
19:16:56ldleworkI wish sometimes that Nim would implicitly cast between int types for me
19:17:04ldleworkSpecially when working with C api's
19:18:23EXetoCimplicit casting is only allowed when there's no chance of information loss
19:18:43ldleworkyeah :(
19:21:01Araq0EXetoC: byCopy is rarely necessary though. most C APIs pass pointers to structs and these are safe either way
19:21:23Araq0but I guess c2nim should add it anyway
19:21:48ldleworkWhat's the difference between int and cint?
19:21:59EXetoCthe type is often opaque when that's the case
19:22:31Araq0ldlework: I can feel your pain but a special .lenient pragma would be yet another thing people will complain about
19:22:54ldleworkAraq0: maybe if it were restricted to just the wrapper modules?
19:23:03Varriountldlework: In nim, sizeof(Int) == sizeof(Pointer),
19:23:11ldleworkAraq0: so when you generate a binding, it exposes normal ints on the Nim side and converts them to cint on the C side or something
19:23:14Araq0"what do you mean? that is 2 languages in one!"
19:23:20EXetoCdocumented in the system module
19:23:31Araq0"I can imagine that it is a bad idea and error prone"
19:23:50Araq0"There should be only one way to do things"
19:24:36Araq0essentially the arguments that I got for 'strongSpaces' :P
19:24:49ldleworkAraq0: I think I'm more thinking like something you can do in the dynlib definitions to say, "hey expose this as an int but convert to and from cint"
19:24:52VarriountAraq0: I like strongspaces
19:25:35ldleworkVarriount: as in the legitimately speed up your rendering and visual perception of nested expressions?
19:25:38EXetoCldlework: isn't this a case of just saving a couple of characters though? which we discussed before
19:25:51ldleworkEXetoC: over the entire program though
19:26:09ldleworkI have .cint's everywhere
19:26:11Varriountldlework: Yep. And they make custom operators more pragmatic.
19:26:20Araq0ldlework: what we can do however
19:26:29Araq0is introduce a module with converters
19:26:37Araq0so you can do: import lenient
19:26:49Araq0and then int will be converted to cint
19:27:05Araq0so thankfully no language feature is required, in fact
19:27:07Araq0but
19:27:28Araq0people don't care because the "stdlib IS THE LANGUAGE"
19:28:12VarriountI don't think that...
19:28:13ldleworkAraq0: can you make strongspaces a module thing too?
19:28:17ldlework:)
19:28:21Araq0ldlework: he he he, no.
19:29:10EXetoCso some people have lousy opinions. who would have thought :p
19:37:07Araq0ldlework: we could introduce lisp like reader macros and perhaps than strongSpaces can be implemented as a library
19:37:18Araq0but Lisp like reader macros are evil
19:42:34VarriountAraq: Couldn't template filters be used to make reader macros?
19:45:08VarriountAraq: Also, what are your thoughts on multiple inheritance?
19:45:21Araq0Varriount: i like it, but it's hard to implement
19:46:23Araq0the arguments I heard against it all apply to some extend to single inheritance
19:46:48ldleworkmultiple-inheritance with explicit resolution is not bad
19:46:51Araq0and interfaces+SI is worse than MI for the simple reason that it makes people choose where no choice is necessary
19:47:06ldleworkBasically Stateful Traits
19:47:16Araq0ldlework: yep
19:47:17ldleworkor Explicit Mixins
19:47:45Araq0last time I checked MI is also more efficient than Java-like interfaces + SI
19:47:45ldleworkAraq0: its too bad you didn't start this project 10 years ago
19:47:54ldleworkI could have written a lot more software by now :)
19:49:13Araq0I don't like inheritance at all really, but if you're into it, you might as well use MI, I don't see the problem
19:49:58VarriountAraq: Pluggable objects?
19:50:11Araq0but as I said, it's hard to implement and we have enough work to do
19:54:07*brson joined #nimrod
19:55:51wanTalking about lenient (might be related), when I want to do `var a: tuple[x, y: float32] = (1.0'f32, 1.5'f32)` and NOT have the 'f32 suffixes (these become really cumbersome when defining matrices etc), would it allow it or is there some better way to achieve it?
19:58:11Araq0wan: well I don't know. you can already omit the tuple definition
19:59:20wanWell that was a short example, I am actually using vectors and matrix types already defined
19:59:46wanAnd for OpenGL you need float32
19:59:51VarriountHm.. Technically, you can already implement MI via value types and pointer casting
20:00:12VarriountAlthough you can't do virtual inheritance
20:01:05Araq0wan: your best option is a macro
20:01:38wanHmm, okay, I'll do that then. Thanks
20:01:40Araq0toF(1, 2, 3) --> (1.0'f32, 2.0'f32, 3.0'f32)
20:01:58Araq0in fact
20:02:04Araq0you should go crazy:
20:02:14Araq0toF"1 2 3; 2 3 4" # matrix
20:02:23Araq0toF"1 2 4.0 2" # vector
20:02:28wanHa, interesting
20:03:19Araq0and submit it to the opengl wrapper
20:03:21*Boggart joined #nimrod
20:03:22wanlosing the `,` in matrix initialization might make it more readable
20:03:30wanmacro it is
20:04:10wanit might however be beneficial outside of opengl too
20:04:26Araq0yeah, it should be put in its own module for sure
20:06:26Araq0hi Boggart welcome
20:07:02BoggartHello
20:07:03wanAraq0: I want to use parseExpr in the macro body, right?
20:07:08BoggartI'm having trouble getting c2nim to work on this file, errors are at the bottom. I'd appreciate any help: http://pastebin.com/ESxagsPb
20:07:52BoggartIt complains of a missing bracket, when the bracket is further along in the line, same with the missing ; error
20:08:34Araq0wan: do you? I usually don't
20:08:53Araq0but hrm
20:08:58Araq0yeah, it makes sense here
20:09:17wanoh right, "1 1.1 2" is not a valid nim expression, it won't give me the thing I want
20:09:24wanor would it?
20:10:07Araq0no, but it's a 'split' away
20:10:27Araq0Boggart: #def WINAPI and read c2nim's docs please
20:11:16Araq0c2nim is stupid, but helps with the grunt work once you learned its pecularities
20:14:55*Mat4 joined #nimrod
20:14:59Mat4hi all
20:15:04Araq0servus
20:15:14Mat4hi Araq
20:18:55Araq0Mat4: you promised us a C compiler iirc
20:19:07ldleworklol
20:20:41BoggartThanks Araq0
20:23:53Mat4Araq0: I'm working on it (the prefered 8cc is quite buggy so I abandoned a port, working now porting TCC which I've found more stable)
20:24:42Araq0Mat4: remember that it only needs to be able to parse what Nim emits really and we can tweak that output
20:25:12Araq0though .emit will suffer a bit then
20:25:47dts|pokeballso is nim ever going to be a compiler that actually generates an exe or is the plan to usually have it compile to c*?
20:28:37Araq0dts|pokeball: native codegen will come eventually, but not before 2.0
20:28:50ldleworkAre there any examples of the graphics module laying around?
20:28:52dts|pokeball1.0 just came out right?
20:28:58Araq0nope
20:29:05dts|pokeballoops
20:29:24EXetoCldlework: yes, in the module itself
20:29:29ldleworkorly
20:29:31ldleworkbtw
20:29:38ldleworkthe docs should link to the source
20:30:03Araq0ldlework: we had that feature but it broke and gradha isn't here to fix it
20:30:26ldleworkEXetoC: oh cool thanks I found it
20:30:30Araq0had to disable it for 0.9.6, really annoying
20:31:08Mat4dts|pokeball: The plan is to port a C compiler to Nim so the language does not depend on it any more
20:31:26dts|pokeball:D
20:31:26dts|pokeballwhich c compiler?
20:31:46Mat4as written, I'm working on a port of TCC
20:32:07dts|pokeballis there a public repo for it? because i would love to help with that
20:32:47Mat4that would be great :) http://bellard.org/tcc/
20:33:49dts|pokeballin this version, are you porting the source of the compiler to nim, or just the input accepted?
20:34:29ldleworkThe inability to figure out where names come from because of the import system is truly the most annoying thing
20:34:32Araq0bbl
20:34:35*Araq0 quit (Quit: Page closed)
20:35:18Mat4I have written a backend and IL representation already before (that's the part the author does not finished). Now I'm porting the source to Nim
20:35:35dts|pokeballnice
20:37:23ldleworkEXetoC: hmm, I have libsdl-ttf2.0-0 installed but I get could not load: libSDL_ttf.so(|.1|.0)
20:38:46Mat4dts|pokeball; Wait until I'm upload my work on friday, then just pick up one of the C sources left (and please inform me on which file you work so we do not duplicate efforts)
20:39:08*flaviu joined #nimrod
20:39:44dts|pokeballok
20:39:47Mat4it is not much work, I have only not much spare? time for it
20:40:00Mat4so thanks
20:41:36dts|pokeballi love compiler development, so this is like christmas for me
20:41:58dts|pokeballnim still uses TFile right? not File?
20:42:49ldleworkI'm so confused
20:45:25EXetoCldlework: so you have SDL 1 and not SDL 2?
20:45:56ldleworkEXetoC: I have SDL 2 fairly sure
20:46:17EXetoCI meant the other way around
20:46:31ldleworkI have SDL 2 yeah
20:48:06ldleworkI have both apparently
20:48:29ldleworkIt seems to link to SDL fine
20:48:34ldleworkit fails when linking to ttf
20:48:41ldleworkEXetoC: ^
20:49:05EXetoCSDL_ttf then
20:49:37ldleworkEXetoC: there is no such thi
20:50:01ldleworkThe only thing that exists on the internet as far as I can see is a thing called "SDL_ttf 2.0"
20:50:10ldleworkubuntu has no non-2 ttf package
20:50:20ldleworkand the ttf project's website doesn't offer a non-2 package or source
20:51:02EXetoChttp://www.libsdl.org/projects/SDL_ttf/release/
20:52:14ldleworkEXetoC: so I'm supposed to install 1.2?
20:52:41EXetoCdidn't you say there was an ubuntu package for SDL_ttf 1 too?
20:52:57dts|pokeballso i realized what python reminds me of. fortran and python mixed together
20:53:15dts|pokeballso i realized what nim** reminds me of. fortran and python mixed together
20:53:27ldleworkEXetoC: libsdl-ttf2.0-0 - TrueType Font library for Simple DirectMedia Layer 1.2, libraries
20:53:30ldleworkis the only library in my repos
20:54:35*Trustable joined #nimrod
20:55:11EXetoCthe so file must have another name then
20:56:15ldleworkI also have libfreetype6 and libfreetype6-dev installed and I ttf 1.2 wont compile
20:56:34ldlework*** Unable to find FreeType library (http://www.freetype.org/)
20:56:42ldleworkIts definitely installed :(
20:57:04dom96ldlework: maybe the filename in the wrapper is wrong?
20:57:31EXetoClibSDL_ttf.so(|.1|.0)
20:58:00EXetoCcheck the file list for the package
20:58:06EXetoCyou could just create a symlink
20:58:23ldleworkI did create a symlink
20:58:27ldleworkyou know it does say "Couldn't load"
20:58:30ldleworkrather than "couldn't find"
20:59:08EXetoCoh yes, those helpful error messages
20:59:20ldleworkhttps://gist.github.com/dustinlacewell/a61f67b2c189ec228f9f
20:59:27ldleworkare my ttf symlinks, etc
20:59:57ldleworkwoah
21:00:07ldleworkmodifying sdl_ttf.nim to point directly at the symlink target made it work
21:00:09ldleworkdafuq
21:00:11*tinAndi joined #nimrod
21:00:44ldleworkdoes it not work against symlinks?
21:00:58EXetoCbut now it's pointing to the lib for SDL 2, I think
21:01:22EXetoCI don't know if it matters
21:02:26ldleworkEXetoC: if I hard code sdl_ttf.nim to use libSDL2_ttf-2.0.so.0.10.2
21:02:27ldleworkit works
21:02:38ldleworkif I hardcode sdl_ttf.nim to use a symlink pointing at that, it fails
21:04:11EXetoCcreate a hard copy then
21:05:33ldleworkdoesn't work
21:05:44Araqldlework: you can also use --dynlibOverride:SDL_ttf and link against SDL_tff.a
21:05:57Araqor libSDL_tff.a or whatever it's called
21:06:04EXetoChow can it not?
21:06:37EXetoCdon't make a hard copy of the symlink
21:06:45ldleworkEXetoC: I didn't
21:06:49EXetoC:o
21:07:02EXetoCI don't think you should have to run ldconfig in this case
21:07:08EXetoCbut try to run it as root
21:07:22EXetoCand try again
21:08:12Araqthe SDF_ttf dependency really sucks, I remember I wasn't able to find the DLL either
21:08:25Araqand 2.0 is not compatible, as usual
21:10:22ldleworkEXetoC: https://gist.github.com/dustinlacewell/0075e75f66e53c19dc20
21:10:44ldleworkIf I update sdl_ttf.nim to point directly at libSDL2_ttf-2.0.so.0.10.2 everything works fine
21:11:00ldleworkI agree that this makes no sense, but that is the actual shell transcript
21:11:39Araqmaybe 2.0 is compatible enough?
21:12:39ldleworkThey are the same file
21:12:56ldleworkI hardlinked libSDL_ttf.so to libSDL2_ttf-2.0.so.0.10.2
21:13:06ldleworkBut the binary only executes when I'm linked directly to libSDL2_ttf-2.0.so.0.10.2
21:13:09Mat4Araq: Probably you will find similar problems with Allegro
21:13:55AraqMat4: well we simply need to port to 2.0 properly, I hope
21:14:04Araqand then it will be stable for another decade
21:14:14*Araq really likes that SDL moves slowly
21:14:25*ldlework forks Nim for now.
21:14:50Araqldlework: why? you can add a pattern instead with |
21:15:01ldleworkAraq: for my specific lib version?
21:15:07Araqyeah
21:15:10ldleworkDoubt we want that ...
21:15:14Araqyou're on ubu, right?
21:15:49ldleworkyeah
21:16:12ldleworkIs there a way to query ld for where it is getting a library from?
21:16:31ldleworkMaybe I have a libSDL_ttf.so somewhere in an earlier path so the hardlink isn't found
21:16:35ldleworkI'll name it something unique
21:17:06ldleworkcould not load "wtf.so"
21:17:18ldleworkwhy the fuck not, its a hard-link to the thing you just linked to fine
21:17:26*willwillson left #nimrod (#nimrod)
21:17:35Araqas I said, you can use --dynlibOverride and take the C route
21:17:46*willwillson joined #nimrod
21:18:04Araqof building against "shared" libraries
21:19:06*AMorpork is now known as AFKMorpork
21:20:08ldleworkThat just makes the linker fail to find implementations of TTF's functions
21:20:53flaviuAraq: Can you comment on https://github.com/Araq/Nimrod/issues/782 ?
21:21:25flaviuParticularly the stuff at the bottom, feel free to ignore the patch for now.
21:24:58*quasinoxen joined #nimrod
21:25:01Araqdom96 needs to review the patch
21:25:11AraqI know nothing about these things
21:25:22Araqlooks fine to me though
21:25:36ldleworkAraq: using that string | syntax how can I specify that part of the string is optional?
21:25:38ldlework(foo|)
21:25:40ldlework?
21:25:46Araqyes
21:25:52ldleworkha that worked
21:25:53*milosn quit (Ping timeout: 252 seconds)
21:25:56ldleworkokay I'll submit a patch to fix this
21:26:07Araqgreat
21:26:16Araqflaviu: I commented
21:26:35dom96Araq: flaviu: that looks really annoying.
21:26:40dom96Is the cacert really necessary?
21:26:48dom96doesn't the OS have it somewhere?
21:26:49flaviudom96: Yes.
21:27:00flaviuNo to the last question on linux
21:27:29flaviuYes on windows, but as everyone knows, the windows apis are really excellent /s
21:29:07flaviuNo on mac it looks like
21:30:13*gokr_ joined #nimrod
21:30:17Araqflaviu: can't tell if you're serious
21:30:39AraqI can't possibly have convinced you
21:30:49flaviuwrt the windows api comment? no, I'm not serious
21:31:32flaviuI saw uppercase types and hungarian notation and I was instantly convinced to run away.
21:32:11*gokr quit (Ping timeout: 244 seconds)
21:33:26Araqgood.
21:34:28Araqas a programmer you shouldn't care about documentation or stability when you instead can focus on superficial ugliness
21:34:49*gour quit (Quit: Konversation terminated!)
21:35:09ldleworkAt least we agree
21:35:12EXetoCflaviu: so, systems hungarian?
21:35:29flaviuAraq: Exactly!
21:35:29flaviuSeriously though, the windows APIs aren't the best documented either.
21:36:00Araqit works so much better than posix it's not even funny, but feel to disagree
21:36:38ldleworkhttps://github.com/Araq/Nimrod/pull/1702
21:37:21ldleworkYeah I love userland api's that let me patch arbitrary memory
21:37:24ldleworkWindow's is good for that
21:37:28flaviuI don't want to start a flame war, so I don't disagree.
21:37:39flaviu*won't
21:38:02Araqldlework: stuck with windows 95?
21:38:17*BitPuffin quit (Ping timeout: 264 seconds)
21:38:32ldleworkAraq: this was true until vista
21:39:05ldleworkI spent around 3 years in black-hat reverse enginering circles and I learned just how bad the WinAPI is from that perspective
21:39:22ldleworkIn terms of writing applications, its not bad, if a bit verbose but linux is the same way, really
21:39:40Araq*shrug* it's not that any OS written in fucking C is secure anyway
21:39:51ldleworkAraq: agreed
21:40:59Mat4Araq: the Windows API is certainly better structured, but it is much more extensive than POSIX
21:42:32Araqit's not good, it's horrible. it's just that Posix is worse.
21:43:01Araqand objectively maintaining Nim for Posix is more work than the windows specific parts
21:43:30Araqoh so execvpe doesn't run with ulibC
21:43:51Araqetc.
21:45:55*Jesin quit (Quit: Leaving)
21:46:38*saml quit (Quit: Leaving)
21:47:01Mat4it's the same problem as with ANSI C (and it's standard libraries in all of there inconsistencies)
21:47:40*saml joined #nimrod
21:48:45Araqflaviu: http://www.reddit.com/r/linux/comments/2o1r3w/the_impact_of_the_linux_philosophy/cmj6ulc
21:49:42*Jesin joined #nimrod
21:49:55flaviuAraq: I really don't want to get involved in this flame war yet again
21:50:06*milosn joined #nimrod
21:50:11Araqno my neither
21:50:12Araq*me
21:50:16Araqhence the link
21:50:23Araqthey discussed it out for us ;-)
21:50:53*enquora joined #nimrod
21:51:50ldleworkI agree with this guy,
21:51:52ldleworkThe problem with dbus is that it's way too complicated and hidden to be useful to write against for everyday tasks, and so it completely ruins the competent/empowered users scheme that *nix used to have. There are professionals who can deal with dbus, and everyone else, as opposed to "you automate your environment by pasting the way you would do it by hand into a file, and sprinkling variables and control
21:51:54ldleworkstructures around it."
21:51:56ldleworkYou're learning and using a heavyweight application library (or fucking dbus-send+qdbus) and/or picking up an obscene amount of domain knowledge and writing more boilerplate than your actual program logic to talk to things via dbus because even the documentation[1] says the API is too hideous to use directly.
21:52:29AraqI find it remarkable that this comes from *reddit/linux*
21:53:32flaviuAnyway, all this is really off topic
21:53:51Araqoutch, yeah
21:54:42*gokr joined #nimrod
21:55:46Demosldlework, that paragraph could describe COM as well...
21:56:12ldleworkDemos: COM is in no way taking what we already do by hand, droping a few variables and control structures and going on with life
21:56:23ldleworknot by a long shot, in any context or universe
21:56:39Demosthat was not my point
21:56:48flaviuDemos, ldlework: It's off-topic, it'd be better if we avoided controversial issues like this.
21:57:03DemosCOM is learning a huge library to do fairly simple things
21:57:08Demosanyway, programming is hard
21:57:15ldleworkDemos: oh well, then sure I agree with you there :)
21:57:28ldleworkDemos: the paragraph was a dig on dbus as linux adopting the microsoft model
21:58:03Demospiping around text never seems to work that great except in really simple examples
21:58:11Araqflaviu is right, we have #nimrod-offtopic
21:58:12Mat4hmm, I think it's more DDL oriented ;)
21:58:13Demoslike piping things into grep is nice
21:59:47*dts|pokeball quit (Ping timeout: 258 seconds)
22:02:47Demoswhat is DDL?
22:02:47dom96flaviu: it's in /etc/pki/tls/certs/ca-bundle.crt on Linux from what I can see.
22:02:55dom96I'm sure Mac OS X has something similar.
22:03:08dom96Please figure out where to get it on Windows too.
22:03:35flaviudom96: Odd, but I don't have a /etc/pki/tls/certs on my system :)
22:03:51flaviuWindows uses the wincrypto api or something
22:04:11dom96What about /usr/share/ssl/certs/ca-bundle.crt ?
22:04:19flaviunope
22:04:58flaviu/usr/share/apps/kssl/ca-bundle.crt, /usr/share/ncat/ca-bundle.crt
22:04:59Mat4Demos: One predecessor of the COM Interface (I think it was introduced with Windows 1)
22:05:22ldleworkHow do I actually write something of the form, graphics.[]=(sur: PSurface, x: int, y: int, col: Color)
22:05:34ldleworks[x, y] = col
22:05:36ldlework?
22:06:01dom96flaviu: Looks like it's distro dependent :(
22:06:45flaviuyep
22:07:19ldleworkIf so, it doesn't seem to work
22:07:25Mat4Demos: also known as DDI (if I remembered correctly)
22:07:30ldleworkoh
22:08:40dom96flaviu: argh. SSL sure is annoying.
22:09:09ldleworkEXetoC: with the graphics module I am trying to do, surf.s.pixels[0, 0] = colBlack
22:09:34ldleworkoh
22:09:40ldleworkjust access the surface like a sequence
22:11:41Araqs[x,y] = col should work, ldlework
22:11:46ldleworkAraq: yeah
22:11:57ldleworkwho else thinks we need "for i in 50"
22:12:21flaviuldlework: What's that supposed to mean?
22:12:30ldlework"for i in 0..49"
22:12:30willwillsonfor i in 0..50: ?
22:12:33ldleworkjust like the array syntax
22:12:48willwillsoncan't you already do that?
22:12:55flaviumeh, too implicit for me. 0..49 isn't that bad
22:12:59AraqI think you can do: iterator `<` (x: int): int = ...
22:13:05Araqfor i in <50:
22:13:07ldleworkflaviu: more implicit than [50, int] ?
22:13:09ldleworkwhy?
22:13:38Araqldlework: try my suggestion please
22:13:41flaviuldlework: Because people expect arrays to work like that. C does it that way.
22:13:49ldleworkAraq: now I have to include that in every Nim progject
22:13:54tinAndiMat4: DDE with windows 2 then OLE with windows 3 and COM and COM+ after this
22:14:07Araqldlework: no. first you have to try it
22:14:16willwillsonflaviu: what do you think about the last answer on: http://stackoverflow.com/questions/10095676/openssl-reasonable-default-for-trusted-ca-certificates for windows/ mac?
22:14:38ldleworkAraq: "for i in <50" doesn't work
22:14:41Mat4tinAndi: thanks
22:14:50Araqdom96, flaviu I think we should ship that certificate stuff on our own
22:15:04Araqldlework: well you have to defined this iterator first
22:15:12willwillsonalso here are some default locations on linux: http://mercurial.selenic.com/wiki/CACertificates
22:15:14dom96Araq: I disagree.
22:15:22flaviuwillwillson: `etc/ssl/certs/ca-certificates.crt` doesn't exist on my system, and I bet I have the most modern version of linux here.
22:15:26ldleworkAraq: that's exactly what I mean by having to include it - even if it works, I'll just end up using 0..n-1
22:15:38willwillsonflaviu: what are you using?
22:16:06flaviuwillwillson: actually sorry. It does show up, I was just using the wrong query
22:16:37flaviuWell, I agree with dom96 and you now. Better to use the system's certs.
22:16:46dom96Good.
22:17:02flaviuIt's better for those using corporate proxies and such too
22:17:18dom96Add a function called "findCertDir"
22:17:22dom96and set it as the default cert path
22:17:40dom96*findCertFile
22:17:44flaviudom96: it doesn't work that way. You have to use weird APIs on both mac and windows.
22:17:52Araqldlework: well guess what. we might include it.
22:17:53dom96So use them.
22:18:25*superfunc quit (Ping timeout: 255 seconds)
22:18:49Araqwell findCertFile surely should check the distro then
22:19:03dom96nah
22:19:05Araqjust document which distros are supported
22:19:08dom96Just go through alist
22:19:14dom96*a list
22:19:15Araqoh yeah
22:19:22Araqthat's better lol
22:19:23dom96Distro detection isn't trivial.
22:19:32Araquname -a ?
22:20:12dom96That tells you nothing about the distro.
22:20:19flaviudom96: yes it does
22:20:28flaviubut why do we need to detect distros?
22:20:47dom96No it doesn't.
22:21:01dom96I don't see any mention of Ubuntu on my laptop.
22:21:01flaviu"3.17.4-1-ARCH"
22:21:08dom96That's your kernel name.
22:21:23dom96What if you compile it yourself?
22:21:29dom96It won't say "ARCH" then
22:21:29Araqjust make sure it works on ubuntu, people using other distros are used to the fact that nothing works anyway *cough*
22:21:49tinAndi:)
22:22:08flaviudom96: actually, yes it will, but the distro isn't important anyway
22:23:04Araqdom96 is right though, just try random directories and remember that the axiom of choice is not be questioned
22:23:23dom96flaviu: I guess it depends what you compile it on.
22:23:29dom96I have a 'generic' kernel.
22:24:26willwillsonmine says: "3.17.1-1-custom-will" ;D
22:25:09Araqwillwillson: I don't think so, Tim.
22:25:20flaviuAnyway, the distro doesn't really matter.
22:30:13ldleworkAraq: nice
22:30:15Mat4by the way: Have someone tried compiling Nim with one of the BSD's ?
22:30:30Mat4sorry, for one of the BSD's
22:30:42Araqldlework: hum?
22:31:49ldleworkAraq: home improvement reference
22:32:13dom96Mat4: It worked when I tried it, but that was a long time ago.
22:32:14Araqah, I was unsure how it's in english
22:32:14flaviuMat4: Yes. Nim is in openbsd's ports repo
22:33:05ldleworkAraq: you watch Home Improvement in a different language?!
22:33:13Mat4nice
22:33:37Araqldlework: lol, sure
22:34:01ldleworkAraq: what is "I don't think so, Tim" in the language you watch it in?
22:34:24Araq"Das glaube ich nicht, Tim"
22:38:08AraqI didn't even know it's "Home improvement" in english, lol
22:38:19AraqI always thought it's "tool time"
22:38:55ldleworklol
22:39:04ldleworkTool Time is the name of his TV show on the show
22:39:09Araqyeah I know
22:39:29Araqwillwillson: got your nick from this show?
22:39:55willwillsonAraq: nah, that must be why I didn't get the reference
22:40:24Araqah sorry. at least ldlework got it.
22:41:10willwillsonis it a good show?
22:42:02*Mat4 left #nimrod (#nimrod)
22:42:39AraqI think so, yeah
22:43:33Araqbut I have a weakness for crap on TV, so ask somebody else :P
22:44:16willwillsonmight have to find out who this willwillson character is now :D
22:45:11Araqit's the neighbor whose mouth you never ever can see
22:45:21Araqand who always knows everything
22:45:31Araqlike flaviu
22:45:43Araq(no offense!)
22:45:56flaviu:/
22:45:58*tinAndi quit (Quit: ChatZilla 0.9.91 [Firefox 34.0/20141125180439])
22:46:24DemosI tried getting nim working on openBSD and it did not work, must have been added to ports later
22:46:30Araqflaviu: no, I'm serious. I happen to know your age. you're a genius.
22:46:30DemosI know there is a FreeBSD port though
22:47:02flaviuDemos: Probably, I've never been able to keep then straight
22:48:00Demosthere are a lot of people working on nim that I suspect will show up in 15 years making 10x more than I will be ...
22:48:27AraqI remember pulling some PRs for BSD
22:48:32Araqso it *should* work
22:48:40AraqDemos: what's your problem?
22:48:58Demosmy problem is I tried it like a year ago
22:49:05DemosI may have written some of those PRs
22:49:20Araqnah that was kazmodan
22:49:46*BlaXpirit-UA quit (Quit: Quit Konversation)
22:50:01Araqor perhaps kokozedman
22:50:09flaviuAraq: I don't want complaints, I just don't want offensive comments.
22:50:31Demosyeah, I know I fixed something or other but never got the full toolchain working (like babel and whatnot)
22:52:17Araqflaviu: I am serious, but since it's IRC and it comes from me, I can understand you cannot believe me
22:52:51flaviuok, text really conveys emotions poorly
22:53:08flaviuthanks!
22:53:53Araqyou're welcome
22:57:43*superfunc joined #nimrod
22:59:08*perturbation joined #nimrod
23:03:39*gokr_ quit (Quit: IRC for Sailfish 0.8)
23:05:06*EXetoC quit (Quit: WeeChat 1.0.1)
23:05:52wanwillwillson: your nick make me think of another character, wilson wilson from Utopia
23:08:14wanldlework: have you solved your sdl problem? Are you using the sdl or sdl2 wrapper?
23:08:35ldleworkwan, all we needed was to support libSDL_ttf's new binary name format
23:08:41ldleworkI submitted a pull request
23:10:04Araqbtw can anybody confirm https://github.com/Araq/Nimrod/issues/1701 ?
23:10:16AraqI think I fixed that before 0.9.6
23:10:22Araqbut could be wrong
23:11:00Araqldlework: you got feedback for your PR
23:13:42perturbationAnyone experienced with Ruby and has some time for testing? I'm making progress on the pygments -> rouge lexer port for Nim, but I'd appreciate a 2nd set of eyes / sanity checking if possible.
23:13:52wanldlwork: ah ok. I am using sdl2, so I wondered which was affected and why
23:14:10perturbationin particular, it's *really* a one-to-one port of the pygments lexer, so it's probably very un-ruby-way-ish
23:14:28perturbation(not done yet, but progress is one the NimLexer branch of https://github.com/singularperturbation/rouge)
23:16:24ldleworkAraq: updated
23:20:52*superfunc quit (Ping timeout: 246 seconds)
23:21:45*vendethiel quit (Ping timeout: 252 seconds)
23:22:16*EXetoC joined #nimrod
23:23:30*kmcguire joined #nimrod
23:23:31Araqperturbation: I cannot see any nim(rod).rb
23:23:38Araqhi kmcguire welcome
23:23:51kmcguirehey
23:24:34perturbationit's not in the master branch - check NimLexer. Should be under lib/rouge/lexers/nim.rb
23:25:16ldleworkhi kmcguire
23:25:37perturbationhttps://github.com/singularperturbation/rouge/blob/NimLexer/lib/rouge/lexers/nim.rb
23:26:20*vendethiel joined #nimrod
23:33:31Araqperturbation: add 'defer' already to the list of keywords
23:41:30Araqperturbation: I also cannot stand that 'import from include' is special. just add these to the keywords list.
23:41:50Araqsome for OPWORDS but dom96 disagrees, so it's fine
23:41:50*dts|pokeball joined #nimrod
23:42:56*BitPuffin joined #nimrod
23:43:19perturbationthanks Araq
23:43:30Araqand if you want my opinion which I can't imagine but not deny myself either:
23:43:55Araqhttps://github.com/singularperturbation/rouge/blob/NimLexer/lib/rouge/lexers/nim.rb shows Ruby is a much better language than Python.
23:45:50perturbationI would agree with that, but I always liked Perl more than Python anyway, and Ruby feels like a cleaner Perl to me.
23:48:51ldleworkAraq: why does it show that?
23:49:40Araqldlework: because it's DSL friendly
23:50:19*Trustable quit (Quit: Leaving)
23:51:47ldleworkyou can do some neat things with `with` but yeah, point
23:51:51DemosI am getting really annoyed at python for having from blarg import * be broken
23:51:54Demosand not do what you want
23:53:22AraqDemos: lol, what do you mean?
23:53:40Araqpeople complain about Nim's import not working like Python's
23:54:07Demosfrom mod import * works like a textual include (more or less) not like just importing all the things in the module
23:54:18ldleworkDemos: err, what
23:54:20Demosand I think it is transitive
23:54:21Araqah, yeah
23:54:21ldleworkthat's not what it does at all
23:54:29Demoswell it is transitive
23:54:31Araqno Demos is right, ldlework
23:54:40ldleworktransitive?
23:54:43Araqit copies stuff into the current namespace
23:54:50Demosand being transitive is one of the main issues of the textual include method
23:54:55ldleworkit imports all top-level names in the module
23:55:05ldleworkit does not copy text or do anything textual
23:55:12Araqit doesn't import really
23:55:18Araqfrom foo import bar
23:55:21ldleworkI have no idea what distinction you're making
23:55:21Demosldlework, x = b and b = c -->x = c]
23:55:27Araqfoo.bar(x) # doesn't work
23:55:34ldleworkAraq: you haven't imported foo
23:55:38ldleworkyou have imported bar
23:55:55ldleworkimport foo; foo.bar(x)
23:56:04ldleworkIt literally manipulates a dictionary
23:56:06Demosldlework, more importantly if one module says from thing import * and another does from thatmod import * the second module gets all of thing as well
23:56:11Demoswhich is not cool at all
23:56:19Araqfair enough, but it surely is a gotcha, ldlework
23:56:21ldleworkIf you understand that each module is a dictionary
23:56:29ldleworkThis would be expected behavior
23:56:38ldleworkDemos: and Nim's situation is worse
23:56:41Demosso I have to list EVERY SINGLE THING that I use, or deal with writing pointless qualified names everywhere
23:56:55ldleworkDemos: yeah, that situation, is literally worse in Nim
23:57:08Demosright, but even if expected, it is not convenient
23:57:09Araqno, it isn't
23:57:17AraqNim is perfect
23:57:19ldleworklol
23:57:34Araqit is not transitive unless you beg for it via 'export'
23:57:36ldleworkAt least with Python, I can figure out where a name comes from without having to qualify
23:57:48ldleworkIn Nim, I have to grep my filesystem like an asshole
23:57:49Demosnim's module system is quite good. It avoids scary pitfalls while not having to qualify things or anything
23:58:12Demosldlework, you can use IDE tools
23:58:18ldleworkDemos: oh yeah which ones?
23:58:24DemosI think even the vim plugins supports it
23:58:25ldleworkthe one's that don't exist, or the one's that are currently broken?
23:58:28Demosand the VS one does
23:58:34Demosor the command line idetools command
23:58:38ldleworkbroken
23:58:47Demosnope
23:58:49Demosworking
23:58:51Demosjust not serve
23:59:01Demosand not terribly easy to use
23:59:24ldleworkAnyway
23:59:38ldleworkIf Nim let me import everything related to a type I would never mention the import system again