<< 20-01-2017 >>

00:02:18*Ven joined #nim
00:08:41*Kingsquee joined #nim
00:15:36*libman2 joined #nim
00:15:36*libman quit (Read error: Connection reset by peer)
00:31:17*Ven quit (Ping timeout: 255 seconds)
00:35:07*handlex quit (Quit: handlex)
00:36:00*Ven joined #nim
00:43:32*enthus1ast joined #nim
00:44:51*Ven quit (Ping timeout: 240 seconds)
00:46:15*libman joined #nim
00:46:28*libman2 quit (Read error: Connection reset by peer)
00:55:55*Ven joined #nim
00:58:04*Ven quit (Read error: Connection reset by peer)
00:59:25*brson quit (Ping timeout: 240 seconds)
01:15:27*Ven joined #nim
01:16:13*libman quit (Quit: Bye)
01:17:27*gokr quit (Ping timeout: 252 seconds)
01:26:09*brson joined #nim
01:31:25*Ven quit (Ping timeout: 240 seconds)
01:35:22*Ven joined #nim
01:41:55stisalibman : try copying glob.h to /usr/include and glob.o to /usr/lib, then in config/nim.cfg around ln 73 add to clang.option.linker /data/data/com.termux/files/usr/lib , after that it should work normally
01:46:49FromGitter<lbmn> st
01:47:05FromGitter<lbmn> stisa: thank you will try later.
01:53:55*brson quit (Ping timeout: 240 seconds)
01:56:08*brson joined #nim
01:59:24*brson quit (Client Quit)
02:01:56*brson joined #nim
02:02:07*pregressive joined #nim
02:07:35*pregressive quit (Ping timeout: 264 seconds)
02:13:19*stisa quit ()
02:15:07*Ven quit (Ping timeout: 248 seconds)
02:19:55*Ven joined #nim
02:21:30*brson quit (Ping timeout: 245 seconds)
02:27:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:39:24*chemist69 quit (Ping timeout: 276 seconds)
02:45:48*Ven quit (Ping timeout: 260 seconds)
02:46:33*brson joined #nim
02:49:20*Ven joined #nim
02:51:03*brson quit (Ping timeout: 260 seconds)
02:52:46*chemist69 joined #nim
02:55:18*brson joined #nim
03:08:55*yglukhov joined #nim
03:12:47*couven92 quit (Quit: Client disconnecting)
03:13:30*yglukhov quit (Ping timeout: 252 seconds)
03:13:33*dddddd quit (Remote host closed the connection)
03:15:58*Ven quit (Ping timeout: 255 seconds)
03:18:36*Ven joined #nim
03:23:55*brson quit (Ping timeout: 248 seconds)
03:31:45*Ven quit (Ping timeout: 255 seconds)
03:34:15*Ven joined #nim
03:46:55*Ven quit (Ping timeout: 245 seconds)
03:49:58*shodan45 joined #nim
03:52:55*Ven joined #nim
04:01:47*Ven quit (Ping timeout: 248 seconds)
04:11:36*brson joined #nim
04:13:06*Ven joined #nim
04:14:11*Ven quit (Read error: Connection reset by peer)
04:17:48*ftsf quit (Remote host closed the connection)
04:19:30*flyx quit (Ping timeout: 276 seconds)
04:23:02*Ven joined #nim
04:31:23*Ven quit (Ping timeout: 260 seconds)
04:33:54FromGitter<martinium> trying to use the js backend and immediately get this error
04:33:55FromGitter<martinium> https://www.bitmex.com/api/v1/orderBook/L2?symbol=XBTUSD&depth=50
04:34:09FromGitter<martinium> lib/pure/os.nim(27, 10) Error: OS module not ported to your operating system!
04:34:42*brson quit (Quit: leaving)
04:35:50FromGitter<vegansk> @martinium, you can't use some modules with js backend, for example ``os``. What are you trying to do?
04:37:21*Ven joined #nim
04:38:10FromGitter<martinium> was trying to see if my small Nim command line app would compile to js with no work
04:38:12FromGitter<martinium> :)
04:38:36FromGitter<martinium> no worries it's nothing important
04:40:03FromGitter<Varriount> @martinium Unfortunately the JS backend doesn't use Node. It assumes that the JS is going to be used in the browser
04:40:59FromGitter<martinium> yeah using node would be a key thing to do nowadays but not a big deal since it can always come much later after Nim is 1.0
04:42:05FromGitter<vegansk> @Varriount, there is -d:nodejs
04:42:38FromGitter<vegansk> But surely, you must use nodejs libraries directly
04:43:40Araquse emscripten? works with Nim too
04:45:00FromGitter<Varriount> @vegansk Oh, I didn't know
04:46:06*Ven quit (Ping timeout: 240 seconds)
04:46:52FromGitter<vegansk> @Araq, hello from Siberia :-) It was nice to meet you.
04:48:05Araqthank you :-)
04:48:36FromGitter<vegansk> And again the same question :-) Are there any news about generic concepts?
04:53:50*Ven joined #nim
04:59:32def-pri-pubexit
04:59:34def-pri-pubdammit
04:59:36*def-pri-pub quit (Quit: leaving)
05:09:24*shodan45 quit (Quit: Konversation terminated!)
05:09:28AraqI'm writing the code in the branch now
05:09:31Araqer
05:09:34Araq*reading
05:20:28FromGitter<vegansk> @Araq, @dom96 , what do you think about adding the implementation of interfaces to stdandard library? Something like this (https://github.com/zielmicha/collections.nim/blob/master/collections/iface.nim). It can be usefull for implementing the new design of the streams for example. And also it will be the part of standard and people will not need to reinvent a wheel
05:28:23Araqwasn't aware of its existance
05:28:59Araq„This is a simple integer arithimetic equation solver, capable of deriving the value of a static parameter in expressions such as (N + 5) / 2 = rhs“
05:36:21*MightyJoe quit (Ping timeout: 258 seconds)
05:40:04*cyraxjoe joined #nim
05:45:40*dyce quit (Ping timeout: 245 seconds)
05:49:57*dyce joined #nim
06:02:29*Ven quit (Ping timeout: 255 seconds)
06:04:38*Ven joined #nim
06:11:07*nsf joined #nim
06:17:09*Ven quit (Ping timeout: 276 seconds)
06:24:33*Ven joined #nim
06:31:16*Ven quit (Ping timeout: 255 seconds)
06:34:11*Ven joined #nim
06:43:37*Matthias247 joined #nim
06:45:59Xewith asyncnet, how do i get the remote socket address?
06:50:22*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:53:32*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
06:56:18*Matthias247 quit (Read error: Connection reset by peer)
07:03:27*bjz_ joined #nim
07:03:39*bjz_ quit (Read error: Connection reset by peer)
07:05:28*bjz_ joined #nim
07:11:00*bjz_ quit (Read error: Connection reset by peer)
07:11:33*bjz joined #nim
07:16:55*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:36:11FromGitter<Varriount> @vegansk What use cases does that module have, compared to concepts? (I'm sure there are some, I just can't think of any off the top of my head)
07:39:31FromGitter<Araq> and again, concepts are not interfaces. concepts are generic constraints, interfaces enable heterogenous collections
07:39:32*bjz joined #nim
07:44:55*mjanssen quit (Ping timeout: 240 seconds)
07:45:46*der joined #nim
07:46:07*ludocode joined #nim
07:46:38*gsingh93- joined #nim
07:47:28*unlaudable joined #nim
07:47:42*Sergio965_ joined #nim
07:51:29*Sergio965 quit (Ping timeout: 240 seconds)
07:51:29*gsingh93 quit (Ping timeout: 240 seconds)
07:51:29*gsingh93- is now known as gsingh93
07:51:29*ludocode_ quit (Remote host closed the connection)
07:51:29*derlafff quit (Ping timeout: 240 seconds)
07:51:30*mjanssen_ joined #nim
07:51:51*dyce[m] quit (Ping timeout: 240 seconds)
07:52:11*erwana[m] quit (Ping timeout: 240 seconds)
07:52:40*yglukhov joined #nim
07:52:44*erwana[m] joined #nim
07:52:58*dyce[m] joined #nim
07:53:41*yglukhov quit (Remote host closed the connection)
07:53:50*yglukhov joined #nim
07:57:28*gokr joined #nim
08:07:11*yglukhov quit (Remote host closed the connection)
08:20:29*flyx joined #nim
08:21:20*Arrrr joined #nim
08:27:25*Andris_zbx joined #nim
08:27:32FromGitter<timeyyy> I'm learning nim doing rosetta code examples and would appreciate a look over before i post the example. http://paste.ofcode.org/PJ4RAWCkdzcVEyAdXLTvKs
08:29:55*yglukhov joined #nim
08:36:35*rokups joined #nim
08:47:39FromGitter<vegansk> @Varriount , interfaces are for runtime polymorphism
08:48:06*flyx|znc joined #nim
08:48:54*flyx quit (Quit: Leaving)
08:48:54*flyx|znc is now known as flyx
09:02:18*bjz quit (Read error: Connection reset by peer)
09:04:51FromGitter<Araq> @timeyyy you don't use the threadpool
09:05:11FromGitter<endragor> @timeyyy 1) there is a race condition for opening the channels - open them in the main thread 2) if the input file contains line "STOP", a bad thing will happen; consider sending `nil` 3) since the channels are already global, there is no point in passing the pointers via thread arg. 4) joinThreads can accept multiple arguments
09:05:35FromGitter<Araq> ha, was about to write the same
09:07:28*bjz joined #nim
09:13:11*hohlerde quit (Ping timeout: 240 seconds)
09:13:27*yglukhov quit (Remote host closed the connection)
09:13:35*hohlerde joined #nim
09:13:45*Pisuke joined #nim
09:14:54*stisa joined #nim
09:17:27FromGitter<andreaferretti> did anyone try to run some simple nim example on https://github.com/graalvm/sulong ?
09:17:37FromGitter<andreaferretti> I made a little experiment
09:18:19FromGitter<andreaferretti> adding the compiled c version of stdlib_system abd nimrtl
09:18:52FromGitter<andreaferretti> I get no errors (with hello world) but apparently the sulong interpreter gets stuck in an infinite loop
09:39:44euantorThanks for sharing that interface code, looks like a nice implementation. Personally I'd love to see interfaces as part of the stdlib
09:45:38FromGitter<andreaferretti> there is another implementation in this thread http://forum.nim-lang.org/t/2422/4 (not sure about the differences, though)
09:48:55*bjz_ joined #nim
09:49:42*Vladar joined #nim
09:50:47*bjz quit (Ping timeout: 264 seconds)
09:56:49*PMunch joined #nim
09:59:09*vlad1777d joined #nim
10:06:09*yglukhov joined #nim
10:07:02PMunchHmm, Araq. I think the way to go to upgrade the wxnim files to 3.1.0 is to use something like Meld. Or any other three-way merge tool
10:07:23*yglukhov quit (Remote host closed the connection)
10:08:47Araqhow come?
10:09:45PMunchIt allows you two compare two diffs made to a single origin and create one merged version
10:11:02*bjz joined #nim
10:11:22PMunchThe problem with applying the 3.0.2 diff to the 3.1.0 files is that the file have changed enough so it's impossible for it to properly merge. So someone who can actually look at the code and figure out what from 3.1.0 is actually a new feature and what is simply a change to an old, previously removed one, have to do the merge.
10:11:39PMunchbut with something like Meld it should be fairly quick and easy to do
10:11:47*bjz_ quit (Ping timeout: 264 seconds)
10:16:36FromGitter<timeyyy> I have improved the example, In the python example they also manage to do it with coroutines, is that solution implementable in nim? http://paste.ofcode.org/38Z2Aembr9PRD9d9G988KHB
10:17:41*bjz_ joined #nim
10:18:57*bjz quit (Ping timeout: 276 seconds)
10:19:47AraqPMunch: ok, tell me how it goes please, it's interesting
10:20:23PMunchhttp://www.drdobbs.com/tools/three-way-merging-a-look-under-the-hood/240164902
10:20:27PMunchThat explains it pretty
10:20:28PMunchwell
10:20:50*vlad1777d quit (Quit: Leaving)
10:21:46PMunchIt short: instead of just diffing two files and merging those you diff two files from a common base file. That way the program can show only changes made in both branches and automatically merge the rest
10:22:17PMunchhttp://twimgs.com/ddj/images/article/2013/1213/Merge4.gif
10:22:28PMunchThat illustration photo sums it up
10:22:32*bjz_ quit (Ping timeout: 260 seconds)
10:22:33*bjz joined #nim
10:23:52*vlad1777d joined #nim
10:28:26*vlad1777d quit (Remote host closed the connection)
10:30:34*arnetheduck joined #nim
10:32:40*vlad1777d joined #nim
10:35:16*yglukhov joined #nim
10:36:20*yglukhov quit (Remote host closed the connection)
10:36:33*yglukhov joined #nim
10:40:43FromGitter<janicetr> Hey! I am writing a small program in Nim which needs to open and read zip files. Is there a library for that somewhere?
10:41:38*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:41:59FromGitter<timeyyy> http://nimble-explorer.com/
10:42:12FromGitter<timeyyy> try that
10:44:02FromGitter<janicetr> Thx!
11:00:19yglukhovAraq: whats the next version of nim to write news for?
11:01:20cheatfateyglukhov, i think 0.16.2 as always :) patch release
11:01:31yglukhovok =)
11:12:39Araqyeah, I guess that's true
11:14:12arnetheduckAraq, so, er, do you have a plan or decision? this is pretty much the last thing preventing a release of a fairly stable nlvm
11:14:42Araqwell your PR needs testing
11:14:51Araqlet's ask here.
11:15:44*yglukhov quit (Remote host closed the connection)
11:16:01*couven92 joined #nim
11:16:41arnetheduck anyone with a windows, osx or linux32 bit machine, can you please check out https://github.com/nim-lang/Nim/pull/5018 and run the test suite and let us know of results?
11:16:41Araqhttps://github.com/nim-lang/Nim/pull/5018 can you merge this branch into your devel environment and run this (at least)
11:16:56Araqtt gc && tt parallel && tt threads
11:17:03Araqtt stdlib && tt lib
11:17:11PMunchcouven92`
11:17:18PMunchs/`/?
11:17:27Araqwhere 'tt' is the alias for tests/testament/tester that everybody should have
11:18:00couven92um... let me see... I can try to run it off my Win2016 server... wanted to install the new Nim version there anyways :)
11:18:36PMunchWait, was that (Windows, OSX, or Linux) 32 bit machine. Or was it Windows, OSX, or (Linux 32 bit) machine?
11:19:19Araqosx 32bit is dead, I think
11:19:35Araqthe others have 32/64bit variants
11:19:41couven92and win (32-bit) is pretty much obsolete
11:19:41PMunchLinux 32 bit is pretty dead as well tbh
11:19:44couven92I'd way
11:19:55couven92s/way/say
11:20:04PMunchI mean, it still exists, but I don't think anyone uses it.. Unless they are actually running 32-bit architecture
11:20:41ArrrrThey are among us
11:21:02Araqwin32 is a very common target
11:21:25Araqin fact, on windows, I mostly use 32bit Nim.
11:21:44Araq64bit pointers are stupid anyway when you're not writing a database
11:27:51*yglukhov joined #nim
11:30:35*yglukhov quit (Remote host closed the connection)
11:37:20couven92Araq, ref: tt -> So I should run nim c -r tests/testament/tester?
11:37:53Araqnim c -r tests/testament/tester all
11:38:32*yglukhov joined #nim
11:39:31couven92goodie, running now (arnetheduck, I'm running with vcc on win64)
11:40:38flyxlinux 32bit is also pretty alive on embedded systems.
11:40:43*yglukhov quit (Remote host closed the connection)
11:41:27flyxI have a still actively maintained project that targets one. nobody there wants to move on to 64bit hardware.
11:41:52Araqarnetheduck: did you see tyAlias is now a thing in the compiler?
11:59:20*yglukhov joined #nim
12:01:57arnetheduckno I haven't, been on vacation
12:02:04arnetheduckhow did that go, smooth?
12:02:36*yglukhov quit (Remote host closed the connection)
12:02:48Araqpainful as usual.
12:02:52Araqbut it's done.
12:06:58*Snircle joined #nim
12:12:32*Arrrr quit (Quit: WeeChat 1.5)
12:14:49*lenstr joined #nim
12:15:01*yglukhov joined #nim
12:30:40*yglukhov_ joined #nim
12:30:40*yglukhov quit (Read error: Connection reset by peer)
12:31:19*der quit (Quit: No Ping reply in 180 seconds.)
12:32:25*derlafff joined #nim
12:36:16*xet7 quit (Quit: Leaving)
13:00:58*Jehan_ joined #nim
13:02:19Araqhi Jehan_, welcome back
13:02:49Jehan_Hi Araq!
13:07:18*Jehan_ quit (Quit: Leaving)
13:07:39*Jehan_ joined #nim
13:08:28*yglukhov_ quit (Remote host closed the connection)
13:14:13AraqJehan_: noticed the improved build times when you change a module
13:14:16Araq?
13:14:23*bjz joined #nim
13:15:53*rupil joined #nim
13:16:46*Kingsquee joined #nim
13:18:06Jehan_Araq: Hmm, build times have never been much of a problem for me, one way or the other.
13:19:06Araqwe have cases where things went from 150 C++ files to be recompiled down to 6
13:19:11Jehan_I think my workflow only infrequently triggers changes that resulted in big id changes even before that.
13:19:49Araqfair enough.
13:19:59Jehan_Also, I'm using C (not C++) with clang in general, which tends to be quite a bit faster than gcc.
13:21:49Jehan_Compiling the entire Nim compiler from scratch takes less than 8 seconds for me, for example.
13:22:08Araqwhy do you propose vec3.(x + y) over the more natural block: import vec3 ?
13:22:28Jehan_Not over. In addition.
13:22:49Jehan_OCaml, for example allows for both `let open Module in expr` and `Module.(expr)`.
13:23:15Jehan_The former is useful for a sequence of statements, the latter if you are dealing with expressions.
13:23:27Araqsure
13:23:54Araq(import foo; x + y + z)
13:24:13Jehan_Works also. I'm not particular about the syntax.
13:24:21Araqexcept that (;) usually doesn't open a new scope
13:25:02*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:25:19Jehan_The idea is to have a minimally verbose local import syntax.
13:25:56Jehan_The bigger problem is that with overloading instead of shadowing local imports may not do what users expect (intuitively).
13:26:26AraqD has local imports and they produced all sorts of problems
13:26:40Araqwhich is why I am not keen on trying them
13:26:54*yglukhov joined #nim
13:27:00Jehan_Yup. The reason why they work in SML and OCaml is that ML-languages don't do overloading.
13:27:14Jehan_Which, obviously, is a big nuisance in other contexts.
13:27:52*yglukhov quit (Remote host closed the connection)
13:28:24*yglukhov joined #nim
13:30:44*yglukhov quit (Remote host closed the connection)
13:30:59*yglukhov joined #nim
13:37:09AraqJehan_: isn't your proposal the opposite from mine though? I argue "you want the overloaded $ without being aware", you argue for "you want the overloaded $ in this particular context"
13:37:17*yglukhov quit (Remote host closed the connection)
13:39:06Jehan_Araq: Local imports were in response to lltp's note about use of programming languages in science.
13:39:27Jehan_The point I was trying to make is that it's a real nuisance if you have to qualify every single operation with a module.
13:39:53Jehan_Local imports would be a way to group these together.
13:40:32Jehan_M.(a + b + c) instead of a M.+ b M.+ c (not to mention that the latter syntax doesn't even work, I think).
13:41:34Araqno it would be M.`+`(a, b)
13:41:44Jehan_Yup. Even worse.
13:42:36Jehan_The other point I was making was about importing parts of a module and allowing the module to specify those parts.
13:43:23AraqIMO this decision should be left to the importer, not to the module
13:43:52FromGitter<andreaferretti> what is the issue with `from M import `+``?
13:44:04Jehan_But that results in problems with DRY. In any event, you can use both.
13:44:29Araqwhen I design Nim, I always have the guy in mind who gets aroused by System.Text.RegularExpressions.Regex
13:44:36Jehan_FromGitter: The context was that you might have multiple `+` operators and overloading may not be able to differentiate between them.
13:44:36FromGitterJehan_, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
13:44:45FromGitter<andreaferretti> I think most users coming from a scientific background
13:44:50FromGitter<andreaferretti> will happily `import M`
13:45:17Jehan_Araq: I'm not a big fan of that, either, but structuring namespaces can be useful.
13:45:26FromGitter<andreaferretti> scientific programming is pretty much the only context in which python users do `from M import *`
13:46:01Jehan_Module.SubModule.PartOfSubModule is much less of a problem when the only place where you use it is imports.
13:46:22Jehan_Or are allowed to make shorter module aliases at least.
13:46:39Jehan_It's a nuisance in languages that force you to qualify uses.
13:46:42FromGitter<andreaferretti> if you have multiple `+` operators that do not work with overloading
13:46:53FromGitter<andreaferretti> someone has designed the libraries wrong
13:47:31Jehan_That's sometimes easier said than done.
13:48:29flyxreading the forum thread, I immediately thought of `from Module import type Foo` even before I read Araq's answer containing exactly this
13:48:29FromGitter<andreaferretti> another possibility is to structure the library with submodules `lib/core.nim`, `lib/controversial_imports.nim`...
13:48:41FromGitter<andreaferretti> and then in `lib` re-export everything
13:48:58FromGitter<andreaferretti> so that users can import all of lib or parts of it
13:49:11FromGitter<andreaferretti> in case some clash arises
13:49:18Jehan_That works only if there are no mutual dependencies between modules.
13:49:20stisayou can always exclude parts no? `import math except pow`
13:49:39FromGitter<andreaferretti> yes, it requires to avoid cyclic dependencies
13:49:42Jehan_stisa: Not so nice if you have dozens of operations.
13:49:45FromGitter<andreaferretti> which is a good thing anyway
13:50:50Jehan_It's an ideal that can be difficult to accomplish in practice.
13:51:54FromGitter<andreaferretti> I usually put the things that are needed everywhere in `core`
13:52:02FromGitter<andreaferretti> and the rest is acyclic
13:52:19FromGitter<andreaferretti> otherwise, there is always `include`
13:52:52*yglukhov joined #nim
13:52:54Jehan_include is textual inclusion and results in replication.
13:53:35Jehan_Also, on a practical level, it can be nice if you don't have to deal with lots of little files.
13:56:28Araqwe could even go further and make 'from module import type Foo' enforce dotted access for non-operators
13:59:41*gokr quit (Ping timeout: 240 seconds)
14:03:12*nsf quit (Quit: WeeChat 1.6)
14:04:54*Ven joined #nim
14:11:07*Vladar quit (Remote host closed the connection)
14:11:11*Sentreen quit (Quit: WeeChat 1.4)
14:13:18*Sentreen joined #nim
14:13:48*nsf joined #nim
14:21:59*chemist69 quit (Ping timeout: 264 seconds)
14:35:14*chemist69 joined #nim
14:42:26cheatfatestrutils.toHex() is totally unusable for unsigned integers (Error: unhandled exception: value out of range: 253 [RangeError])
14:42:46cheatfatealways need to implement tohex
14:48:22Araqcast doesn't work?
14:49:49cheatfatealready found workaround, but somebody must make something with this `BiggestInt`...
15:01:34*Jehan_ quit (Quit: Leaving)
15:05:28*yglukhov quit (Remote host closed the connection)
15:06:51*Ven quit (Ping timeout: 252 seconds)
15:13:32*Jesin quit (Ping timeout: 256 seconds)
15:20:56*yglukhov joined #nim
15:22:41*Jesin joined #nim
15:25:25*yglukhov quit (Ping timeout: 240 seconds)
15:41:08*gokr joined #nim
15:41:44*hendi joined #nim
15:45:54*gokr quit (Ping timeout: 252 seconds)
15:50:18*Vladar joined #nim
15:51:29*[ui] joined #nim
15:54:42*yglukhov joined #nim
16:01:00*yglukhov quit (Remote host closed the connection)
16:03:58*handlex joined #nim
16:12:39*handlex quit (Quit: handlex)
16:19:25*stisa quit (Ping timeout: 245 seconds)
16:25:00couven92arnetheduck, Araq, what do you want with the requested PR test results? Got a lot of errors running with vcc on win64? (ref. PR 5018)
16:27:25Araqcouven92: gist it please
16:27:34AraqI'm sure most failures are expected
16:27:46Araqthe windows test results are in a bad shape -.-
16:29:24couven92will do... I of course forgot that the shell truncates after too much text... -.- So I'll run it again (piping it to log). But once it is done, I'll gist it :)
16:31:20couven92Shouldn't take to long though... When asked earlier I just started the tests on my remote server and then forgot about :P
16:32:24*stisa joined #nim
16:36:57FromGitter<Varriount> @vegansk I think that interfaces module would be handy to have in the standard library
16:38:04FromGitter<Varriount> couven92: You can change the buffer length on the shell
16:38:12FromGitter<Varriount> I think I set it to something like 5000 lines
16:38:50couven92@Varriount, yes I know! But that does not help after the fact! :P
16:39:36FromGitter<Varriount> Change the default though, that way there won't be an 'after the fact'
16:39:43couven92and the Win10/Win2016 command prompt actually has a line size of 9k lines
16:39:57FromGitter<Varriount> :O
16:40:11couven92(by default)
16:41:47couven92But running tt (nice abreviation Araq!) with the 'all' argument is quite verbose... Especially when you get a lot of errors. At least >9k
16:42:15nivis there a way to override the compiler binary 'nim c' uses? I tried the standard CC=/CXX= but that didn't have any effect
16:42:41*vlad1777d quit (Remote host closed the connection)
16:43:48couven92niv change the config/nim.cfg, or specify --cc:<compiler_class> in the nim command line, where compiler_class is the Nim'ish name of your compiler
16:44:31couven92ex: for explicitly GCC: --cc:gcc, for the MS C/C++ Compiler: --cc:vcc, etc.
16:44:59nivhmm, config/nim.cfg is in my home?
16:45:10couven92in the nim install dir
16:45:27nivi dont want to change the user default, just for that particular run. also nim-ish name is not good enough i think; i need to give the full path to the binary
16:46:24*unlaudable quit (Ping timeout: 255 seconds)
16:47:13couven92create <appname>.nim.cfg and define cc.path = 'your/path/to/compiler/bin'
16:47:24VladarWhat benign pragma means? Can't find it in the docs.
16:47:32*bjz joined #nim
16:48:26nivcouven92: in my project root or in the nim distro root? is there any docs where i can read up on that? didnt find any on the nimc page
16:48:42couven92next to the main nim file you compile
16:48:47nivokay
16:49:09couven92and <appnam> must be named as the main nim file you compile
16:49:39couven92(basically add .cfg for the corresponding config file that belongs to a nim project)
16:50:19nivgot it.
16:51:42nivis there some documentation on what can go into a file.nim.cfg?
16:53:49nivsweet, it's working. thank you :)
16:54:48*hzx joined #nim
16:55:34*PMunch quit (Quit: leaving)
17:01:28*yglukhov joined #nim
17:06:41nivis there a way to actually abort a nim process with a segfault? even abort() importc just coughs up an exception
17:06:59nivoh wait, nvm.
17:07:09*yglukhov quit (Ping timeout: 276 seconds)
17:07:21*pregressive joined #nim
17:07:39*pregressive quit (Remote host closed the connection)
17:09:23*pregressive joined #nim
17:14:00Vladarinteresting, it seems random(max: float) returns the same number on the first call, given the max value is the same…
17:15:37*hendi quit (Quit: hendi)
17:16:40federico3Vladar: after seeding it with the same seed?
17:16:50Vladarno, after randomize(
17:17:01federico3( ?
17:17:07Vladarrandomize()
17:17:17federico3uh oh
17:17:38Vladarnext calls after first one return random numbers, but first one — no
17:18:31Vladarimport random
17:18:31Vladarrandomize()
17:18:31Vladarfor i in 0..9:
17:18:31Vladar echo random(1.0)
17:19:28federico31.998401444325282e-15
17:19:44Vladaryep
17:20:19Vladaryou could change 1.0 to anything, the number will be different, but still repeating on the first call
17:20:50federico3obligatory http://dilbert.com/strip/2001-10-25
17:21:45Vladarobligatory https://xkcd.com/221/
17:26:53*Andris_zbx quit (Remote host closed the connection)
17:28:28Vladarwell, it could be avoided by a simple dry-run of "discard random(1.0)" after randomize(), but it is so hacky…
17:28:43*yglukhov joined #nim
17:31:47couven92Araq, arnetheduck, here's the Gist: https://gist.github.com/couven92/336fc1c0cfdf37dcea8cd0a4adaf0127
17:32:26couven92(Nim and Compiler information included at the top)
17:33:14*yglukhov quit (Ping timeout: 255 seconds)
17:34:37nivcouven92: thanks again for the help. nim+afl-fuzz working now :)
17:34:51couven92:)
17:35:45*nsf quit (Quit: WeeChat 1.7)
17:36:25*Trustable joined #nim
17:38:00federico3oh AFL is being run on Nim? Any repo or docs to look at?
17:38:38federico3https://hookrace.net/blog/afl-fuzz-nim/ this one probably
17:39:28nivit's actually quite simple. i'd write a blog post but i don't have a blog :)
17:39:52nivhttps://gist.github.com/niv/06cfeb1c1097ddcc57199ec08bcdd855
17:39:57nivthat's basically it.
17:40:22nivthen create a test program in afl.nim that walks the code path you want to test, shove some test cases at it, and let it run
17:43:32nivhmm, there's something screwy going on with the streams module
17:44:30nivstream.readData(somehugeint) hangs for a few seconds, even if the stream only has a few bytes in it
17:44:42*couven92 quit (Quit: Client disconnecting)
17:44:44nivi'd wager it allocates a 2GB buffer somewhere ..
17:48:17nivuhhh, where are the sources for readBuffer()? i assume it's written in C somewhere because its just stubbed in system.nim, but i cant find them in the repository
17:49:30federico3niv: any reason for using afl-clang instead of -gcc?
17:50:26nivnot really, they're symlinked to the same binary
17:50:54nivi haven't tested running it with afl-gcc, i just kind of figured i'd use clang since i'm used to it
17:51:20Araqniv: readBuffer is in lib/system/io.nim
17:51:47nivcheers
17:52:13Vladarwell, this seems to be the solution for that random(float) bug https://github.com/nim-lang/Nim/pull/5257
17:53:57nivAraq: found the "issue"; calling stream.readStr() with a long length allocates the buffer and then attempts to read it, meaning if the length is exceeding the available data it allocates needlessly. do you think it'd be worth it to rework it to read in chunks, or is that a user problem?
17:54:38nivusecase would be reading a length-prefixed string off the network, for example; but knowing a valid length cutoff is a nontrivial problem for applications, so making it failure-resistant in stdlib could be useful?
17:54:54*shodan45 joined #nim
17:57:33AraqreadBuffer is not for networking, use a socket for that
17:57:54Araqand yes, it's a user error, this is some low level call it doesn't make you coffee
17:57:56nivreading a file then that was supplied by the user
17:58:08nivoh, shame. could use some. well, okay
18:00:40AraqVladar: hmm? what bug?
18:01:21VladarAraq: random(max: float) returns the same number on the first call, given the max value is the same.
18:01:48Vladarimport random
18:01:48Vladarrandomize()
18:01:49Vladarfor i in 0..9:
18:01:49Vladar echo random(1.0)
18:02:30Vladari.e. on each program run the first walue will be 1.998401444325282e-15
18:02:58Araqno, for me it's 2.220446049250313e-015
18:03:18Araqit's just that the randomize() uses a shitty seed that stays the same for quite some time
18:03:27VladarMay be on other architecture it differs
18:03:57Araqhmm running it multiple times
18:04:01Araqit appears you are correct
18:04:10*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
18:04:46Araqbut look at its code
18:04:50Araqit starts with let x = next(state)
18:05:36Vladarso I added one dry run of next(state) into randomize() to bring it into working condition
18:08:01Araqoh well.
18:08:03euantorAraq: I'm looking at strscans for the first time, it seems neat. Is there an easy way to have an optional match? EG: 0 or 1 times
18:08:21dom96ooh, nice to see so much activity here
18:08:48AraqVladar: I'm going to accept it.
18:09:52dom96Sorry about the offtopic question but anyone know of a tool that can automatically crop an image? Say for example I have various images that have a picture in the top left of an A4 page and I want to crop it so that the resulting image is only that picture.
18:09:57VladarAraq: thanks, the random module is paramount for my projects
18:10:48Vladardom96, imagemagic? https://www.imagemagick.org
18:11:15dom96Vladar: It sorta has what I want, but it can't automatically detect what to crop.
18:11:54federico3Vladar: assert random(1.0) != 1.998401444325282e-15 would be fun to see in the test files (and fail once in a century)
18:12:01Vladardom96: oh, I thought the image dimensions are the same on all pages
18:12:04*yglukhov joined #nim
18:12:18dom96Vladar: nope :)
18:13:12Vladarfederico3: it seems, the result differs on different machines anyway. And when you run next(state) just once, it works as intended
18:13:55Vladardom96: https://www.imagemagick.org/script/command-line-options.php#trim
18:14:10dom96Vladar: That's exactly what I tried already :)
18:14:23dom96-trim -fuzz 60% +repage
18:14:24Araqspeaking about #offtopic
18:14:39Araqanybody knows an email client for Windows that doesn't suck?
18:14:42*yglukhov quit (Remote host closed the connection)
18:14:52dom96The ideal -fuzz value is different for each image :\
18:15:22Araqeuantor: no, | is missing and I want to rewrite scanp
18:15:33dom96Araq: thunderbird
18:15:33Araqit has the right ideas, but the algorithm could be better
18:15:36Araqlol
18:15:40Vladardom96: if these are scans, you might try to increase contrast first
18:15:43AraqI said "doesn't suck"
18:16:20dom96Vladar: They're not, so I'm puzzled as to why it doesn't work.
18:16:49dom96I guess I will need to create a quick Nim script to do it
18:17:15Vladardom96: tried to add border of background color first?
18:17:47*Pisuke quit (Ping timeout: 248 seconds)
18:17:55dom96Vladar: no, maybe that's what gets it confused
18:18:05dom96The background color of the image is white
18:18:15dom96and the border is white too
18:18:33dom96For context: it's diagrams for my book.
18:18:46dom96So it's a bunch of boxes with text and arrows.
18:19:11Vladarjpg or png?
18:20:48Vladarand speaking about #on-topic, what the "benign" pragma does?
18:20:57dom96png
18:21:18Vladarit's even more weirder with png…
18:22:36dom96yeah :\
18:22:45AraqVladar: it's a shortcut for locks: 0, gcsafe
18:23:10VladarAraq: thanks
18:30:30nivAraq: whats your idea of doesnt suck?
18:30:38*yglukhov joined #nim
18:31:59nivAraq: http://www.claws-mail.org/ maybe? i just use webmail honestly.
18:34:50*yglukhov quit (Ping timeout: 245 seconds)
18:38:09euantorAraq: alright, thanks.
18:40:52*abruanese quit (Ping timeout: 246 seconds)
18:43:14*handlex joined #nim
18:44:24*brson joined #nim
18:47:52*vlad1777d joined #nim
18:47:53*stisa quit (Ping timeout: 258 seconds)
18:48:02*abruanese joined #nim
19:03:39*shodan45 quit (Quit: Konversation terminated!)
19:04:38*yglukhov joined #nim
19:07:57*Pisuke joined #nim
19:08:39*yglukhov quit (Ping timeout: 240 seconds)
19:12:55*yglukhov joined #nim
19:14:12*smt quit (Quit: Leaving)
19:14:45*smt joined #nim
19:16:33*Pisuke quit (Ping timeout: 252 seconds)
19:26:35*[ui] quit (Quit: Connection closed for inactivity)
19:30:18*handlex quit (Quit: handlex)
19:31:35*handlex joined #nim
19:33:47*beaumonta joined #nim
19:34:06*beaumonta is now known as abeaumont
19:38:12*pregressive quit (Remote host closed the connection)
19:38:31dom96I may just retract my previous statement about VS code.
19:38:39dom96It's beginning to annoy me more often than not.
19:38:47*pregressive joined #nim
19:42:03euantorWhat does the following error mean? The directory structure is `src/private/common.nim`, so surely that should be OK? https://www.irccloud.com/pastebin/Z8ANsJar/
19:42:41*xet7 joined #nim
19:42:43euantorI'm seeing this for most packages, including Jester
19:43:16*pregressive quit (Ping timeout: 256 seconds)
19:43:42*bjz joined #nim
19:44:41federico3Is stdin.readline not recommended? Maybe it should be mentioned in rdstin.nim
19:45:32*dddddd joined #nim
19:48:24Araqdepends
19:51:27dom96euantor: no, that's not okay.
19:51:38dom96The private directory itself needs to be namespaced
19:51:59euantorSo it needs to be `src/mypackage/private`?
19:52:08dom96yes.
19:52:16dom96Also, regarding https://github.com/euantorano/semver.nim/issues/2
19:52:27dom96My guess is the tag confused it
19:52:44euantorHm, okay. I'll do that. Maybe best to document that clearly :)
19:53:01euantorYeah, that's what I assume. The version in the `.nimble` file wasn't updated either
19:53:05dom96euantor: it is documented
19:53:15euantorI must have missed it then
19:53:40dom96Everything is documented in Nimble's readme
19:54:01*libman joined #nim
19:56:18*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
19:57:03*shodan45 joined #nim
19:59:54euantorFound it: `import PackageName/private/module`, not sure how I missed that, sorry
20:02:55*handlex_ joined #nim
20:04:09*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:05:45*handlex_ quit (Client Quit)
20:05:47*handlex quit (Ping timeout: 264 seconds)
20:07:59*stisa joined #nim
20:09:06*stisa left #nim (#nim)
20:11:30*stisa joined #nim
20:11:54*abruanese quit (Ping timeout: 240 seconds)
20:12:05*rokups quit (Quit: Connection closed for inactivity)
20:19:07*libman2 joined #nim
20:19:13*libman quit (Remote host closed the connection)
20:20:32*yglukhov quit (Remote host closed the connection)
20:20:46*yglukhov joined #nim
20:21:58VladarAraq: do you need some of these utility procedures in random.nim? https://github.com/Vladar4/nimgame2/blob/master/nimgame2/utils.nim#L118
20:23:07nivTWIMC, work in progress between federico3 and me -> https://github.com/nim-lang/Nim/wiki/Fuzzing-your-nim-code-to-rabbit-out-all-the-hard-bugs
20:24:55federico3niv did most of the work
20:25:03*yglukhov quit (Remote host closed the connection)
20:27:41*yglukhov joined #nim
20:28:57dom96nice, you guys wanna post it to nim-lang.org?
20:30:39nivdunno if that's worth it, even though i think fuzzing should be part of any dev workflow that deals with input
20:32:13*abruanese joined #nim
20:33:46euantorThanks for responding to that issue dom96
20:33:55dom96np
20:34:55dom96niv: I think it will get more views that way and will be more easily accessible
20:35:19dom96Plus, I want to start a guest post series like all the other language blogs are doing (D,Crystal)
20:35:33nivalright, but i'll have to make some more edits. its still WIP
20:36:20nivyou mean, like, start a blog where people can post entries themselves? or something curated by you?
20:37:44dom96curated by me
20:38:40*libman joined #nim
20:39:12*libman2 quit (Remote host closed the connection)
20:42:17*libman2 joined #nim
20:44:19nivdom96: well, if you want, feel free to blog about it :) i just hope more people get into the habit of testing their code with fuzzing
20:44:38*libman2 quit (Remote host closed the connection)
20:44:41GaveUpone of the things I need to toy around with more
20:45:07GaveUpbut I'm more interested in fuzzing "not my code"
20:45:40*libman quit (Ping timeout: 245 seconds)
20:46:18FromGitter<barcharcraz> I wish vs code would open up just a tad faster
20:46:23FromGitter<barcharcraz> but other than that I like it pretty well
20:46:39FromGitter<barcharcraz> it's obvious that the plugin author experience is better than many other editors
20:51:54*libman joined #nim
20:55:03*bjz joined #nim
21:12:49*libman2 joined #nim
21:12:53*libman quit (Remote host closed the connection)
21:17:37*yglukhov quit (Remote host closed the connection)
21:17:53AraqVladar: sorry no, seems very specialized
21:20:35*yglukhov joined #nim
21:25:12*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:31:49*hendi joined #nim
21:35:09*shodan45 quit (Quit: Konversation terminated!)
21:38:54*hendi quit (Ping timeout: 240 seconds)
21:43:26*libman joined #nim
21:43:27*libman2 quit (Remote host closed the connection)
21:43:55nivis there a compile-time equivalent to "case" like "if->when"?
21:50:43*libman quit (Remote host closed the connection)
21:52:05*pregressive joined #nim
21:55:34*rtr_ joined #nim
21:57:31FromGitter<Varriount> niv: Unfortunately, no.
21:58:33nivcheers. and there's no elwhen either, i presume?
22:02:00*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:03:03FromGitter<Varriount> niv: You can use 'else' and 'elif' with 'when': http://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
22:03:34nivwell thats kind of nonintuitive. thank you :)
22:03:49FromGitter<Varriount> niv: I dunno, it's a fairly subjective point.
22:04:06FromGitter<Varriount> I found it intuitive when I first encountered it.
22:04:52FromGitter<Varriount> niv: Although, I'm curious, what keywords would you use?
22:05:03*devted joined #nim
22:05:27nivelwhen/else, i guess. but that's not much better.
22:05:45nivi agree that its quite subjective
22:10:53*couven92 joined #nim
22:22:34federico3when/elif/else is a bit unexpected but better than when/whif/whelse !
22:33:50*bjz joined #nim
22:34:25*EastByte quit (Ping timeout: 245 seconds)
22:40:36FromGitter<Varriount> federico: This code smells, there's a bunch of whifs in it.
22:49:31*EastByte joined #nim
23:00:20*chemist69 quit (Ping timeout: 240 seconds)
23:08:19*Pisuke joined #nim
23:10:20*Kingsquee quit (Read error: Connection reset by peer)
23:10:30*MyMind quit (Ping timeout: 276 seconds)
23:10:45*Kingsquee joined #nim
23:27:25*chemist69 joined #nim
23:35:39*yglukhov quit (Remote host closed the connection)
23:43:31*bjz quit (Ping timeout: 240 seconds)
23:44:18*devted quit (Quit: Sleeping.)
23:47:05*bjz joined #nim
23:50:15*pregressive quit (Remote host closed the connection)
23:50:52*pregressive joined #nim
23:55:00*pregressive quit (Ping timeout: 240 seconds)
23:58:24*stisa quit (Ping timeout: 240 seconds)
23:58:36*EastByte quit (Ping timeout: 276 seconds)
23:59:43*EastByte joined #nim