00:00:57 | * | reem quit (Remote host closed the connection) |
00:01:15 | flaviu | filwit: http://i.imgur.com/htLEu43.png |
00:02:23 | flaviu | The background seems noisy, but at small sizes it blurs away. |
00:03:03 | gmpreussner|work | onionhammer: 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:01 | onionhammer | shits and giggles *is* a good use case :P |
00:05:06 | filwit | flaviu: 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:39 | flaviu | filwit: No, the github repo icon. |
00:06:21 | filwit | flaviu: 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:29 | filwit | flaviu: ah, okay. Looks great then |
00:08:20 | flaviu | "effects/strokes/pattern scaling"? |
00:08:29 | * | Nuew joined #nim |
00:09:17 | Nuew | Hello! Whenever I compile anything, I get "CC: packages\n |
00:09:17 | Nuew | Error: unhandled exception: The system cannot find the file specified. |
00:09:17 | Nuew | \n [OSError]\n |
00:09:17 | Nuew | > Process terminated with exit code 1" |
00:09:20 | Nuew | Any Help? |
00:09:48 | flaviu | Nuew: Are you running on windows? It sounds like nim is unable to find a C compiler. |
00:10:13 | Nuew | Yeah. 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:03 | BlaXpirit | Nuew, people keep running into this problem |
00:11:06 | BlaXpirit | what did you do? |
00:11:17 | flaviu | Try --verbosity:3, does it get you any useful information? |
00:11:28 | Nuew | OK, just rechecked my path, and things are gon |
00:11:32 | Nuew | strange |
00:11:36 | BlaXpirit | I 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:04 | Nuew | Yeah, cygwin somehow got removed from my path. |
00:12:15 | Nuew | Sorry to bother you! |
00:12:44 | filwit | flaviu: 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:39 | flaviu | filwit: 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:22 | flaviu | Done! Github icon is now updated: https://avatars3.githubusercontent.com/u/603863?v=3&s=200 |
00:21:53 | BlaXpirit | good |
00:22:18 | BlaXpirit | can't see the dots at all though |
00:23:27 | BlaXpirit | (on the actual page) |
00:24:08 | flaviu | IMO that's not a big deal. It'd be too noisy if the dots were visible. |
00:24:29 | flaviu | People with fancy 4k screens can see them, I'm sure. |
00:27:19 | * | Nuew quit (Quit: Leaving) |
00:28:00 | filwit | flaviu: awesome. Looks great! |
00:28:42 | filwit | flaviu: what IDE do you use for Nim, btw? |
00:28:50 | flaviu | Vim with zah's plugin. |
00:29:16 | filwit | k, just wondering... wouldn't have pinned you for a vim guy |
00:29:37 | BlaXpirit | :D |
00:29:54 | filwit | but then, I've barely used it, so I always see Vim as a 'l33t haxor' editor |
00:30:46 | flaviu | I'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:50 | reactormonk | parseopt2 still a good way to go? |
00:37:44 | flaviu | reactormonk: https://github.com/docopt/docopt.nim |
00:38:14 | * | dyu quit (Quit: Leaving) |
00:38:17 | * | dapz quit (Client Quit) |
00:47:40 | Varriount | Can anyone here give me a printout of the latest 'nimble --help' |
00:47:42 | Varriount | ? |
00:49:22 | * | dapz joined #nim |
00:52:52 | BlaXpirit | Varriount, 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:38 | reactormonk | how do I get the argument vector? |
01:01:10 | reactormonk | aka argv |
01:02:21 | BlaXpirit | reactormonk, quote from docopt.nim |
01:02:24 | BlaXpirit | argv 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:44 | BlaXpirit | os.commandLineParams |
01:03:04 | reactormonk | ah, 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:22 | BlaXpirit | hm how to reverse string |
01:30:59 | BlaXpirit | this seems like a surprisingly hard task |
01:32:33 | flaviu | BlaXpirit: And it'll be a thousand times harder once you consider localization. |
01:32:41 | BlaXpirit | right |
01:32:53 | BlaXpirit | well i mean i can write a for loop |
01:32:58 | BlaXpirit | but what's the fun in that |
01:33:14 | BlaXpirit | i want oneliner/expression |
01:33:44 | fowl | BlaXpirit, unicode module has a reverse function in it, i can't speak for its accuracy |
01:34:06 | BlaXpirit | cool, 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:28 | reactormonk | How do I get some random numbers? I'd like to produce a 32-char string from an array of chars |
01:48:35 | reactormonk | ... randomly. |
01:51:57 | flaviu | .eval var data: array[32, char]; echo(escape(open("/dev/urandom").readChars(data, 0, 32))); |
01:52:01 | Mimbus | flaviu: eval.nim(4, 11) Error: type mismatch: got (int) |
01:52:48 | flaviu | .give reactormonk var data: array[32, char]; discard open("/dev/urandom").readChars(data, 0, 32); echo data; |
01:52:52 | Mimbus | reactormonk: 䕯ߝ(;ǦL낧1̫ؔ{{«}濿 |
01:53:33 | reactormonk | flaviu, hm. |
01:55:01 | reactormonk | no 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:06 | reactormonk | How do I cast array[4, int8] to int? |
02:03:29 | * | chemist69_ joined #nim |
02:03:40 | fowl | newFileStream(open("/dev/urandom")).readInt32 |
02:03:51 | reactormonk | duh. |
02:04:51 | flaviu | reactormonk: casting array[4, int8] to int32 is incorrect because of endianness, although that doesn't matter much for random ints. |
02:05:07 | fowl | cast[ptr int32](arr[0].addr)[] |
02:05:10 | reactormonk | initMersenneTwister(newFileStream(open("/dev/urandom")).readInt32) <- looks good? |
02:05:30 | flaviu | fowl: type punning is undefined behavior. |
02:06:22 | flaviu | reactormonk: MersenneTwister has 2KiB of state, 32 bits is insufficent. |
02:06:25 | * | chemist69 quit (Ping timeout: 250 seconds) |
02:07:11 | fowl | flaviu, it is? |
02:07:13 | reactormonk | flaviu, ah, it's already correctly inititalized in the library. |
02:08:20 | * | whitenoise quit (Quit: Connection closed for inactivity) |
02:11:39 | flaviu | reactormonk: 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:41 | reactormonk | flaviu, so I need to poke BlaXpirit to get a better rng? ^^ |
02:13:18 | flaviu | ChaCha or AES are good choices for that. |
02:13:58 | BlaXpirit | reactormonk, mersenne twister accepts array of bytes as argument |
02:14:08 | BlaXpirit | if you are talking about my lib |
02:14:14 | reactormonk | BlaXpirit, not needed, I see you're properly initializing it |
02:15:34 | BlaXpirit | oh actually it's a recent addition that it accepts array of bytes... unreleased yet |
02:16:27 | reactormonk | BlaXpirit, still, I'd say another random algorithm would be better, for better randomness. Doesn't matter to me. |
02:16:47 | reactormonk | And I'd error out if you can't initialize it correctly. |
02:16:55 | reactormonk | as in, with full 2k state. |
02:17:02 | BlaXpirit | that's all gonna be there |
02:17:09 | * | jholland quit (Quit: Connection closed for inactivity) |
02:17:15 | reactormonk | kk |
02:17:21 | BlaXpirit | both of your points are more than halfway done |
02:17:36 | flaviu | BlaXpirit: Have you considered adding ChaCha or AES? |
02:18:09 | BlaXpirit | uh look, i can add whatever PRNGS |
02:18:16 | BlaXpirit | but what's the real value of that |
02:18:43 | flaviu | Cryptographic security and known performance. |
02:19:06 | BlaXpirit | right now im waiting for the license change in pcg and then will look into that uniform generation of floats |
02:19:32 | BlaXpirit | in more detail |
02:20:46 | BlaXpirit | i'm gonna need some assistance in picking these PRNGs |
02:21:36 | BlaXpirit | and maybe porting... but that's definitely not what has taken the most time |
02:22:20 | BlaXpirit | night... |
02:22:27 | * | BlaXpirit quit (Quit: Quit Konversation) |
02:24:41 | flaviu | fowl: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html#Violating%20Type%20Rules |
02:26:56 | filwit | def-: 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:10 | flaviu | filwit: hookrace.net/public/css.css scroll to the bottom :) |
02:28:18 | def- | 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:34 | filwit | flaviu: will take a look, thanks |
02:28:36 | def- | Yep, Monokai was the name |
02:28:57 | filwit | def: they're not monokai colors, but they're close (i've already ported monokai) |
02:30:40 | filwit | i have sublime, what am i doing... |
02:31:20 | beier | what editor do you using for nim ? |
02:31:29 | beier | I use emacs |
02:32:01 | filwit | hmm... 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:22 | def- | I may have manually changed a few colors, but honestly can't remember |
02:32:34 | filwit | beier: 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:42 | reactormonk | Do we have anyone with OSX? |
02:33:23 | def- | beier: I'm using vim myself. lots of editor answers here: http://forum.nim-lang.org/t/844 |
02:33:43 | filwit | i'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:38 | filwit | so 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:04 | filwit | though 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:44 | beier | reactormonk: I'm osx 10.10 |
02:36:46 | filwit | it 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:59 | Varriount | filwit: I've been working on the Sublime Text Plugin |
02:37:27 | filwit | Varriount: nice.. i started to use that.. it's pretty nice |
02:37:41 | Varriount | It's going from about 5 options to 50. It will be *completely* customizable. |
02:37:59 | Varriount | Down to console output for nearly every command. |
02:38:20 | * | reem joined #nim |
02:38:32 | * | Varriount laughs maniacally |
02:38:48 | filwit | Varriount: 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:23 | Varriount | filwit: Improvements to the syntax highlighting and scoping are always welcome. |
02:39:46 | reactormonk | beier, mostly because https://github.com/Araq/Nim/issues/2228 - can't really debug that stuff without an OSX. |
02:39:53 | Varriount | It'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:21 | filwit | Varriount: 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:50 | Varriount | filwit: Well, the python highlighter manages it... somehow |
02:41:30 | filwit | Varriount: 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:59 | Varriount | filwit: Actually, no. It just has to be more than the previous level. |
02:42:24 | filwit | Varriount: okay, my mistake |
02:42:35 | Varriount | filwit: It's ok, it's an easy one to make. |
02:43:27 | filwit | Varrount: do you have a repo with your sublime code i could take a look at? (and a link to the python colors) |
02:43:36 | Varriount | filwit: Does Kate support plugins? |
02:43:43 | filwit | Varriount: yes |
02:43:52 | Varriount | https://github.com/Varriount/NimLime |
02:43:53 | filwit | idk why i keep typing your name... |
02:43:57 | filwit | thanks |
02:44:20 | Varriount | filwit: Look and edit the YAML files first. |
02:44:41 | filwit | i'm not going to touch this anytime soon, i just want to take a look |
02:44:58 | Varriount | I use a converter that transforms the YAML into JSON. YAML is easier to read. |
02:45:04 | filwit | i spent too much time on Aporia already, my next step (after forum udpates) will be to update the Kate colors |
02:45:24 | filwit | i'm very unfamiliar with YAML, but i'll figure it out |
02:45:59 | Varriount | filwit: It's ok if you don't have time. It's not vital. |
02:46:05 | reactormonk | beier, could you copy & run this: http://pastie.org/9988711 ? |
02:46:27 | Varriount | filwit: What plugins does Kate support? |
02:46:58 | filwit | Varriount: Kate supports a ton of different plugins, Javascript, Python, and Native ones I think |
02:47:11 | filwit | Varriount: it's color schemes are all it's own format however |
02:47:39 | filwit | Varriount: it's basically the same as gtksoureview stuff.. XML with regex |
02:48:55 | reactormonk | how exactly do I use docopt? I get Error: type mismatch: got (Table[system.string, docopt.Value], string) |
02:49:05 | reactormonk | and expected: docopt.[](v: Value, i: int): string |
02:49:40 | * | saml_ joined #nim |
02:50:14 | filwit | Varriount: 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:26 | Varriount | filwit: Ok, thanks. |
02:51:04 | def- | reactormonk: like this?: https://github.com/def-/nim-brainfuck/blob/master/src/brainfuck.nim#L188-L197 |
02:51:19 | def- | reactormonk: the docopt repo has some more examples |
02:51:55 | Varriount | filwit: Depending on the plugin's supported, it might not be too much effort to port the NimLime plugins over to Kate. |
02:51:58 | filwit | Varriount: 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:16 | filwit | Varriount: 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:39 | filwit | Varriount: so if your stuff is already more advanced, that could be a great alternative to NimKate |
02:55:11 | reactormonk | def-, hm. your example works, but mine doesn't. |
02:55:30 | * | beier` joined #nim |
02:56:14 | filwit | Varriount: 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:16 | filwit | whoops... just noticed a bug in my Aporia type-section regex... |
02:58:02 | * | reem quit (Remote host closed the connection) |
03:00:06 | filwit | Varriount: 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:23 | filwit | Varriount: (only commands if they're not after a '.' or ')', so "bar.foo x" will highlight 'foo' as a call, not command) |
03:01:44 | akiradeveloper | do we have a slice of stream? |
03:03:21 | akiradeveloper | also stream that hides fetching from socket |
03:04:06 | akiradeveloper | If I handle very large msgpack stream, laziness by stream should be exploited. |
03:04:17 | * | reem_ joined #nim |
03:05:19 | def- | akiradeveloper: using the streams module? |
03:05:30 | akiradeveloper | yes |
03:05:43 | akiradeveloper | no, I am planning to |
03:06:13 | akiradeveloper | my msgpack library now uses seq as the byte sequence but it won't scale |
03:06:13 | def- | I would readData into a buffer of some reasonable size (like 8 KB) |
03:06:40 | def- | then handle the buffer and as soon as it's empty, refill |
03:06:53 | akiradeveloper | msgpack isn't that simple |
03:07:16 | akiradeveloper | I need that handling hidden under stream interface |
03:07:31 | akiradeveloper | maybe SocketStream |
03:08:07 | akiradeveloper | and I also need slice(Stream, from: int: size: int): Stream |
03:08:24 | def- | write it yourself? |
03:08:30 | akiradeveloper | should I ? |
03:08:44 | akiradeveloper | If it's already there, I won't |
03:09:03 | * | reem_ quit (Ping timeout: 265 seconds) |
03:09:17 | def- | all it would do is stream.setPosition(from) and stream.readData() i guess |
03:09:39 | akiradeveloper | msgpack's implementation can ultimately provides 1) stream processing 2) zero-copy serialization/deserialization |
03:10:13 | akiradeveloper | Stream object can be cloned? |
03:10:36 | akiradeveloper | for slicing I first clone the stream object and then set the position maybe |
03:10:45 | def- | don't think that works |
03:11:04 | def- | you can just getPosition before and setPosition again later? |
03:12:29 | akiradeveloper | but slicing of stream is feasible anyway? |
03:13:17 | akiradeveloper | If the data stream is small, it's not that difficult |
03:13:31 | def- | i don't understand what such a slice would do |
03:13:49 | akiradeveloper | btw, another requirement is slicing of seq[byte] should be copy-on-write |
03:14:37 | akiradeveloper | if some write comes in to the orig or sliced seq then the copying occurs so the two objects are logically separeted |
03:14:53 | def- | that would be nice but I don't think we have something like that |
03:15:36 | akiradeveloper | yes. the current slicing propagates side-effect |
03:17:19 | reactormonk | def-, http://pastie.org/9988728 <- reproducable |
03:17:53 | def- | reactormonk: how is that supposed to work when you have no documentation? |
03:18:05 | reactormonk | def-, it doesn't compile |
03:18:34 | reactormonk | def-, http://pastie.org/9988731 |
03:19:20 | * | reem joined #nim |
03:19:30 | def- | reactormonk: import tables |
03:19:47 | reactormonk | def-, :-/ thanks |
03:20:09 | def- | maybe docopt should re-export that so you don't have to import tables |
03:22:44 | reactormonk | def-, how do I reexport? |
03:23:06 | def- | reactormonk: export |
03:24:02 | * | reem quit (Ping timeout: 265 seconds) |
03:24:45 | reactormonk | def-, PR up. |
03:25:03 | * | OderWat wonders how long it last until def- implements this in Nim: https://github.com/kanaka/mal |
03:27:25 | def- | OderWat: why me? |
03:29:46 | def- | looks like a lot of work |
03:30:03 | OderWat | yep.. just looked further into it |
03:31:44 | OderWat | probably 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:46 | def- | the eval part would be problematic I guess |
03:33:53 | OderWat | but anybody has to do it eventually. you can't have it in "make", "postscript", "php", "rust" and "bash" but not in "Nim" |
03:34:09 | reactormonk | make ^^ |
03:34:15 | OderWat | yeah :) |
03:34:44 | * | dapz joined #nim |
03:44:21 | * | akiradeveloper quit (Read error: Connection reset by peer) |
03:47:53 | def- | 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:02 | Varriount | OderWat: Bah. Looking at that color plugin you showed me makes me itch to improve it. |
05:04:35 | Varriount | When I already have other things to do. |
05:05:41 | Varriount | onionhammer: 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:27 | def- | Does anyone know if findAll is broken in the re module? |
05:22:17 | def- | Works totally fine with nre: https://gist.github.com/def-/f17989052fd53f2f8d24 |
05:30:26 | * | Jesin joined #nim |
05:42:01 | onionhammer | Varriount 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:44 | def- | In python it works just fine: https://gist.github.com/def-/2c083afce7187a556e35 |
05:49:13 | def- | I'm wondering how to get the same result in Nim, should split into ["(", "123", "456", ")"] |
05:51:23 | def- | 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:50 | akiradeveloper | I need some mechanism to evaluate a value lazily. should I use iterator? https://gist.github.com/akiradeveloper/d1e269fe91f046698354 |
06:06:54 | def- | akiradeveloper: could work well |
06:07:19 | akiradeveloper | yes. but more appropriate approach? |
06:08:18 | akiradeveloper | let 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:29 | reactormonk | Can 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:00 | def- | "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:41 | Maxdamantus | Hm. What is meant by “Use void instead of empty tuples for generic programming” on: https://github.com/Araq/Nim/issues/1576 ? |
06:56:09 | Maxdamantus | `void` doesn't seem to have any values, so presumably can't be used as a type parameter. |
06:57:04 | Maxdamantus | There'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:34 | Maxdamantus | The 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:50 | Maxdamantus | also, 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:52 | Maxdamantus | Seems to just be a -pedantic message in gcc. |
07:18:52 | beier` | reactormonk: I come back . can I help ? |
07:19:03 | reactormonk | beier`, grab said pastie and run it |
07:19:48 | beier` | http://pastie.org/9988711 this ? |
07:21:58 | beier` | >> >>> >>> stdin(4, 19) Error: ambiguous identifier: 'stdin' -- use a qualifier |
07:21:58 | beier` | stdin(4, 19) Error: expression 'stdin' has no type (or is ambiguous) |
07:21:59 | beier` | >>> stdin(4, 13) Error: cannot 'importc' variable at compile time |
07:22:00 | beier` | stdin(4, 19) Error: internal error: cannot generate code for: stdin |
07:22:04 | beier` | No stack traceback availablei>> >>> >>> stdin(4, 19) Error: ambiguous identifier: 'stdin' -- use a qualifier |
07:22:06 | beier` | stdin(4, 19) Error: expression 'stdin' has no type (or is ambiguous) |
07:22:09 | beier` | >>> stdin(4, 13) Error: cannot 'importc' variable at compile time |
07:22:12 | beier` | stdin(4, 19) Error: internal error: cannot generate code for: stdin |
07:22:16 | beier` | No stack traceback available |
07:22:21 | beier` | i |
07:22:21 | * | beier` left #nim ("ERC Version 5.3 (IRC client for Emacs)") |
07:23:19 | * | beier joined #nim |
07:24:34 | reactormonk | beier, don't run it in nim i, run it via nim -r c <file> |
07:25:56 | beier | reactormonk: ok |
07:28:33 | beier | reactormonk: it output : |
07:28:34 | beier | 80873 |
07:28:34 | beier | 0 |
07:28:34 | beier | 2 |
07:28:37 | beier | 0 |
07:28:46 | reactormonk | ok, wtf- |
07:28:53 | reactormonk | Gives 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:04 | Araq | Maxdamantus: 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:21 | Araq | *which has no value |
10:20:12 | * | reem quit (Remote host closed the connection) |
10:20:55 | Araq | it'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:16 | Maxdamantus | Not in generic code. |
10:24:50 | Maxdamantus | eg, 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:35 | Maxdamantus | so 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:54 | Maxdamantus | otherwise you have to come up with special cases for handling `void` |
10:26:10 | * | reem joined #nim |
10:26:41 | Maxdamantus | imo languages like C and nim should really use a unit type instead of void. |
10:27:09 | Maxdamantus | They 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:28 | Maxdamantus | logically, 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:10 | Maxdamantus | (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:11 | Araq | Maxdamantus: 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:02 | Triplefox | something 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:16 | Maxdamantus | It's not relevant to tuples. An empty tuple is just usually a convenient primitive unit type. |
10:45:28 | * | reem joined #nim |
10:45:33 | Araq | well so is: |
10:45:39 | Araq | type Unit = object |
10:46:58 | Maxdamantus | That's not a unit type. |
10:47:28 | Maxdamantus | afaik .. nim has referential equality with objects, doesn't it? |
10:47:45 | Maxdamantus | Though yes, it kind of looks like one. |
10:48:13 | Maxdamantus | It'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:21 | Maxdamantus | I'm not sure why the empty tuple doesn't work. |
10:48:52 | * | reem quit (Remote host closed the connection) |
10:49:08 | Maxdamantus | Maybe it's just a bug. |
10:52:37 | * | akiradeveloper joined #nim |
10:57:27 | Maxdamantus | Ah, object values aren't references. |
10:57:38 | Maxdamantus | So 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:33 | novist | Wanted 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:45 | Araq | novist: yup. it's strange but only happens because of your ( (var b = new(Type2); |
12:17:47 | Araq | b |
12:17:48 | Araq | ) |
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:45 | novist | well yeah.. obviously hehe |
12:48:53 | novist | i wanted to rig my macro without inline proc call |
12:49:01 | novist | thats 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:18 | beier | //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:06 | akiradeveloper | is there proc to make iterator from seq? |
14:26:04 | dom96 | items |
14:26:51 | * | pafmaf__ joined #nim |
14:29:49 | * | pafmaf_ quit (Ping timeout: 264 seconds) |
14:30:02 | akiradeveloper | items(seq) => expression items cannot be called |
14:30:04 | akiradeveloper | why? |
14:31:45 | dom96 | what are you trying to do? |
14:31:53 | dom96 | need 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:54 | akiradeveloper | .eval let e = 10 |
14:32:59 | Mimbus | akiradeveloper: <no output> |
14:33:17 | akiradeveloper | .eval let s = @[1,2,3]; let it = items(s) |
14:33:20 | Mimbus | akiradeveloper: eval.nim(4, 14) Error: expression 'items' cannot be called |
14:33:29 | akiradeveloper | this is what I am trying to do |
14:33:55 | dom96 | items isn't a closure iterator so you can't do that. |
14:34:18 | dom96 | it can only be used in a for loop |
14:34:22 | dom96 | why do you want to do this? |
14:34:58 | akiradeveloper | have a iterator rather than seq for lazy evaluation |
14:37:13 | akiradeveloper | type T: v: seq[int] => type T: v: iterator(): int |
14:38:08 | dom96 | create a closure iterator and use for i in items(seq): yield i in it then |
14:38:12 | akiradeveloper | In 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:31 | akiradeveloper | how? |
14:41:05 | akiradeveloper | .eval iterator toIter(v: seq[int]) {. closure .} = for e in v: yield e |
14:41:08 | Mimbus | akiradeveloper: eval.nim(3, 48) Error: complex statement requires indentation |
14:41:40 | akiradeveloper | if the indentation is correct => Error: current routine cannot return an expression |
14:42:23 | dom96 | gist your code |
14:43:50 | * | gokr joined #nim |
14:43:50 | * | gokr quit (Remote host closed the connection) |
14:44:29 | akiradeveloper | dom96: in essence, like this https://gist.github.com/akiradeveloper/7dd70bfb45a2df8eb853 |
14:46:41 | dom96 | akiradeveloper: https://gist.github.com/dom96/002573d819caec665480 |
14:46:42 | dom96 | bbl |
14:47:31 | * | BlaXpirit_ joined #nim |
14:49:32 | * | BlaXpirit quit (Ping timeout: 256 seconds) |
14:50:50 | * | darkf quit (Quit: Leaving) |
14:51:22 | akiradeveloper | unbelievable hack.. |
14:57:35 | * | saml_ joined #nim |
15:09:22 | def- | OderWat: https://github.com/def-/mal/commits/master |
15:11:49 | * | dumdum joined #nim |
15:22:20 | OderWat | <def-> OderWat: why me? |
15:22:34 | OderWat | :) cause you can! |
15:27:10 | OderWat | Should 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:52 | aidanh | Is there a good way to convert a uint64 to an array of eight chars? |
16:05:21 | def- | aidanh: cast I guess |
16:20:32 | aidanh | def-: 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:45 | onionhammer | ola |
17:12:54 | * | quasinoxen quit (Ping timeout: 256 seconds) |
17:12:57 | * | quasinoxen joined #nim |
17:14:02 | BlaXpirit_ | 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:07 | a5i | When will Nim be available on Debian? |
17:20:04 | onionhammer | nim is already available on debian |
17:20:09 | onionhammer | or do you mean on aptitude? |
17:20:46 | onionhammer | <-- this machine is debian and runs nim |
17:20:57 | a5i | oh nvm found it |
17:21:22 | a5i | how Fast is Nim on webdev? |
17:22:23 | onionhammer | fast to develop or fast to execute? |
17:23:25 | onionhammer | http://www.eoleary.me/Blog/Creating-a-simple-web-application-in-Nim |
17:24:08 | a5i | execute |
17:24:13 | onionhammer | btw that site is also written in nim, using the technologies in that blogpost |
17:24:20 | a5i | well, concurrent reqs and such |
17:24:27 | a5i | reqs/second |
17:24:35 | onionhammer | running on an $100 ARM computer |
17:25:14 | onionhammer | a5i it depends on your machine, CPU etc |
17:25:29 | onionhammer | but you can probably do 11k requests per second using the current standard libraries & jester |
17:26:16 | a5i | I kinda wanna compare Jester and Rust's Iron |
17:26:18 | onionhammer | def- just got 1.5 million requests per second the other day working on some new libraries on top of epoll |
17:26:45 | onionhammer | he's working on optimizing the standard libraries around this |
17:27:26 | onionhammer | but that was on a 16 core xeon |
17:27:30 | onionhammer | powerful server |
17:27:50 | a5i | er, what tool should I use to test req/s per second? |
17:28:50 | onionhammer | ab or wrk |
17:30:42 | onionhammer | a5i here's defs work https://github.com/def-/nim-http-speedup |
17:31:10 | a5i | I think I git cloned Nim in the wrong dir |
17:31:23 | a5i | cuz nim isnt a command |
17:32:52 | onionhammer | did you follow the install instructions? |
17:34:46 | a5i | yes |
17:47:24 | a5i | :( |
17:48:55 | a5i | .eval echo "hello" |
17:48:58 | Mimbus | a5i: hello |
17:49:32 | a5i | .eval var a = ""; var t ="t"; a += t; echo a |
17:49:35 | Mimbus | a5i: eval.nim(5, 2) Error: type mismatch: got (string, string) |
17:50:04 | a5i | how do we combine 2 strings tg? |
17:52:13 | BlaXpirit_ | &= |
17:53:35 | a5i | .eval var a = ""; var t ="t"; a &= t; echo a |
17:53:38 | Mimbus | a5i: t |
17:55:53 | a5i | BlaXpirit_: random only works with sequtils ? |
17:56:10 | BlaXpirit_ | what does that mean |
17:56:38 | a5i | like Ruby had rand(6), does your random lib have to use toSeq to get the range of numbers? |
17:57:15 | BlaXpirit_ | uh probably not |
17:57:48 | a5i | then whats the easiest way to print a random number from 0 to 6? |
17:57:51 | a5i | using ur library |
17:58:35 | BlaXpirit_ | i think it was randomInt(0..6) |
17:59:05 | BlaXpirit_ | this is for integers |
17:59:40 | * | pafmaf__ quit (Quit: This computer has gone to sleep) |
18:04:31 | a5i | How do we import 3rd party pckages :S |
18:05:32 | TEttinger | Nimble |
18:05:51 | a5i | link to how2? |
18:06:16 | TEttinger | do you mean getting the packages or once you have them, using them in code? |
18:06:47 | TEttinger | https://github.com/nim-lang/nimble |
18:06:58 | TEttinger | nimble handles getting the packages |
18:08:13 | TEttinger | onionhammer, I love cheap ARM computers :) |
18:09:13 | a5i | getting the packages |
18:14:00 | a5i | Just intalled it on windows |
18:14:08 | a5i | and Nimble isnt a command :) |
18:14:23 | * | a5i cries |
18:15:19 | TEttinger | is it on your path? |
18:15:41 | BlaXpirit_ | gonna spam with my article again http://blaxpirit.com/blog/8/avoid-problems-when-installing-nim-on-windows.html |
18:16:19 | TEttinger | you're on debian, a5i? |
18:16:27 | a5i | Well both |
18:16:36 | a5i | debian vps and windows desktop |
18:16:44 | TEttinger | on debian: You should then add ~/.nimble/bin to your $PATH. Updating nimble can then be done by executing nimble install nimble. |
18:17:08 | a5i | hm |
18:17:12 | TEttinger | on 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:01 | BlaXpirit_ | 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:55 | def- | 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:29 | Araq | def-: bug #2233 is fun :-) shows how defective C's type system really is :P |
21:09:55 | Araq | the fix doesn't look hard though |
21:24:22 | * | Jesin quit (Quit: Leaving) |
21:42:08 | matkuki | Is the object supposed to be mutable in the second proc? https://bpaste.net/show/8a08b72cf11c |
21:43:14 | * | reem joined #nim |
21:45:10 | def- | matkuki: it's a ref I guess? |
21:45:55 | matkuki | def-: Yes. |
21:46:10 | def- | then that's as expected |
21:46:19 | matkuki | Ok, thanks. |
21:46:34 | def- | but I agree that this behaviour is sometimes unexpected |
21:47:06 | matkuki | Exactly, it threw me off for a bit. |
21:49:11 | * | BitPuffin joined #nim |
21:50:27 | BlaXpirit_ | def-, i think you made a commit to accept nim input from stdin |
21:50:35 | BlaXpirit_ | what's the status? |
21:50:54 | def- | BlaXpirit_: the PR is stil open |
21:51:07 | BlaXpirit_ | yeah, sorry for pinging you, was actually trivial to find it |
21:52:23 | Araq | def-: updated the fake module name? |
21:53:04 | def- | Araq: oops, forgot |
21:53:14 | def- | stdinFile should work? |
21:53:25 | Araq | btw why does the compiler need to be able to read from stdin? |
21:54:04 | Araq | stdinFile? good enough I guess |
21:55:42 | * | TEttinger quit (Ping timeout: 265 seconds) |
21:55:58 | def- | Araq: Who doesn't want to do this?: |
21:56:00 | def- | echo 'echo "Hello World"' | nim -r c - |
21:56:28 | def- | Someone had a legitimate use case for it recently, I implemented it for him |
21:56:51 | Araq | yeah yeah yeah I'll accept it. it doesn't mean I like though. it sucks. |
21:58:24 | def- | 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:12 | Araq | yeah except that stdin is not a file, it is a stream |
22:02:02 | def- | so, what should the output filename be? "-" is quite unfortunate |
22:02:13 | def- | I guess also stdinFile |
22:02:27 | Araq | "a.out" obviously |
22:03:08 | Araq | does gcc accept - to read from stdin? |
22:03:18 | def- | yes |
22:03:29 | def- | many compilers do (not all in this list): http://rosettacode.org/wiki/Shell_one-liner |
22:06:12 | Maxdamantus | Hm. So that's why empty tuples don't work properly; tuple[] is a constraint. |
22:06:59 | Maxdamantus | is the [] not meant to prevent that? |
22:07:15 | BlaXpirit_ | Maxdamantus, empty tuple is nonsense :| |
22:07:47 | BlaXpirit_ | I don't know any compiler/interpreter that does not accept input from stdin |
22:07:48 | Maxdamantus | unless you want something like a generic value wrapper and sometimes don't want a value. |
22:08:33 | BlaXpirit_ | that's void |
22:08:46 | Maxdamantus | void doesn't have any values. |
22:08:59 | BlaXpirit_ | uhhh exactly |
22:09:04 | Maxdamantus | if you could create a type with a void member, that type would also not have any values. |
22:09:11 | Maxdamantus | because n*0 = 0 |
22:09:37 | Maxdamantus | http://en.wikipedia.org/wiki/Product_type |
22:09:54 | BlaXpirit_ | Maxdamantus, https://github.com/Araq/Nim/blob/master/lib/pure/json.nim#L517 |
22:11:01 | Maxdamantus | Yeah, you can create ad-hoc unit types. |
22:11:26 | Maxdamantus | but is there a reason why you shouldn't be able to use an empty tuple type? |
22:11:46 | BlaXpirit_ | I still don't see a reason why you should |
22:11:55 | Maxdamantus | all other languages I can think of with tuples have empty tuples, the static ones particularly for these cases. |
22:12:16 | Maxdamantus | Parser[string, tuple[]] |
22:12:45 | BlaXpirit_ | ok, I see a reason |
22:12:49 | Maxdamantus | might represent a parser that consumes some part of a seq[string], but in this case doesn't have a meaningful result. |
22:13:07 | Maxdamantus | Parser[string, int] might be one that results in an int. |
22:13:25 | BlaXpirit_ | don't know if that would be possible to make anyway |
22:13:32 | Maxdamantus | I've already made it. |
22:13:44 | Maxdamantus | but I have to write something like: type Unit = object |
22:14:10 | Maxdamantus | and use that meaningless special unit type. |
22:14:13 | Araq | you surely are a lucky guy if that's your only problem with Nim ;-) |
22:15:44 | BlaXpirit_ | .eval proc test(): tuple[a: void] = discard |
22:15:47 | Mimbus | BlaXpirit_: Error: internal error: getTypeDescAux(tyEmpty) |
22:15:47 | * | Mimbus quit (Excess Flood) |
22:15:52 | Maxdamantus | Heh. 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:09 | Araq | BlaXpirit_: nice one! |
22:16:11 | * | Trustable joined #nim |
22:16:17 | Maxdamantus | You wouldn't be able to construct a tuple[a: void] value if it were a valid type. |
22:16:38 | Maxdamantus | because void doesn't have any values, so you don't have anything to put in the first (and only) element. |
22:16:55 | BlaXpirit_ | uh i just found an error, so i threw it out here |
22:17:11 | Maxdamantus | Ah. |
22:17:37 | BlaXpirit_ | but I was indeed trying to guess a syntax, which does not exist |
22:18:44 | Araq | Maxdamantus: if it makes you feel better tuples with a single element are defective as well |
22:19:02 | Araq | (x: 1) # is a (named) tuple |
22:19:07 | Araq | (1) # is just 1. |
22:19:23 | Araq | and (1,) doesn't work either |
22:19:47 | Maxdamantus | Yeah, 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:50 | BlaXpirit_ | i think in haskell 1 item tuple doesn't exist and 0 item tuple is void |
22:19:54 | BlaXpirit_ | if i remember correctly |
22:20:03 | Maxdamantus | 1 |
22:20:10 | Maxdamantus | 1-tuple doesn't exist, 0-tuple is unit, not void. |
22:20:26 | BlaXpirit_ | same stuff, different name, isnt it |
22:20:30 | Maxdamantus | No. |
22:20:36 | BlaXpirit_ | whatever then :| |
22:20:57 | Maxdamantus | a void type in Haskell would be something like: newtype Void = Void Void |
22:21:07 | Maxdamantus | which is empty because there's no way to construct a single value. |
22:21:36 | Maxdamantus | The data constructor, `Void` itself takes something of type `Void`, so you'd need Void (Void (Void ..)) |
22:22:34 | * | Jesin joined #nim |
22:22:37 | Araq | but 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:45 | Maxdamantus | void 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:21 | Araq | no, void types are quite useful, when you do: Table[string, void] == Set[string] |
22:23:30 | BlaXpirit_ | well in Nim it's useful because you can put it in a place where an actual type would be expected |
22:23:34 | Maxdamantus | That should be unit, not void. |
22:23:48 | BlaXpirit_ | which is, first of all, generics |
22:23:54 | Maxdamantus | There are no void values, so you can't map strings to them. |
22:24:07 | * | pregressive joined #nim |
22:24:50 | Maxdamantus | Is the Table[string, void] example actually used? |
22:25:53 | Maxdamantus | C, Java, C++, etc use a void type where it would probably be more sensible to use a unit type. |
22:26:10 | Maxdamantus | but people didn't think hard enough about type systems back then. |
22:26:34 | Araq | there 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:04 | Maxdamantus | With 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:57 | Araq | yeah, but that sucks, with 'void' you get t.add("foo") |
22:29:13 | Maxdamantus | It's more logical though. :\ |
22:29:53 | Maxdamantus | actually, no, you don't, unless you handle it specially. |
22:30:06 | Maxdamantus | I suspect you can't have `void` members in objects. |
22:30:11 | Maxdamantus | or in any type. |
22:30:12 | Araq | which we do (modulo implementation bugs) |
22:30:24 | Maxdamantus | Right, with a unit type you don't need to specialise. |
22:30:32 | Araq | a paramter of type 'void' is eliminated entirely |
22:31:00 | Araq | so it ends up as t.add("foo") |
22:31:39 | Maxdamantus | type TableNode[K, V] = object \n key: K \n val: V |
22:31:51 | Maxdamantus | then TableNode[string, void] probably fails, dunno. |
22:32:22 | Araq | btw 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:34 | Araq | but you said that already |
22:33:14 | Maxdamantus | Yes, since C itself doesn't have a unit type, you'd need to do the special case there. |
22:33:58 | Maxdamantus | But you can imagine the special casing as an optimisation that just omits them. |
22:34:14 | Maxdamantus | so 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:29 | def- | Didn't use them for so long, nearly forgot about <<: https://github.com/Araq/Nim/pull/2202#issuecomment-76553138 |
22:48:57 | Araq | does that mean we don't need a repl? :P |
22:49:22 | def- | haha, not quite good enough for most people I guess |
22:50:47 | BlaXpirit_ | personally I think repl is not needed at all |
22:51:10 | def- | I'm writing a repl right now, but not for Nim |
22:56:07 | * | TEttinger joined #nim |
22:56:20 | Araq | def-: yay your PR breaks bootstrapping on windows |
22:56:54 | Araq | nimsrc_passes.c:839:29: error: lvalue required as unary '&' operand |
22:56:55 | Araq | s = llstreamopen_193238(&stdin); |
22:58:19 | def- | According to http://buildbot.nim-lang.org/waterfall windows bootstrapping broke even earlier, didn't it? |
22:58:32 | Araq | no. |
22:58:58 | Araq | and look at the error that's clearly your PR |
22:59:47 | Araq | there is llStreamOpenStdIn for this reason that you should have used |
23:01:04 | def- | Sorry: https://github.com/Araq/Nim/pull/2235 |
23:01:23 | Araq | already fixed it |
23:01:26 | def- | ok |
23:01:34 | Araq | but please test it with this patch again |
23:02:27 | def- | doesn't work with llStreamOpenStdin on Linux |
23:02:37 | * | gsingh93 quit (Quit: WeeChat 1.1.1) |
23:03:22 | Araq | maybe with -d:useGnuReadline ? |
23:03:32 | * | gsingh93 joined #nim |
23:04:38 | def- | that seems to help, but still get strange output |
23:04:45 | def- | >>> and ... everywhere |
23:05:07 | Araq | yeah look at the llstream implementation |
23:05:30 | Araq | llStreamOpenStdin was written for the REPL support |
23:05:47 | Araq | so it doesn't work the way I thought |
23:06:34 | Araq | but hey, as long as bootrapping works, I don't care. so take your time to come up with llStreamOpenStdinThisTimeForReal |
23:08:32 | def- | why can't we use regular stdin on Windows? |
23:08:46 | Araq | but I think you simply need to get rid of the 'var' in proc llStreamOpen*(f: var File): PLLStream |
23:09:30 | def- | that looks better |
23:10:29 | Araq | I 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:03 | flaviu | But stdin is a file on linux. |
23:11:29 | Araq | Unix names it a "file" but it's just a stream. |
23:11:56 | flaviu | /proc/<PID>/fd/0 |
23:12:00 | Araq | so how long is stdin? see? it's not a file. |
23:12:25 | Maxdamantus | Unix calls it a pipe. |
23:12:56 | Maxdamantus | and it calls something that exists in a filesystem a file, including block/character devices. |
23:13:49 | flaviu | Araq: /dev/ttyS0 has indefinite length. /dev/urandom has indefinite length. |
23:17:59 | flaviu | http://stackoverflow.com/questions/5876373/using-setvbuf-with-stdin-stream |
23:21:28 | Araq | flaviu: please fix #2228 instead of lecturing me |
23:22:02 | * | cazov joined #nim |
23:23:18 | flaviu | Araq: I don't own a mac, so I really can't do anything. |
23:23:39 | Araq | flaviu: the fix is not mac related |
23:23:52 | Araq | it's broken everywhere I think |
23:25:14 | * | sillesta quit (Ping timeout: 245 seconds) |
23:25:42 | flaviu | Works great on linux. |
23:28:19 | Araq | but it should use istty(f) anyway I think |
23:29:56 | flaviu | It works on linux, I really shouldn't work on it. Sending in a fix that I'm not sure about is wrong. |
23:30:15 | Araq | fair enough |
23:31:45 | * | reem joined #nim |
23:31:54 | * | fizzbooze quit (Ping timeout: 252 seconds) |
23:32:32 | flaviu | I 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:29 | a5i | I have nimble in my path |
23:53:48 | a5i | but 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:38 | flaviu | Well, then you don't have it on your path. |
23:56:55 | flaviu | a5i: If using windows, try logging out and back in. |
23:57:08 | a5i | I shut down my PC after I installed |
23:57:22 | a5i | You can ask me if so and so in in where i tshould be |
23:57:29 | * | reem joined #nim |
23:57:36 | a5i | reem :D |
23:58:34 | flaviu | Can you open a prompt in the nimble binary directory and execute nimble? |
23:58:35 | a5i | is in where* |
23:59:28 | a5i | nimble.cmd? |
23:59:39 | BlaXpirit_ | yes |
23:59:58 | a5i | yes |