<< 28-02-2015 >>

00:00:57*reem quit (Remote host closed the connection)
00:01:15flaviufilwit: http://i.imgur.com/htLEu43.png
00:02:23flaviuThe background seems noisy, but at small sizes it blurs away.
00:03:03gmpreussner|workonionhammer: well, i was thinking about writing a nim scripting plugin for shitz and giggles, but there isn't really a use case right now, and i have too much on my backlog atm. maybe later this year :)
00:03:15*reem joined #nim
00:04:01onionhammershits and giggles *is* a good use case :P
00:05:06filwitflaviu: you want that for blogs and stuff? Def requested a version with the 'nim' words in for blogs (which I think is better than just having the logo by itself)
00:05:39flaviufilwit: No, the github repo icon.
00:06:21filwitflaviu: PS, it's important to make sure you have effects/strokes/pattern scaling on in Inkscape when resizing things like this (otherwise the glow effects wont look right)
00:06:27*reem quit (Remote host closed the connection)
00:06:29filwitflaviu: ah, okay. Looks great then
00:08:20flaviu"effects/strokes/pattern scaling"?
00:08:29*Nuew joined #nim
00:09:17NuewHello! Whenever I compile anything, I get "CC: packages\n
00:09:17NuewError: unhandled exception: The system cannot find the file specified.
00:09:17Nuew\n [OSError]\n
00:09:17Nuew> Process terminated with exit code 1"
00:09:20NuewAny Help?
00:09:48flaviuNuew: Are you running on windows? It sounds like nim is unable to find a C compiler.
00:10:13NuewYeah. That's strange though, I have cygwin and mingw in my path (mingw first)
00:10:40*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:11:03BlaXpiritNuew, people keep running into this problem
00:11:06BlaXpiritwhat did you do?
00:11:17flaviuTry --verbosity:3, does it get you any useful information?
00:11:28NuewOK, just rechecked my path, and things are gon
00:11:32Nuewstrange
00:11:36BlaXpiritI made instructions for installing, but it probably won't help you fix it http://blaxpirit.com/blog/8/avoid-problems-when-installing-nim-on-windows.html
00:12:04NuewYeah, cygwin somehow got removed from my path.
00:12:15NuewSorry to bother you!
00:12:44filwitflaviu: the 4 icons to the far right of the top toolbar (hover over them and they tell you what they do.. stroke, radius, gradient, & pattern scaling). Without them checked on, when you scale things that have patterns, gradients, etc.. those properties are dependent on those buttons.. I mostly have flattened everything (and I think effects automatically scale), so it should really be a problem. Just be aware of them.
00:13:39flaviufilwit: Looks like it's enabled by default, thanks for point that out though!
00:14:03*Hakaslak quit (Quit: TODO: Generate 'Part & Quit Message')
00:19:22flaviuDone! Github icon is now updated: https://avatars3.githubusercontent.com/u/603863?v=3&s=200
00:21:53BlaXpiritgood
00:22:18BlaXpiritcan't see the dots at all though
00:23:27BlaXpirit(on the actual page)
00:24:08flaviuIMO that's not a big deal. It'd be too noisy if the dots were visible.
00:24:29flaviuPeople with fancy 4k screens can see them, I'm sure.
00:27:19*Nuew quit (Quit: Leaving)
00:28:00filwitflaviu: awesome. Looks great!
00:28:42filwitflaviu: what IDE do you use for Nim, btw?
00:28:50flaviuVim with zah's plugin.
00:29:16filwitk, just wondering... wouldn't have pinned you for a vim guy
00:29:37BlaXpirit:D
00:29:54filwitbut then, I've barely used it, so I always see Vim as a 'l33t haxor' editor
00:30:46flaviuI'm certainly not a vim expert, but I do know a few useful commands.
00:30:54*brson joined #nim
00:31:45*reem joined #nim
00:33:05*reem quit (Remote host closed the connection)
00:36:06*dapz joined #nim
00:36:50reactormonkparseopt2 still a good way to go?
00:37:44flaviureactormonk: https://github.com/docopt/docopt.nim
00:38:14*dyu quit (Quit: Leaving)
00:38:17*dapz quit (Client Quit)
00:47:40VarriountCan anyone here give me a printout of the latest 'nimble --help'
00:47:42Varriount?
00:49:22*dapz joined #nim
00:52:52BlaXpiritVarriount, this is not latest probably https://bpaste.net/show/5b203fb7702b but what do you mean by latest?
00:53:37*dapz quit (Ping timeout: 250 seconds)
00:56:55*Menche quit (Ping timeout: 250 seconds)
01:00:38reactormonkhow do I get the argument vector?
01:01:10reactormonkaka argv
01:02:21BlaXpiritreactormonk, quote from docopt.nim
01:02:24BlaXpiritargv is an optional argument vector; by default docopt uses the argument vector passed to your program (commandLineParams()). Alternatively you can supply a list of strings like @["--verbose", "-o", "hai.txt"].
01:02:44BlaXpiritos.commandLineParams
01:03:04reactormonkah, thanks. I was looking for argv.
01:13:04*brson quit (Quit: leaving)
01:13:17*beier joined #nim
01:18:25*beier quit (Ping timeout: 264 seconds)
01:18:51*Menche joined #nim
01:20:13*gokr quit (Quit: Leaving.)
01:24:20*reem joined #nim
01:25:10*fizzbooze quit (Ping timeout: 255 seconds)
01:25:42*reem quit (Remote host closed the connection)
01:30:22BlaXpirithm how to reverse string
01:30:59BlaXpiritthis seems like a surprisingly hard task
01:32:33flaviuBlaXpirit: And it'll be a thousand times harder once you consider localization.
01:32:41BlaXpiritright
01:32:53BlaXpiritwell i mean i can write a for loop
01:32:58BlaXpiritbut what's the fun in that
01:33:14BlaXpiriti want oneliner/expression
01:33:44fowlBlaXpirit, unicode module has a reverse function in it, i can't speak for its accuracy
01:34:06BlaXpiritcool, thanks
01:38:27*Trustable quit (Remote host closed the connection)
01:43:12*Menche quit (Ping timeout: 245 seconds)
01:47:21*Menche joined #nim
01:48:28reactormonkHow do I get some random numbers? I'd like to produce a 32-char string from an array of chars
01:48:35reactormonk... randomly.
01:51:57flaviu.eval var data: array[32, char]; echo(escape(open("/dev/urandom").readChars(data, 0, 32)));
01:52:01Mimbusflaviu: eval.nim(4, 11) Error: type mismatch: got (int)
01:52:48flaviu.give reactormonk var data: array[32, char]; discard open("/dev/urandom").readChars(data, 0, 32); echo data;
01:52:52Mimbusreactormonk: 䕯ߝ(;›’”ǦL낧œ1ؔ”Š̫{{ƒŽ«}濿
01:53:33reactormonkflaviu, hm.
01:55:01reactormonkno readInt?
01:55:45*beier joined #nim
01:58:24*darkf joined #nim
02:02:15*pregressive quit (Remote host closed the connection)
02:03:06reactormonkHow do I cast array[4, int8] to int?
02:03:29*chemist69_ joined #nim
02:03:40fowlnewFileStream(open("/dev/urandom")).readInt32
02:03:51reactormonkduh.
02:04:51flaviureactormonk: casting array[4, int8] to int32 is incorrect because of endianness, although that doesn't matter much for random ints.
02:05:07fowlcast[ptr int32](arr[0].addr)[]
02:05:10reactormonkinitMersenneTwister(newFileStream(open("/dev/urandom")).readInt32) <- looks good?
02:05:30flaviufowl: type punning is undefined behavior.
02:06:22flaviureactormonk: MersenneTwister has 2KiB of state, 32 bits is insufficent.
02:06:25*chemist69 quit (Ping timeout: 250 seconds)
02:07:11fowlflaviu, it is?
02:07:13reactormonkflaviu, ah, it's already correctly inititalized in the library.
02:08:20*whitenoise quit (Quit: Connection closed for inactivity)
02:11:39flaviureactormonk: Maybe they somehow extend the value, but it's insufficient. An attacker an just try every seed from 0 to 2^32. (Not a big deal due to it being predictable after 623+1 results anyway)
02:12:41reactormonkflaviu, so I need to poke BlaXpirit to get a better rng? ^^
02:13:18flaviuChaCha or AES are good choices for that.
02:13:58BlaXpiritreactormonk, mersenne twister accepts array of bytes as argument
02:14:08BlaXpiritif you are talking about my lib
02:14:14reactormonkBlaXpirit, not needed, I see you're properly initializing it
02:15:34BlaXpiritoh actually it's a recent addition that it accepts array of bytes... unreleased yet
02:16:27reactormonkBlaXpirit, still, I'd say another random algorithm would be better, for better randomness. Doesn't matter to me.
02:16:47reactormonkAnd I'd error out if you can't initialize it correctly.
02:16:55reactormonkas in, with full 2k state.
02:17:02BlaXpiritthat's all gonna be there
02:17:09*jholland quit (Quit: Connection closed for inactivity)
02:17:15reactormonkkk
02:17:21BlaXpiritboth of your points are more than halfway done
02:17:36flaviuBlaXpirit: Have you considered adding ChaCha or AES?
02:18:09BlaXpirituh look, i can add whatever PRNGS
02:18:16BlaXpiritbut what's the real value of that
02:18:43flaviuCryptographic security and known performance.
02:19:06BlaXpiritright now im waiting for the license change in pcg and then will look into that uniform generation of floats
02:19:32BlaXpiritin more detail
02:20:46BlaXpiriti'm gonna need some assistance in picking these PRNGs
02:21:36BlaXpiritand maybe porting... but that's definitely not what has taken the most time
02:22:20BlaXpiritnight...
02:22:27*BlaXpirit quit (Quit: Quit Konversation)
02:24:41flaviufowl: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html#Violating%20Type%20Rules
02:26:56filwitdef-: I like the colors from your blog, I'm going to port them to Aporia. Do they have an official name? (i assume they're the sublime default?)
02:28:10flaviufilwit: hookrace.net/public/css.css scroll to the bottom :)
02:28:18def-filwit: I've never seen sublime so I don't know. I like them a lot too and I have them from pygments
02:28:34filwitflaviu: will take a look, thanks
02:28:36def-Yep, Monokai was the name
02:28:57filwitdef: they're not monokai colors, but they're close (i've already ported monokai)
02:30:40filwiti have sublime, what am i doing...
02:31:20beierwhat editor do you using for nim ?
02:31:29beierI use emacs
02:32:01filwithmm... you're right.. sublime lists them as Monokai... but they're definately not the same as MonoDevelop's monokai colors (well, at least not the version on your blog... the one in sublime is very close)
02:32:22def-I may have manually changed a few colors, but honestly can't remember
02:32:34filwitbeier: I'm porting my NimKate colors to Aporia and switching back to that IDE (cause people are working on proper suggest features for it currently)
02:32:42reactormonkDo we have anyone with OSX?
02:33:23def-beier: I'm using vim myself. lots of editor answers here: http://forum.nim-lang.org/t/844
02:33:43filwiti've have extending Aporia's highlighting a ton, and made even type-sections declarations highlight semantically correct (like the name's of the types are distinct).. it's pretty cool and i'm very happy with it so far
02:34:38filwitso far I've added 10 new colors to Aporia, including everything from Gokr's blog colors, VS 2013 colors, and a [mostly] carbon copy of github (new and classic) colors
02:36:04filwitthough my NimKate colors came up on the forums again, apparently people have been using it with QtCreator (for good GDB debugging)... so I may eventually get back to improving NimKate colors. I just don't feel like working on all of that right now.
02:36:44beierreactormonk: I'm osx 10.10
02:36:46filwitit just pisses me off they broke the color scheme stuff in KDE framework 5.6.0
02:36:59*gsingh93 quit (Ping timeout: 256 seconds)
02:36:59Varriountfilwit: I've been working on the Sublime Text Plugin
02:37:27filwitVarriount: nice.. i started to use that.. it's pretty nice
02:37:41VarriountIt's going from about 5 options to 50. It will be *completely* customizable.
02:37:59VarriountDown to console output for nearly every command.
02:38:20*reem joined #nim
02:38:32*Varriount laughs maniacally
02:38:48filwitVarriount: nice work. I spent a long time getting the semantic specialization working on type-sections.. if you're having problems with that, I might be able to help
02:39:18*akiradeveloper joined #nim
02:39:23Varriountfilwit: Improvements to the syntax highlighting and scoping are always welcome.
02:39:46reactormonkbeier, mostly because https://github.com/Araq/Nim/issues/2228 - can't really debug that stuff without an OSX.
02:39:53VarriountIt's actually the one area I've been avoiding - partially because it's always been 'good enough' for me, and partly because I dislike the parsing mechanism.
02:40:21filwitVarriount: though I'm not sure sublime is going to support the same regex features as gtksoureview 2 (the only way to get indent-sensitive type sections to highlight type-declarations distinctly is by using a special \%{0@start} sourceview syntax)
02:40:50Varriountfilwit: Well, the python highlighter manages it... somehow
02:41:30filwitVarriount: well that's good news, that means I could probably make it work... but then Python basically relies on a set number of spaces for indentation while Nim is 1+
02:41:59Varriountfilwit: Actually, no. It just has to be more than the previous level.
02:42:24filwitVarriount: okay, my mistake
02:42:35Varriountfilwit: It's ok, it's an easy one to make.
02:43:27filwitVarrount: do you have a repo with your sublime code i could take a look at? (and a link to the python colors)
02:43:36Varriountfilwit: Does Kate support plugins?
02:43:43filwitVarriount: yes
02:43:52Varriounthttps://github.com/Varriount/NimLime
02:43:53filwitidk why i keep typing your name...
02:43:57filwitthanks
02:44:20Varriountfilwit: Look and edit the YAML files first.
02:44:41filwiti'm not going to touch this anytime soon, i just want to take a look
02:44:58VarriountI use a converter that transforms the YAML into JSON. YAML is easier to read.
02:45:04filwiti spent too much time on Aporia already, my next step (after forum udpates) will be to update the Kate colors
02:45:24filwiti'm very unfamiliar with YAML, but i'll figure it out
02:45:59Varriountfilwit: It's ok if you don't have time. It's not vital.
02:46:05reactormonkbeier, could you copy & run this: http://pastie.org/9988711 ?
02:46:27Varriountfilwit: What plugins does Kate support?
02:46:58filwitVarriount: Kate supports a ton of different plugins, Javascript, Python, and Native ones I think
02:47:11filwitVarriount: it's color schemes are all it's own format however
02:47:39filwitVarriount: it's basically the same as gtksoureview stuff.. XML with regex
02:48:55reactormonkhow exactly do I use docopt? I get Error: type mismatch: got (Table[system.string, docopt.Value], string)
02:49:05reactormonkand expected: docopt.[](v: Value, i: int): string
02:49:40*saml_ joined #nim
02:50:14filwitVarriount: this sublime syntax is a bit beyond me atm, but if you want to look at my regex for capturing type-sections here it is: https://github.com/PhilipWitte/Aporia/blob/master/share/gtksourceview-2.0/language-specs/nim.lang#L225-226
02:50:26Varriountfilwit: Ok, thanks.
02:51:04def-reactormonk: like this?: https://github.com/def-/nim-brainfuck/blob/master/src/brainfuck.nim#L188-L197
02:51:19def-reactormonk: the docopt repo has some more examples
02:51:55Varriountfilwit: Depending on the plugin's supported, it might not be too much effort to port the NimLime plugins over to Kate.
02:51:58filwitVarriount: keep in mind (and I'm sure you know this), all that XML is pretty order-dependent.. but the <start><end> regex stuff is pretty straight forward and should be easy to port to sublime.. the \%{1@start} regex in <end> matches the 1st match in <start>
02:53:16filwitVarriount: that's and interesting idea... my NimKate scheme is somewhat broken (eg, it doesn't support """ strings, and a few other things like underscores in numbers, 0'f and 0x0 stuff, etc)
02:54:39filwitVarriount: so if your stuff is already more advanced, that could be a great alternative to NimKate
02:55:11reactormonkdef-, hm. your example works, but mine doesn't.
02:55:30*beier` joined #nim
02:56:14filwitVarriount: I'm not the biggest fan of Aporia (it's pretty basic), but I would like to see Nim's promoted IDE get better, and it'll probably be the first to really support the new nimsuggest stuff. So I'm probably just going to focus on contributing to it from now on.
02:57:09*beier quit (Ping timeout: 246 seconds)
02:57:16filwitwhoops... just noticed a bug in my Aporia type-section regex...
02:58:02*reem quit (Remote host closed the connection)
03:00:06filwitVarriount: oh, ps.. I made a distinction between calls "foo(x)" and commands "foo x"... where I highlight commands as keywords, which looks really great IMO for macros like the parallel/spawn ones on the homepage banner and class/impl macros.. it also makes things like "assert x = 0" feel like built-in actions, which is nice
03:01:23filwitVarriount: (only commands if they're not after a '.' or ')', so "bar.foo x" will highlight 'foo' as a call, not command)
03:01:44akiradeveloperdo we have a slice of stream?
03:03:21akiradeveloperalso stream that hides fetching from socket
03:04:06akiradeveloperIf I handle very large msgpack stream, laziness by stream should be exploited.
03:04:17*reem_ joined #nim
03:05:19def-akiradeveloper: using the streams module?
03:05:30akiradeveloperyes
03:05:43akiradeveloperno, I am planning to
03:06:13akiradevelopermy msgpack library now uses seq as the byte sequence but it won't scale
03:06:13def-I would readData into a buffer of some reasonable size (like 8 KB)
03:06:40def-then handle the buffer and as soon as it's empty, refill
03:06:53akiradevelopermsgpack isn't that simple
03:07:16akiradeveloperI need that handling hidden under stream interface
03:07:31akiradevelopermaybe SocketStream
03:08:07akiradeveloperand I also need slice(Stream, from: int: size: int): Stream
03:08:24def-write it yourself?
03:08:30akiradevelopershould I ?
03:08:44akiradeveloperIf it's already there, I won't
03:09:03*reem_ quit (Ping timeout: 265 seconds)
03:09:17def-all it would do is stream.setPosition(from) and stream.readData() i guess
03:09:39akiradevelopermsgpack's implementation can ultimately provides 1) stream processing 2) zero-copy serialization/deserialization
03:10:13akiradeveloperStream object can be cloned?
03:10:36akiradeveloperfor slicing I first clone the stream object and then set the position maybe
03:10:45def-don't think that works
03:11:04def-you can just getPosition before and setPosition again later?
03:12:29akiradeveloperbut slicing of stream is feasible anyway?
03:13:17akiradeveloperIf the data stream is small, it's not that difficult
03:13:31def-i don't understand what such a slice would do
03:13:49akiradeveloperbtw, another requirement is slicing of seq[byte] should be copy-on-write
03:14:37akiradeveloperif some write comes in to the orig or sliced seq then the copying occurs so the two objects are logically separeted
03:14:53def-that would be nice but I don't think we have something like that
03:15:36akiradeveloperyes. the current slicing propagates side-effect
03:17:19reactormonkdef-, http://pastie.org/9988728 <- reproducable
03:17:53def-reactormonk: how is that supposed to work when you have no documentation?
03:18:05reactormonkdef-, it doesn't compile
03:18:34reactormonkdef-, http://pastie.org/9988731
03:19:20*reem joined #nim
03:19:30def-reactormonk: import tables
03:19:47reactormonkdef-, :-/ thanks
03:20:09def-maybe docopt should re-export that so you don't have to import tables
03:22:44reactormonkdef-, how do I reexport?
03:23:06def-reactormonk: export
03:24:02*reem quit (Ping timeout: 265 seconds)
03:24:45reactormonkdef-, PR up.
03:25:03*OderWat wonders how long it last until def- implements this in Nim: https://github.com/kanaka/mal
03:27:25def-OderWat: why me?
03:29:46def-looks like a lot of work
03:30:03OderWatyep.. just looked further into it
03:31:44OderWatprobably not worth it... I was just thinking that Nim could do it with metaprogramming probably which would be cooler than the other ones.
03:33:46def-the eval part would be problematic I guess
03:33:53OderWatbut anybody has to do it eventually. you can't have it in "make", "postscript", "php", "rust" and "bash" but not in "Nim"
03:34:09reactormonkmake ^^
03:34:15OderWatyeah :)
03:34:44*dapz joined #nim
03:44:21*akiradeveloper quit (Read error: Connection reset by peer)
03:47:53def-OderWat: ok, that actually looks fun
03:51:11*Jesin quit (Quit: Leaving)
03:59:00*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:08:20*akiradeveloper joined #nim
04:21:58*reem joined #nim
04:24:39*beier` quit (Ping timeout: 256 seconds)
04:33:12*brson joined #nim
04:37:24*filwit quit (Quit: Leaving)
04:41:51*Menche quit (Quit: Leaving)
05:02:19*reem quit (Remote host closed the connection)
05:03:45*reem joined #nim
05:04:02VarriountOderWat: Bah. Looking at that color plugin you showed me makes me itch to improve it.
05:04:35VarriountWhen I already have other things to do.
05:05:41Varriountonionhammer: Pushed a new commit to the refactor branch. The DocComment continuation mechanism now supports autostopping
05:11:00*pregressive joined #nim
05:11:14*ARCADIVS joined #nim
05:16:59*reem quit (Remote host closed the connection)
05:17:28*beier` joined #nim
05:18:27def-Does anyone know if findAll is broken in the re module?
05:22:17def-Works totally fine with nre: https://gist.github.com/def-/f17989052fd53f2f8d24
05:30:26*Jesin joined #nim
05:42:01onionhammerVarriount nice :)
05:45:42*akiradeveloper quit (Remote host closed the connection)
05:47:48*akiradeveloper joined #nim
05:48:21*pregressive quit (Remote host closed the connection)
05:48:44def-In python it works just fine: https://gist.github.com/def-/2c083afce7187a556e35
05:49:13def-I'm wondering how to get the same result in Nim, should split into ["(", "123", "456", ")"]
05:51:23def-re's findAll just does an endless loop, nre returns something wrong after all
05:51:38*aidanh quit (Ping timeout: 244 seconds)
05:53:16*aidanh joined #nim
05:58:11*Demos quit (Read error: Connection reset by peer)
06:00:46*pregressive joined #nim
06:01:50akiradeveloperI need some mechanism to evaluate a value lazily. should I use iterator? https://gist.github.com/akiradeveloper/d1e269fe91f046698354
06:06:54def-akiradeveloper: could work well
06:07:19akiradeveloperyes. but more appropriate approach?
06:08:18akiradeveloperlet v = lazy 10; echo <| eval x .. I am not sure
06:12:58*saml_ quit (Quit: Leaving)
06:15:10*reem joined #nim
06:20:11*pregressive quit (Remote host closed the connection)
06:26:39*reem quit (Remote host closed the connection)
06:31:49*reem joined #nim
06:33:29reactormonkCan I use the project.nimble file for dependency managament? Can I somehow tell nimble to install all dependencies listed in the nimble file?
06:34:00def-"nimble build" or "nimble install" should get the dependencies before building/installing
06:36:23*reem quit (Remote host closed the connection)
06:39:17*pregressive joined #nim
06:54:32*Maxdamantus joined #nim
06:55:02*brson_ joined #nim
06:55:41MaxdamantusHm. What is meant by “Use void instead of empty tuples for generic programming” on: https://github.com/Araq/Nim/issues/1576 ?
06:56:09Maxdamantus`void` doesn't seem to have any values, so presumably can't be used as a type parameter.
06:57:04MaxdamantusThere's a pretty significant difference between what "void" seems to be and what an empty tuple would be used for.
06:58:10*brson quit (Ping timeout: 255 seconds)
06:58:34MaxdamantusThe empty tuple can be considered a unit type: a type with exactly one value, while void should have exactly zero values.
06:58:41*akiradeveloper quit (Remote host closed the connection)
07:00:07*reem joined #nim
07:00:39*aidanh quit (Ping timeout: 250 seconds)
07:01:41*akiradeveloper joined #nim
07:02:21*johnsoft quit (Ping timeout: 264 seconds)
07:06:21*aidanh joined #nim
07:07:20*Maxdamantus wonders if there's another conventional unit type.
07:08:42*brson_ quit (Quit: leaving)
07:09:37*Menche joined #nim
07:12:11*dtscode quit (Quit: ZNC - http://znc.in)
07:13:50Maxdamantusalso, in case anyone's wondering, the C example with `struct {}` is actually wrong; C doesn't have empty structs.
07:14:25*Maxdamantus suspects that should actually fail to compile.
07:15:52MaxdamantusSeems to just be a -pedantic message in gcc.
07:18:52beier`reactormonk: I come back . can I help ?
07:19:03reactormonkbeier`, grab said pastie and run it
07:19:48beier`http://pastie.org/9988711 this ?
07:21:58beier`>> >>> >>> stdin(4, 19) Error: ambiguous identifier: 'stdin' -- use a qualifier
07:21:58beier`stdin(4, 19) Error: expression 'stdin' has no type (or is ambiguous)
07:21:59beier`>>> stdin(4, 13) Error: cannot 'importc' variable at compile time
07:22:00beier`stdin(4, 19) Error: internal error: cannot generate code for: stdin
07:22:04beier`No stack traceback availablei>> >>> >>> stdin(4, 19) Error: ambiguous identifier: 'stdin' -- use a qualifier
07:22:06beier`stdin(4, 19) Error: expression 'stdin' has no type (or is ambiguous)
07:22:09beier`>>> stdin(4, 13) Error: cannot 'importc' variable at compile time
07:22:12beier`stdin(4, 19) Error: internal error: cannot generate code for: stdin
07:22:16beier`No stack traceback available
07:22:21beier`i
07:22:21*beier` left #nim ("ERC Version 5.3 (IRC client for Emacs)")
07:23:19*beier joined #nim
07:24:34reactormonkbeier, don't run it in nim i, run it via nim -r c <file>
07:25:56beierreactormonk: ok
07:28:33beierreactormonk: it output :
07:28:34beier80873
07:28:34beier0
07:28:34beier2
07:28:37beier0
07:28:46reactormonkok, wtf-
07:28:53reactormonkGives me 4x -1 on linux
07:29:23*aidanh quit (Ping timeout: 246 seconds)
07:32:03*aidanh joined #nim
07:37:46*aidanh quit (Ping timeout: 272 seconds)
07:39:29*reem quit (Remote host closed the connection)
07:41:44*dtscode joined #nim
07:51:24*aidanh joined #nim
07:53:22*reem joined #nim
07:54:33*banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:59:24*pregressive quit (Remote host closed the connection)
08:00:10*reem quit (Remote host closed the connection)
08:00:43*aidanh quit (Ping timeout: 250 seconds)
08:00:45*reem joined #nim
08:02:57*reem quit (Remote host closed the connection)
08:04:18*reem joined #nim
08:08:07*BlaXpirit joined #nim
08:23:21*johnsoft joined #nim
08:27:48*aidanh joined #nim
08:36:21*akiradeveloper quit (Remote host closed the connection)
08:49:46*TEttinger quit (Ping timeout: 255 seconds)
08:54:18*reem quit (Remote host closed the connection)
08:55:57*reem joined #nim
08:58:10*reem quit (Remote host closed the connection)
09:22:44*beier left #nim ("ERC Version 5.3 (IRC client for Emacs)")
09:23:20*reem joined #nim
09:24:46*reem quit (Remote host closed the connection)
09:28:44*reem joined #nim
09:31:51*chemist69_ quit (Quit: WeeChat 1.1.1)
09:32:00*chemist69 joined #nim
09:36:53*akiradeveloper joined #nim
09:41:20*akiradeveloper quit (Ping timeout: 246 seconds)
09:41:50*Matthias247 joined #nim
09:45:44*reem quit (Remote host closed the connection)
09:48:15*reem joined #nim
09:49:18*l04m33 quit (Ping timeout: 244 seconds)
09:50:07*l04m33 joined #nim
10:04:20*akiradeveloper joined #nim
10:06:55*reem quit (Remote host closed the connection)
10:15:04*reem joined #nim
10:18:04AraqMaxdamantus: well yes but what they are close. If you only have one single possible value, you know the value and can just as easily use 'void' which is no value
10:18:21Araq*which has no value
10:20:12*reem quit (Remote host closed the connection)
10:20:55Araqit's not like 'if x == ()' is a meaningful comparison when there is no other value that 'x' can possibly have
10:23:40*reem joined #nim
10:24:16MaxdamantusNot in generic code.
10:24:50Maxdamantuseg, I'm writing a parser combinator library and every parser has to have a result.
10:25:33*reem quit (Remote host closed the connection)
10:25:35Maxdamantusso a parser that just consumes some input or fails but never needs to produce a meaningful value should probably return some unit value.
10:25:54Maxdamantusotherwise you have to come up with special cases for handling `void`
10:26:10*reem joined #nim
10:26:41Maxdamantusimo languages like C and nim should really use a unit type instead of void.
10:27:09MaxdamantusThey both have no overhead, but logically, it's a use case for a unit type, not a void type.
10:28:07*reem quit (Remote host closed the connection)
10:28:28Maxdamantuslogically, a function that is denoted as returning a value of the empty type never finishes—it could go into a loop or crash, but it will never successfully finish, because that would require creating a value that doesn't exist.
10:28:46*reem joined #nim
10:30:39*reem quit (Remote host closed the connection)
10:31:10Maxdamantus(by not having any overhead I mean, you can represent the value with 0 bytes so there's nothing extra to return, any equality comparison is always true, etc)
10:31:36*reem joined #nim
10:33:10*reem quit (Remote host closed the connection)
10:34:07*reem joined #nim
10:35:43*reem quit (Remote host closed the connection)
10:36:44*reem joined #nim
10:38:16*reem quit (Remote host closed the connection)
10:39:00*reem joined #nim
10:39:32*Menche quit (Ping timeout: 272 seconds)
10:40:36*gokr joined #nim
10:40:49*reem quit (Remote host closed the connection)
10:41:31*reem joined #nim
10:42:12*akiradeveloper quit (Remote host closed the connection)
10:43:12*gokr_ quit (Read error: Connection reset by peer)
10:44:11AraqMaxdamantus: I cannot really follow. unless you think tuples are always sufficient to return a parsing result, I don't see why you can eliminate special cases with unit
10:44:27*reem quit (Remote host closed the connection)
10:45:02Triplefoxsomething I've noticed about procs in Nim is that whether a call has no assignment, a discard, or an applied result is an important signal for categorizing which things imply mutability
10:45:16MaxdamantusIt's not relevant to tuples. An empty tuple is just usually a convenient primitive unit type.
10:45:28*reem joined #nim
10:45:33Araqwell so is:
10:45:39Araqtype Unit = object
10:46:58MaxdamantusThat's not a unit type.
10:47:28Maxdamantusafaik .. nim has referential equality with objects, doesn't it?
10:47:45MaxdamantusThough yes, it kind of looks like one.
10:48:13MaxdamantusIt's not part of the standard library though, and it's kind of weird having a separate unit type in each project where it's sensible to have one.
10:48:21MaxdamantusI'm not sure why the empty tuple doesn't work.
10:48:52*reem quit (Remote host closed the connection)
10:49:08MaxdamantusMaybe it's just a bug.
10:52:37*akiradeveloper joined #nim
10:57:27MaxdamantusAh, object values aren't references.
10:57:38MaxdamantusSo it is a unit type.
11:00:20*pregressive joined #nim
11:05:13*pregressive quit (Ping timeout: 264 seconds)
11:09:52*Trustable joined #nim
11:10:59*sillesta joined #nim
11:19:52*dumdum joined #nim
11:34:33novistWanted to double-check: this is a bug right? https://paste2box.com/6/#/uJrWGQ/1jGpoxjjBwg7QfC8D910mmNzJOS-uVCsHq9UCaXWRig/D7oNNQfY.txt
11:46:26*reem joined #nim
11:49:21*reem quit (Remote host closed the connection)
11:55:57*pafmaf joined #nim
11:58:33*reem joined #nim
12:03:42*reem quit (Remote host closed the connection)
12:04:19*pafmaf quit (Quit: This computer has gone to sleep)
12:04:51*reem joined #nim
12:07:57*reem quit (Remote host closed the connection)
12:11:41*akiradeveloper quit (Remote host closed the connection)
12:17:45Araqnovist: yup. it's strange but only happens because of your ( (var b = new(Type2);
12:17:47Araq b
12:17:48Araq)
12:22:17*reem joined #nim
12:24:54*reem quit (Remote host closed the connection)
12:48:14*vendethiel quit (Ping timeout: 246 seconds)
12:48:45novistwell yeah.. obviously hehe
12:48:53novisti wanted to rig my macro without inline proc call
12:49:01novistthats how i bumped into this
12:55:13*aidanh quit (Ping timeout: 256 seconds)
12:57:52*aidanh joined #nim
13:11:16*pafmaf_ joined #nim
13:12:10*akiradeveloper joined #nim
13:17:53*akiradeveloper quit (Ping timeout: 256 seconds)
13:18:59*aidanh quit (Ping timeout: 245 seconds)
13:23:28*aidanh joined #nim
13:26:39*filwit joined #nim
13:31:24*pafmaf_ quit (Quit: This computer has gone to sleep)
13:31:32*filwit quit (Quit: Leaving)
13:35:31*akiradeveloper joined #nim
13:37:09*dumdum quit (Ping timeout: 256 seconds)
13:40:43*yymoto2 joined #nim
13:52:18*beier joined #nim
13:54:14*vendethiel joined #nim
14:01:18beier//leave
14:01:26*beier quit (Quit: ERC Version 5.3 (IRC client for Emacs))
14:14:02*ARCADIVS quit (Quit: ARCADIVS)
14:16:52*gokr quit (Quit: Leaving.)
14:19:12*pafmaf_ joined #nim
14:21:06akiradeveloperis there proc to make iterator from seq?
14:26:04dom96items
14:26:51*pafmaf__ joined #nim
14:29:49*pafmaf_ quit (Ping timeout: 264 seconds)
14:30:02akiradeveloperitems(seq) => expression items cannot be called
14:30:04akiradeveloperwhy?
14:31:45dom96what are you trying to do?
14:31:53dom96need context
14:32:18*joebo quit (Quit: WeeChat 1.0.1)
14:32:47*quasinoxen quit (Ping timeout: 245 seconds)
14:32:48*quasinoxen joined #nim
14:32:54akiradeveloper.eval let e = 10
14:32:59Mimbusakiradeveloper: <no output>
14:33:17akiradeveloper.eval let s = @[1,2,3]; let it = items(s)
14:33:20Mimbusakiradeveloper: eval.nim(4, 14) Error: expression 'items' cannot be called
14:33:29akiradeveloperthis is what I am trying to do
14:33:55dom96items isn't a closure iterator so you can't do that.
14:34:18dom96it can only be used in a for loop
14:34:22dom96why do you want to do this?
14:34:58akiradeveloperhave a iterator rather than seq for lazy evaluation
14:37:13akiradevelopertype T: v: seq[int] => type T: v: iterator(): int
14:38:08dom96create a closure iterator and use for i in items(seq): yield i in it then
14:38:12akiradeveloperIn my msgpack-nim, if the stream is huge, array-like data can't be constructed eagerly
14:39:24*yymoto2 quit (Quit: leaving)
14:40:31akiradeveloperhow?
14:41:05akiradeveloper.eval iterator toIter(v: seq[int]) {. closure .} = for e in v: yield e
14:41:08Mimbusakiradeveloper: eval.nim(3, 48) Error: complex statement requires indentation
14:41:40akiradeveloperif the indentation is correct => Error: current routine cannot return an expression
14:42:23dom96gist your code
14:43:50*gokr joined #nim
14:43:50*gokr quit (Remote host closed the connection)
14:44:29akiradeveloperdom96: in essence, like this https://gist.github.com/akiradeveloper/7dd70bfb45a2df8eb853
14:46:41dom96akiradeveloper: https://gist.github.com/dom96/002573d819caec665480
14:46:42dom96bbl
14:47:31*BlaXpirit_ joined #nim
14:49:32*BlaXpirit quit (Ping timeout: 256 seconds)
14:50:50*darkf quit (Quit: Leaving)
14:51:22akiradeveloperunbelievable hack..
14:57:35*saml_ joined #nim
15:09:22def-OderWat: https://github.com/def-/mal/commits/master
15:11:49*dumdum joined #nim
15:22:20OderWat<def-> OderWat: why me?
15:22:34OderWat:) cause you can!
15:27:10OderWatShould go to the website too. I think that everything which shows: You can do stuff (and probably even better, faster, more elegant) is what shines.
15:30:36*Matthias247 quit (Read error: Connection reset by peer)
16:03:52aidanhIs there a good way to convert a uint64 to an array of eight chars?
16:05:21def-aidanh: cast I guess
16:20:32aidanhdef-: I'll try that, thanks
16:32:08*Trustable quit (Remote host closed the connection)
16:34:01*sillesta quit (Remote host closed the connection)
16:37:21*dumdum quit (Ping timeout: 256 seconds)
16:44:43*sillesta joined #nim
16:53:29*onionhammer quit (Ping timeout: 244 seconds)
16:54:02*quasinoxen quit (Read error: Connection reset by peer)
16:58:35*quasinoxen joined #nim
17:01:54*onionhammer joined #nim
17:01:56*akiradeveloper quit (Remote host closed the connection)
17:04:43*akiradeveloper joined #nim
17:04:44*quasinoxen quit (Ping timeout: 265 seconds)
17:05:46*gsingh93 joined #nim
17:06:11*quasinoxen joined #nim
17:06:28*akiradeveloper quit (Client Quit)
17:06:55*TEttinger joined #nim
17:11:45onionhammerola
17:12:54*quasinoxen quit (Ping timeout: 256 seconds)
17:12:57*quasinoxen joined #nim
17:14:02BlaXpirit_aidanh, note that it you may get different behavior on different processors
17:15:29*quasinoxen quit (Remote host closed the connection)
17:15:55*a5i joined #nim
17:16:07a5iWhen will Nim be available on Debian?
17:20:04onionhammernim is already available on debian
17:20:09onionhammeror do you mean on aptitude?
17:20:46onionhammer<-- this machine is debian and runs nim
17:20:57a5ioh nvm found it
17:21:22a5ihow Fast is Nim on webdev?
17:22:23onionhammerfast to develop or fast to execute?
17:23:25onionhammerhttp://www.eoleary.me/Blog/Creating-a-simple-web-application-in-Nim
17:24:08a5iexecute
17:24:13onionhammerbtw that site is also written in nim, using the technologies in that blogpost
17:24:20a5iwell, concurrent reqs and such
17:24:27a5ireqs/second
17:24:35onionhammerrunning on an $100 ARM computer
17:25:14onionhammera5i it depends on your machine, CPU etc
17:25:29onionhammerbut you can probably do 11k requests per second using the current standard libraries & jester
17:26:16a5iI kinda wanna compare Jester and Rust's Iron
17:26:18onionhammerdef- just got 1.5 million requests per second the other day working on some new libraries on top of epoll
17:26:45onionhammerhe's working on optimizing the standard libraries around this
17:27:26onionhammerbut that was on a 16 core xeon
17:27:30onionhammerpowerful server
17:27:50a5ier, what tool should I use to test req/s per second?
17:28:50onionhammerab or wrk
17:30:42onionhammera5i here's defs work https://github.com/def-/nim-http-speedup
17:31:10a5iI think I git cloned Nim in the wrong dir
17:31:23a5icuz nim isnt a command
17:32:52onionhammerdid you follow the install instructions?
17:34:46a5iyes
17:47:24a5i:(
17:48:55a5i.eval echo "hello"
17:48:58Mimbusa5i: hello
17:49:32a5i.eval var a = ""; var t ="t"; a += t; echo a
17:49:35Mimbusa5i: eval.nim(5, 2) Error: type mismatch: got (string, string)
17:50:04a5ihow do we combine 2 strings tg?
17:52:13BlaXpirit_&=
17:53:35a5i.eval var a = ""; var t ="t"; a &= t; echo a
17:53:38Mimbusa5i: t
17:55:53a5iBlaXpirit_: random only works with sequtils ?
17:56:10BlaXpirit_what does that mean
17:56:38a5ilike Ruby had rand(6), does your random lib have to use toSeq to get the range of numbers?
17:57:15BlaXpirit_uh probably not
17:57:48a5ithen whats the easiest way to print a random number from 0 to 6?
17:57:51a5iusing ur library
17:58:35BlaXpirit_i think it was randomInt(0..6)
17:59:05BlaXpirit_this is for integers
17:59:40*pafmaf__ quit (Quit: This computer has gone to sleep)
18:04:31a5iHow do we import 3rd party pckages :S
18:05:32TEttingerNimble
18:05:51a5ilink to how2?
18:06:16TEttingerdo you mean getting the packages or once you have them, using them in code?
18:06:47TEttingerhttps://github.com/nim-lang/nimble
18:06:58TEttingernimble handles getting the packages
18:08:13TEttingeronionhammer, I love cheap ARM computers :)
18:09:13a5igetting the packages
18:14:00a5iJust intalled it on windows
18:14:08a5iand Nimble isnt a command :)
18:14:23*a5i cries
18:15:19TEttingeris it on your path?
18:15:41BlaXpirit_gonna spam with my article again http://blaxpirit.com/blog/8/avoid-problems-when-installing-nim-on-windows.html
18:16:19TEttingeryou're on debian, a5i?
18:16:27a5iWell both
18:16:36a5idebian vps and windows desktop
18:16:44TEttingeron debian: You should then add ~/.nimble/bin to your $PATH. Updating nimble can then be done by executing nimble install nimble.
18:17:08a5ihm
18:17:12TEttingeron windows, before you run the install.bat: this installation requires you have the Nim compiler in your PATH. Once the installation completes you should add C:\Users\YourName\.nimble\bin to your PATH.
18:30:48*Demos joined #nim
18:35:08*banister joined #nim
18:35:12*banister quit (Max SendQ exceeded)
18:44:09*banister joined #nim
18:46:01*Matthias247 joined #nim
18:58:05*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:05:28*fizzbooze joined #nim
19:11:33*gokr joined #nim
19:15:01BlaXpirit_is there some solution to 404 links to imports of standard library in docs ?
19:20:38*shevy left #nim ("I'll be back ... maybe")
19:23:59*saml_ quit (Ping timeout: 245 seconds)
19:28:14*gXen joined #nim
19:28:55def-BlaXpirit_: not yet afaik
19:39:24*davidterry joined #nim
19:39:50*davidterry quit (Client Quit)
19:47:04*Demos quit (Read error: Connection reset by peer)
19:50:57*Matthias247 quit (Read error: Connection reset by peer)
19:50:57*matkuki joined #nim
19:56:42*fizzbooze quit (Ping timeout: 246 seconds)
20:14:53*xeizlif quit (Ping timeout: 240 seconds)
20:18:55*a5i quit (Quit: Connection closed for inactivity)
20:25:03*gXen quit ()
20:35:12*fizzbooze joined #nim
20:37:25*xeizlif joined #nim
20:39:29*gsingh93 quit (Ping timeout: 250 seconds)
20:48:37*filwit joined #nim
20:54:13*gsingh93 joined #nim
21:03:32*filwit quit (Quit: Leaving)
21:09:29Araqdef-: bug #2233 is fun :-) shows how defective C's type system really is :P
21:09:55Araqthe fix doesn't look hard though
21:24:22*Jesin quit (Quit: Leaving)
21:42:08matkukiIs the object supposed to be mutable in the second proc? https://bpaste.net/show/8a08b72cf11c
21:43:14*reem joined #nim
21:45:10def-matkuki: it's a ref I guess?
21:45:55matkukidef-: Yes.
21:46:10def-then that's as expected
21:46:19matkukiOk, thanks.
21:46:34def-but I agree that this behaviour is sometimes unexpected
21:47:06matkukiExactly, it threw me off for a bit.
21:49:11*BitPuffin joined #nim
21:50:27BlaXpirit_def-, i think you made a commit to accept nim input from stdin
21:50:35BlaXpirit_what's the status?
21:50:54def-BlaXpirit_: the PR is stil open
21:51:07BlaXpirit_yeah, sorry for pinging you, was actually trivial to find it
21:52:23Araqdef-: updated the fake module name?
21:53:04def-Araq: oops, forgot
21:53:14def-stdinFile should work?
21:53:25Araqbtw why does the compiler need to be able to read from stdin?
21:54:04AraqstdinFile? good enough I guess
21:55:42*TEttinger quit (Ping timeout: 265 seconds)
21:55:58def-Araq: Who doesn't want to do this?:
21:56:00def-echo 'echo "Hello World"' | nim -r c -
21:56:28def-Someone had a legitimate use case for it recently, I implemented it for him
21:56:51Araqyeah yeah yeah I'll accept it. it doesn't mean I like though. it sucks.
21:58:24def-i have about 100 nim files in my home directory with just a few lines, when I was trying something out. Could save me the trouble of creating files all the time with stdin reading
22:01:12Araqyeah except that stdin is not a file, it is a stream
22:02:02def-so, what should the output filename be? "-" is quite unfortunate
22:02:13def-I guess also stdinFile
22:02:27Araq"a.out" obviously
22:03:08Araqdoes gcc accept - to read from stdin?
22:03:18def-yes
22:03:29def-many compilers do (not all in this list): http://rosettacode.org/wiki/Shell_one-liner
22:06:12MaxdamantusHm. So that's why empty tuples don't work properly; tuple[] is a constraint.
22:06:59Maxdamantusis the [] not meant to prevent that?
22:07:15BlaXpirit_Maxdamantus, empty tuple is nonsense :|
22:07:47BlaXpirit_I don't know any compiler/interpreter that does not accept input from stdin
22:07:48Maxdamantusunless you want something like a generic value wrapper and sometimes don't want a value.
22:08:33BlaXpirit_that's void
22:08:46Maxdamantusvoid doesn't have any values.
22:08:59BlaXpirit_uhhh exactly
22:09:04Maxdamantusif you could create a type with a void member, that type would also not have any values.
22:09:11Maxdamantusbecause n*0 = 0
22:09:37Maxdamantushttp://en.wikipedia.org/wiki/Product_type
22:09:54BlaXpirit_Maxdamantus, https://github.com/Araq/Nim/blob/master/lib/pure/json.nim#L517
22:11:01MaxdamantusYeah, you can create ad-hoc unit types.
22:11:26Maxdamantusbut is there a reason why you shouldn't be able to use an empty tuple type?
22:11:46BlaXpirit_I still don't see a reason why you should
22:11:55Maxdamantusall other languages I can think of with tuples have empty tuples, the static ones particularly for these cases.
22:12:16MaxdamantusParser[string, tuple[]]
22:12:45BlaXpirit_ok, I see a reason
22:12:49Maxdamantusmight represent a parser that consumes some part of a seq[string], but in this case doesn't have a meaningful result.
22:13:07MaxdamantusParser[string, int] might be one that results in an int.
22:13:25BlaXpirit_don't know if that would be possible to make anyway
22:13:32MaxdamantusI've already made it.
22:13:44Maxdamantusbut I have to write something like: type Unit = object
22:14:10Maxdamantusand use that meaningless special unit type.
22:14:13Araqyou surely are a lucky guy if that's your only problem with Nim ;-)
22:15:44BlaXpirit_.eval proc test(): tuple[a: void] = discard
22:15:47MimbusBlaXpirit_: Error: internal error: getTypeDescAux(tyEmpty)
22:15:47*Mimbus quit (Excess Flood)
22:15:52MaxdamantusHeh. I have other problems, but things like this feel important to me, and I'm aware the language (and implementation) is still in development.
22:15:54*Mimbus joined #nim
22:16:09AraqBlaXpirit_: nice one!
22:16:11*Trustable joined #nim
22:16:17MaxdamantusYou wouldn't be able to construct a tuple[a: void] value if it were a valid type.
22:16:38Maxdamantusbecause void doesn't have any values, so you don't have anything to put in the first (and only) element.
22:16:55BlaXpirit_uh i just found an error, so i threw it out here
22:17:11MaxdamantusAh.
22:17:37BlaXpirit_but I was indeed trying to guess a syntax, which does not exist
22:18:44AraqMaxdamantus: if it makes you feel better tuples with a single element are defective as well
22:19:02Araq(x: 1) # is a (named) tuple
22:19:07Araq(1) # is just 1.
22:19:23Araqand (1,) doesn't work either
22:19:47MaxdamantusYeah, I don't think one-tuples are very useful in a statically typed language, unless it's for the sake of giving it a name, as you did.
22:19:50BlaXpirit_i think in haskell 1 item tuple doesn't exist and 0 item tuple is void
22:19:54BlaXpirit_if i remember correctly
22:20:03Maxdamantus1
22:20:10Maxdamantus1-tuple doesn't exist, 0-tuple is unit, not void.
22:20:26BlaXpirit_same stuff, different name, isnt it
22:20:30MaxdamantusNo.
22:20:36BlaXpirit_whatever then :|
22:20:57Maxdamantusa void type in Haskell would be something like: newtype Void = Void Void
22:21:07Maxdamantuswhich is empty because there's no way to construct a single value.
22:21:36MaxdamantusThe data constructor, `Void` itself takes something of type `Void`, so you'd need Void (Void (Void ..))
22:22:34*Jesin joined #nim
22:22:37Araqbut I still don't see your problem really. For your parsers you need to be able to generate a sum type as well, right? So it's not tuples all the way down and so the "special" case for Unit won't hurt.
22:22:45Maxdamantusvoid types aren't usually very useful, except in languages like Agda and Idris, where you can prove something by coming up with a value involving a void type.
22:23:21Araqno, void types are quite useful, when you do: Table[string, void] == Set[string]
22:23:30BlaXpirit_well in Nim it's useful because you can put it in a place where an actual type would be expected
22:23:34MaxdamantusThat should be unit, not void.
22:23:48BlaXpirit_which is, first of all, generics
22:23:54MaxdamantusThere are no void values, so you can't map strings to them.
22:24:07*pregressive joined #nim
22:24:50MaxdamantusIs the Table[string, void] example actually used?
22:25:53MaxdamantusC, Java, C++, etc use a void type where it would probably be more sensible to use a unit type.
22:26:10Maxdamantusbut people didn't think hard enough about type systems back then.
22:26:34Araqthere is some container that supports 'void' iirc, but Table is not it
22:26:56*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0/20150222232811])
22:28:04MaxdamantusWith a unit, you do get Set from Table like that: t = Table[string, tuple[]](); t.add("foo", ()); t.hasKey("foo")
22:28:19*Maxdamantus doesn't know if that's what the Table interface is like in nim.
22:28:57Araqyeah, but that sucks, with 'void' you get t.add("foo")
22:29:13MaxdamantusIt's more logical though. :\
22:29:53Maxdamantusactually, no, you don't, unless you handle it specially.
22:30:06MaxdamantusI suspect you can't have `void` members in objects.
22:30:11Maxdamantusor in any type.
22:30:12Araqwhich we do (modulo implementation bugs)
22:30:24MaxdamantusRight, with a unit type you don't need to specialise.
22:30:32Araqa paramter of type 'void' is eliminated entirely
22:31:00Araqso it ends up as t.add("foo")
22:31:39Maxdamantustype TableNode[K, V] = object \n key: K \n val: V
22:31:51Maxdamantusthen TableNode[string, void] probably fails, dunno.
22:32:22Araqbtw we have to generate struct { char c; } for type Unit = object so it's not that simple when targetting C
22:32:25*Menche joined #nim
22:32:34Araqbut you said that already
22:33:14MaxdamantusYes, since C itself doesn't have a unit type, you'd need to do the special case there.
22:33:58MaxdamantusBut you can imagine the special casing as an optimisation that just omits them.
22:34:14Maxdamantusso it turns into void in C.
22:38:48*gsingh93 quit (Quit: WeeChat 1.1.1)
22:39:47*gsingh93 joined #nim
22:42:58*reem quit (Remote host closed the connection)
22:46:29def-Didn't use them for so long, nearly forgot about <<: https://github.com/Araq/Nim/pull/2202#issuecomment-76553138
22:48:57Araqdoes that mean we don't need a repl? :P
22:49:22def-haha, not quite good enough for most people I guess
22:50:47BlaXpirit_personally I think repl is not needed at all
22:51:10def-I'm writing a repl right now, but not for Nim
22:56:07*TEttinger joined #nim
22:56:20Araqdef-: yay your PR breaks bootstrapping on windows
22:56:54Araqnimsrc_passes.c:839:29: error: lvalue required as unary '&' operand
22:56:55Araq s = llstreamopen_193238(&stdin);
22:58:19def-According to http://buildbot.nim-lang.org/waterfall windows bootstrapping broke even earlier, didn't it?
22:58:32Araqno.
22:58:58Araqand look at the error that's clearly your PR
22:59:47Araqthere is llStreamOpenStdIn for this reason that you should have used
23:01:04def-Sorry: https://github.com/Araq/Nim/pull/2235
23:01:23Araqalready fixed it
23:01:26def-ok
23:01:34Araqbut please test it with this patch again
23:02:27def-doesn't work with llStreamOpenStdin on Linux
23:02:37*gsingh93 quit (Quit: WeeChat 1.1.1)
23:03:22Araqmaybe with -d:useGnuReadline ?
23:03:32*gsingh93 joined #nim
23:04:38def-that seems to help, but still get strange output
23:04:45def->>> and ... everywhere
23:05:07Araqyeah look at the llstream implementation
23:05:30AraqllStreamOpenStdin was written for the REPL support
23:05:47Araqso it doesn't work the way I thought
23:06:34Araqbut hey, as long as bootrapping works, I don't care. so take your time to come up with llStreamOpenStdinThisTimeForReal
23:08:32def-why can't we use regular stdin on Windows?
23:08:46Araqbut I think you simply need to get rid of the 'var' in proc llStreamOpen*(f: var File): PLLStream
23:09:30def-that looks better
23:10:29AraqI don't think this was windows related. it's just that I like efficient buffering and 'stdin' cannot be buffered since it's not a file
23:11:03flaviuBut stdin is a file on linux.
23:11:29AraqUnix names it a "file" but it's just a stream.
23:11:56flaviu/proc/<PID>/fd/0
23:12:00Araqso how long is stdin? see? it's not a file.
23:12:25MaxdamantusUnix calls it a pipe.
23:12:56Maxdamantusand it calls something that exists in a filesystem a file, including block/character devices.
23:13:49flaviuAraq: /dev/ttyS0 has indefinite length. /dev/urandom has indefinite length.
23:17:59flaviuhttp://stackoverflow.com/questions/5876373/using-setvbuf-with-stdin-stream
23:21:28Araqflaviu: please fix #2228 instead of lecturing me
23:22:02*cazov joined #nim
23:23:18flaviuAraq: I don't own a mac, so I really can't do anything.
23:23:39Araqflaviu: the fix is not mac related
23:23:52Araqit's broken everywhere I think
23:25:14*sillesta quit (Ping timeout: 245 seconds)
23:25:42flaviuWorks great on linux.
23:28:19Araqbut it should use istty(f) anyway I think
23:29:56flaviuIt works on linux, I really shouldn't work on it. Sending in a fix that I'm not sure about is wrong.
23:30:15Araqfair enough
23:31:45*reem joined #nim
23:31:54*fizzbooze quit (Ping timeout: 252 seconds)
23:32:32flaviuI suppose I could pick up another bug, but I have some ideas I want to test out instead.
23:37:38*reem quit (Remote host closed the connection)
23:41:05*reem joined #nim
23:41:39*TEttinger quit (Ping timeout: 250 seconds)
23:47:14*banister joined #nim
23:47:18*banister quit (Max SendQ exceeded)
23:50:14*reem quit (Remote host closed the connection)
23:53:29*a5i joined #nim
23:53:29a5iI have nimble in my path
23:53:48a5ibut it isnt a command :(
23:54:03*reem joined #nim
23:54:08*TEttinger joined #nim
23:56:36*reem quit (Remote host closed the connection)
23:56:38flaviuWell, then you don't have it on your path.
23:56:55flaviua5i: If using windows, try logging out and back in.
23:57:08a5iI shut down my PC after I installed
23:57:22a5iYou can ask me if so and so in in where i tshould be
23:57:29*reem joined #nim
23:57:36a5ireem :D
23:58:34flaviuCan you open a prompt in the nimble binary directory and execute nimble?
23:58:35a5iis in where*
23:59:28a5inimble.cmd?
23:59:39BlaXpirit_yes
23:59:58a5iyes