<< 29-11-2017 >>

00:00:33*vivus quit (Quit: Leaving)
00:15:32*Sentreen quit (Ping timeout: 240 seconds)
00:15:42*zippyy joined #nim
00:26:09*zippyy quit (Ping timeout: 248 seconds)
00:28:00*Sentreen joined #nim
00:29:47*rbrt joined #nim
00:40:04*MJCaley joined #nim
00:40:36*zippyy joined #nim
00:47:53rbrthow should i set a variable to the min/max value of a type? like the smallest/largest possible float, etc?
00:53:02FromGitter<zetashift> @dom96 what did he say about Nim?
00:53:29dom96zetashift: he didn't (this time at least :))
00:55:41dom96rbrt: high() and low()
00:57:50rbrtdom96: oh gotcha, must have missed that when i glanced through the docs. thanks!
01:12:02*zippyy quit (Ping timeout: 276 seconds)
01:15:09*zippyy joined #nim
01:25:12*rbrt quit (Quit: Slán agat)
01:54:52*marenz__ quit (Ping timeout: 240 seconds)
01:57:21*MJCaley quit (Quit: MJCaley)
01:59:01*endragor joined #nim
02:03:26*endragor quit (Ping timeout: 255 seconds)
02:09:14*chemist69 quit (Ping timeout: 276 seconds)
02:11:32*vlad1777d quit (Ping timeout: 255 seconds)
02:14:32*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:22:35*chemist69 joined #nim
02:26:01*MJCaley joined #nim
02:33:00*endragor_ joined #nim
03:05:57*MJCaley quit (Quit: MJCaley)
03:05:59*Jesin quit (Quit: Leaving)
03:07:35ftsfdom96, ooh yeah! LD =) good luck!
03:07:50ftsfdidn't realise it was this weekend!
03:08:07ftsfi should tidy up NICO before it
03:10:10*Jesin joined #nim
03:17:57*zippyy quit (Ping timeout: 240 seconds)
03:26:07*zippyy joined #nim
03:32:00FromGitter<Varriount> I wonder what the nimue bindings are like
03:35:55*zippyy quit (Ping timeout: 250 seconds)
03:44:39*zippyy joined #nim
04:08:28*joshbaptiste quit (Ping timeout: 240 seconds)
04:12:22*zippyy quit (Ping timeout: 264 seconds)
04:27:06*zippyy joined #nim
04:27:36*dddddd_ quit (Remote host closed the connection)
04:35:26*joshbaptiste joined #nim
04:56:01*zippyy quit (Ping timeout: 248 seconds)
05:21:30*JappleAck joined #nim
05:29:07*astronavt joined #nim
06:23:05*miran joined #nim
06:24:45*nsf joined #nim
06:42:50*yglukhov joined #nim
06:44:50*yglukhov_ joined #nim
06:44:50*yglukhov quit (Read error: Connection reset by peer)
06:55:01*Jesin quit (Quit: Leaving)
06:58:26*libman quit (Quit: Connection closed for inactivity)
07:00:50*endragor_ quit (Remote host closed the connection)
07:03:01*yglukhov_ quit (Read error: Connection reset by peer)
07:03:16*yglukhov joined #nim
07:03:32*yglukhov quit (Client Quit)
07:11:43*miran quit (Ping timeout: 250 seconds)
07:28:52*endragor joined #nim
07:35:12*xkapastel quit (Quit: Connection closed for inactivity)
07:37:44*gokr joined #nim
07:43:48*PMunch joined #nim
07:47:58*Vladar joined #nim
07:54:25*miran joined #nim
07:57:36*livcd quit (Changing host)
07:57:36*livcd joined #nim
08:23:32*claudiuinberlin joined #nim
08:24:57*sendell joined #nim
08:33:50*endragor quit (Remote host closed the connection)
08:37:18*couven92 joined #nim
08:37:46*floppydh joined #nim
08:42:10*endragor joined #nim
08:44:10*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
08:45:09*sakalli joined #nim
08:46:18*claudiuinberlin joined #nim
08:47:32*claudiuinberlin quit (Client Quit)
08:48:10*claudiuinberlin joined #nim
08:49:01*qwertotter is now known as qwertfisch
08:50:31FromGitter<Varriount> @dom96 Did you change the forum CSS at all? Currently all the topic listings have horizontal scrollbars on my computer.
08:51:44FromGitter<Varriount> (https://files.gitter.im/nim-lang/Nim/DdJZ/image.png)
08:57:34*jjido joined #nim
09:07:35*vlad1777d joined #nim
09:36:13*skrylar_ joined #nim
09:48:27*BitPuffin|osx joined #nim
09:58:18*vlad1777d quit (Ping timeout: 268 seconds)
10:05:46*sakalli quit (Ping timeout: 264 seconds)
10:06:29FromGitter<andreaferretti> Did something changed recently in the way `asynchttpserver` extracts the path string?
10:06:45FromGitter<andreaferretti> I have a strange bug in Rosencrantz
10:07:32FromGitter<andreaferretti> For those not familiar with how Rosencrantz work it is a little complex to explain, but I will try
10:07:55FromGitter<andreaferretti> In Rosencrantz, applications are defined by composing routes
10:08:47FromGitter<andreaferretti> Routes are things that filter the request, extract parameters from it and possibly complete the request by responding
10:09:00FromGitter<andreaferretti> or reject the request, which is then passed to the next route
10:10:20FromGitter<andreaferretti> I have a route called `intSegment` which extract an integer from a segment of the path (something between two consecutive `/`)
10:11:29FromGitter<andreaferretti> it is defined here https://github.com/andreaferretti/rosencrantz/blob/master/rosencrantz/handlers.nim#L75-L85
10:12:15FromGitter<andreaferretti> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1e87ff71ad3f8736436c03]
10:12:59FromGitter<andreaferretti> the function `inner` receives the string `"3"` in my test
10:13:19FromGitter<andreaferretti> but when I try `n = s.parseInt`
10:13:39FromGitter<andreaferretti> I get the exception `invalid integer: 3`
10:14:01FromGitter<andreaferretti> and if I try `s == "3"` I get `false`
10:14:21FromGitter<andreaferretti> so the string `s` is not the string `"3"`
10:14:31FromGitter<andreaferretti> but it prints as `3`, without spaces
10:15:11FromGitter<andreaferretti> now, this string is the final slice of the request path, which is `/repeat/hello/3`
10:16:09FromGitter<andreaferretti> so I was wondering whether the request path in `asynchttpserver` is missing the terminator or something that breaks the parsing
10:17:40*sakalli joined #nim
10:18:05*PMunch quit (Quit: Leaving)
10:19:38*PMunch joined #nim
10:21:01Araqandreaferretti check via 'len' for hidden '\0's in your string
10:21:06FromGitter<andreaferretti> ok
10:21:39AraqI'm not aware of any changes in asynchttpserver's behaviour but things are constantly changing and we might have broken something
10:22:24FromGitter<andreaferretti> in fact `s.len` is 2
10:22:34FromGitter<andreaferretti> now, I get `s.len` via
10:22:39FromGitter<andreaferretti> sorry `s` via
10:23:15FromGitter<andreaferretti> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1e8a9387680e6230abe68a]
10:23:38FromGitter<andreaferretti> so it is a slice `pos .. path.len` of `path`
10:23:46Araqthat is not correct code
10:23:55FromGitter<alehander42> how can I run a single test in nim suite ?
10:23:58FromGitter<andreaferretti> where `path` is the string `req.url.path`
10:23:59Araqfinal needs to be path.len-1
10:24:16FromGitter<andreaferretti> uh you're right
10:24:24Araqthis was recently fixed, the behaviour of '..' did hide this
10:24:26FromGitter<andreaferretti> I wonder how it did work correctly until now
10:24:31FromGitter<andreaferretti> ah ok
10:24:34Araqand the terminating zero needs to die :-)
10:24:34FromGitter<andreaferretti> great!
10:25:05*Vladar have ported VoxelSpace engine demo to Nim/SDL2 if anyone interested https://github.com/Vladar4/NimVoxelSpaceDemo
10:25:13FromGitter<andreaferretti> it works now!
10:25:19FromGitter<andreaferretti> silly error
10:25:40FromGitter<andreaferretti> I did not think of that because it was working earlier, so I thought the bounds where ok
10:25:45Araqhappens to everybody. ugh, I think dom's book does document the terminating zero
10:25:46FromGitter<andreaferretti> thank you Araq
10:26:44FromGitter<dom96> Araq: what do you want help with?
10:27:43AraqVladar: nice, can you do a "magic carpet" game
10:30:04Vladarthat implies half-decent understanding of 3D math which I can't say for myself ) The VoxelSpace algorithm is pretty simple though so it could be done in theory. Keep in mind that this thing will run with software render speed.
10:31:33FromGitter<dom96> @Vladar cool! I saw that on HN a couple days back, nice to see a Nim implementation :)
10:32:29FromGitter<alehander42> can I add a test, but tell Nim to skip it in the comment ?
10:33:43Vladar@dom96 it's always a good challenge to port such stuff to other language =) managed it in about 1.5 days and less than 500 LoC total )
10:36:39federico3Vladar: that's the whole rendering? 50 lines in render() ? :D
10:36:56Vladaryep, plus line()
10:36:59Araqalehander42: disabled: "true" in the spec section
10:39:26federico3Vladar: perhaps I could use it to render 3D patterns for https://github.com/FedericoCeratto/wave_function_collapse
10:40:04FromGitter<alehander42> Araq: nice
10:41:25Vladarfederico3: just keep in mind that it uses indexed PNG's as maps and you'll need to modify loadMap() if you want to feed it anything else
10:42:37Vladarcolor map is indexed color and height map is 8bit greyscale
10:42:52skrylar_voxels?
10:43:43skrylar_i have some pdfs for spherical raytracing with distance fields. haven't written a nim impl tho
10:47:59*JappleAck quit (Ping timeout: 248 seconds)
10:50:26AraqI'm about to change how the overloading of the dot operator works. instead of
10:50:43Araqtemplate `.`(x: MyObject; field: static[string]): untyped
10:50:47Araqthe signature will become
10:50:54Araqtemplate `.`(x: MyObject; field: untyped): untyped
10:51:06Araqwhich I feel is much more natural. any opinions?
10:51:48Araqyou can then do forwarding to a nested object in a straight-forward fashion
10:52:00Araqwithout any macro machinery
10:52:17couven92makes sense
10:52:19Araqtemplate `.`(x: MyObject; field: untyped): untyped = x.nested.field
10:52:31Araq# delegate to 'nested'
10:52:37FromGitter<andreaferretti> as long as it does not break `jsffi` it seems good :-)
10:52:46AraqI patched jsffi already
10:52:51Araqto see if it works out
10:52:51FromGitter<andreaferretti> great
10:52:59Araqthe changes are straight-forward
10:53:07couven92could we make {.exportjs.} as an alias to {.exportcpp.}?
10:53:07Araqplus jsffi doesn't adhere to the spec anyway
10:53:16Araqit uses static[cstring]
10:53:25Araqthe spec only mentions static[string]
10:53:27couven92importjs, importcpp, I mean
10:53:47Araqcouven92: problem is that we don't know what 'importcpp' should be named like
10:54:03Araq'importPattern' makes the most sense
10:54:08couven92Ah
10:54:22Araqbut then 'importjs' vs 'importPattern' is strange
10:54:44Araqmaybe 'importIdent' and 'importPattern' ?
10:55:28couven92Hmm... yeah I see... But right now it's importcpp, so maybe just do a quick-fix? ah, well if you really mind, I guess you could anyways do {.pragma: importjs, importcpp.}
10:55:59Araqyeah but it's ugly and we should do something
10:56:09Araqbut I don't know what...
10:56:39couven92about static[T], can't you theoretically do anything as static? as long as the compiler can create the value at compile-time?
10:57:21Araqcouven92: you can do anything but where else in the language gets an AST converted to a static[string]?
10:57:31couven92ah
10:57:34Araqit's a weird unnecessary special case
10:57:45Araqthat bites for simple delegations
10:58:15couven92I guess static[cstring] makes sense though if you're really interesting in emitting a pure C string literal?+
10:58:29Araqtemplates can use astToStr
10:58:35Araqmacros can use repr
10:58:46Araqyou can get the string easily enough
10:58:47FromGitter<andreaferretti> I am trying to install c2nim on a fresh computer, using `devel` but `nimble install c2nim` fails with ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1e92e68b3a9e2c0c2f814f]
10:59:15couven92@andreaferretti, ran into the same problem yesterday :)
10:59:24livcdDo i need to do something specific to compile a program for windows 2008 ?
10:59:28FromGitter<andreaferretti> do you have a solution?
10:59:54Araqhow is 0.16 the devel version?
10:59:58couven92nope... It's a regression, someone should file an issue, but was too lazy yesterday and just moved on :P
11:00:29*JappleAck joined #nim
11:00:33couven92Araq, I had this on 0.17.2
11:00:37FromGitter<andreaferretti> maybe `c2nim` depends on `nim 0.16`?
11:00:57Araqit doesn't, it only work with devel -.-
11:01:27couven92@andreaferretti, newer Nim is also okay: https://github.com/nim-lang/c2nim/blob/master/c2nim.nimble#L9
11:02:03couven92nimble just installed 0.16.0, because it probably hadn't installed something else yet?
11:02:10FromGitter<andreaferretti> probably yes
11:02:26FromGitter<andreaferretti> so should I `nimble isntall compiler`?
11:02:42FromGitter<andreaferretti> maybe `c2nim` should come with `koch tools` to solve this once and for all
11:02:46couven92yeah, I did a `nimble install [email protected] [email protected]`
11:03:16couven92and then maybe reinstall c2nim? maybe downgrade to 0.17.0 if that doesn't work
11:03:41FromGitter<andreaferretti> I am trying to install `compiler` 0.17.2 manually
11:03:53FromGitter<andreaferretti> Downloaded package's version does not satisfy requested version range: wanted 0.17.2 got 0.17.3
11:03:57FromGitter<andreaferretti> uff
11:04:13FromGitter<andreaferretti> this is what happens when people do not tag github releases
11:04:36couven92well compiler is the main nim repo, so that one should be tagged properly
11:05:11Araqandreaferretti: instead c2nim should work with any kind of compiler version really, the change seems trivial
11:05:55FromGitter<andreaferretti> trying to install compiler 0.17.3
11:06:09couven92okay, do a `git clone https://github.com/nim-lang/Nim.git -- /tmp/nim-temp && cd /tmp/nim-temp && git checkout tags/v0.17.0 && nimble install -y`
11:06:14couven92maybe that helps
11:06:27FromGitter<andreaferretti> installing [email protected] worked!
11:07:59couven92BTW in a nimble file can you specify ranges? like `requires nim >= 0.16.0 < 0.17.2`?
11:08:15Araqsure
11:08:30couven92cool! :)
11:08:59Araqyou then need to ensure your package does compile with 0.16.0, 0.16.2, 0.17.0
11:09:12Araqwhich is why I don't believe in versioning.
11:09:35Araqit's creates an exponential of combinations you need to test against.
11:09:56Araqit's intractable.
11:10:53Araqyou need to pin down everything, semantic versioning is a fiction.
11:11:05couven92Araq, well, here it's a regression in the API, so in normal situations you'd be able to get a changelog and adjust your dependencies to version ranges where the API stayed the same...
11:11:29livcdah on windows 2008 (or at least this server) when i call execCmdEX("powershell.exe Get-Service") it hangs. normal cmd work fine
11:12:06Araqdo you setup your CI to test against every version you claim is working?
11:12:25Araqno? there you go. it's fiction.
11:12:26couven92Araq, no I wouldn't! :P
11:13:03*jjido quit (Ping timeout: 248 seconds)
11:13:41couven92livcd, Get-Service in powershell takes a few seconds before it actually outputs something
11:19:32livcdcouven92: it's instant when invoked directly or on my localhost via nim
11:21:26dom96Araq: btw I explain the difference between importc and importcpp in my book as well, in the context of JS :)
11:21:48Araqthe old stuff will continue to work
11:21:54couven92livcd, really? Hmm... took some seconds here on my computer... but okay, then I don't know :P
11:24:25*fraya joined #nim
11:24:37dom96"you need to pin down everything" - yep, that's why lock files exist.
11:26:04Araqdo they? ;-)
11:26:11livcdcouven92: it takes 36 milliseconds to finish when invoke with nim or directly from cmd like this powershell.exe Measure-Command { Get-Service }
11:26:24couven92cool :)
11:31:40*marenz__ joined #nim
11:36:35dom96Araq: Although yeah, it makes me wonder. Once you have lock files the version requirement specifications really don't seem to matter anymore.
11:36:55dom96I'm probably just missing something though
11:38:16Araqin nawabs I distinguished between tinkerings and reproducible builds and threw away the versions but that's the radical solution nobody agrees with
11:38:42Araqyou tinker until something works and then you pin the build... :-)
11:40:22skrylar_thats how you end up with changelog files for version control ._.
11:40:50skrylar_i still have badfeels from Go for doing things like that
11:41:33skrylar_i fixed a bug in hugo and it was painful because everyone was just importing git repos for dependencies and it was a royal pain in the ass to properly git-bisect the bug
11:42:18AraqI would replace versions with release dates...
11:42:34Araqthis way they at least have some comparative value
11:42:50skrylar_that's probably servicable
11:43:15Araqand you know version 2016-03-01 was tested with a compiler before that date
11:47:03Araqand C99 is more meaningful than C# version 6.0
11:47:35skrylar_well
11:47:58skrylar_just make sure to either vendor the dependencies or use submodules or some meaningful thing
11:48:26skrylar_from experience its a nightmare when you can't bisect a bug easily because every other build requires a chain of other repos to be at unspecified commits
11:49:01Araqnothing is unspecified in a reproducible build
11:49:21skrylar_lol reproducible builds :)
11:50:14Araqyou don't believe in those?
11:50:44skrylar_don't those require everyone down the build chain to behave
11:51:00*astronavt quit (Remote host closed the connection)
11:51:37federico3behave?
11:51:55Araqit's just a collection of git repos. ask every repo about the current commit hash and remember it
11:52:07Araqthat's what nawabs does
11:52:14skrylar_there are reproducible builds (security variant) where two unrelated parties compile code and the binaries are checksum identical
11:52:30federico3skrylar_: correct
11:52:52skrylar_that requires everyone down the line behaves properly (ex. gcc doesn't do something random)
11:53:21dom96hrm
11:53:23federico3of course
11:53:35dom96actually there is a good reason for specifying version ranges
11:53:43skrylar_if you mean reproducible as in, other people can build it, then that's just good package management?
11:54:23federico3skrylar_: reproducible means identical binaries
11:54:40skrylar_federico3, sounds like more trouble than its worth
11:54:44AraqI mean reproducible as in "others can build it"
11:54:46dom96Your dependencies will undoubtedly depend on the same package but a different commit hash of it
11:55:02Araqthe security stuff is a different topic
11:55:10skrylar_the security variant is an answer to "trusting trust"
11:55:17federico3skrylar_: the current attempts have been widely successful.
11:55:25skrylar_the problem is that your CPU runs a secret version of minix which defeats the entire point
11:55:26dom96you won't be able to compile then, so you'd fall back onto the version ranges then and pick a commit hash that works for both dependencies...
11:55:43dom96lock files are hard
11:56:07federico3also some industries has been doing repro builds for decades without much fanfare
11:56:28skrylar_federico3, i'm mostly just being cynical in that every CPU is backdoored from day one, which makes security pointless
11:56:37skrylar_except maybe SPARC and POWER but good luck getting those
11:56:40federico3it's still not pointless
11:57:15skrylar_last i read someone finally got a jtag connection and broke in to the management engine, so we're starting to find out just what secret shit intel is doing
11:57:38Araqit's like the Simpsons episode where Homer wants to buy a stone from Lisa
11:57:40federico3skrylar_: it's not that simple
11:58:13Araqstones are wildly successful in keeping away tigers
12:00:46Araqthe point of "trusting trust" is not "how to castigate yourself for decades", the point is "real security is impossible, deal with it"
12:01:16skrylar_thats what the distributed double compilation paper was about though
12:01:40skrylar_deterministic builds (that was the security version of 'reproducible' now that i remember) counter a single hacked compiler situation
12:02:40Araqjust try to create a compiler that inserts undetectable backdoors. try it.
12:02:57skrylar_thompson did tho
12:02:58Araqit's a paper tiger, nobody has ever done it successfully.
12:03:19Araqyou need to teach your compiler to miscompile yet-to-be-written disassemblers.
12:03:46dom96what, nobody has done it? Seems quite easy to me
12:03:58Araqthen read and understand the paper properly.
12:04:07skrylar_dom96, it hasn't been documented as a successful attack in the field, but researchers have done similar things as examples
12:04:21Araq"similar" things. yes.
12:04:46skrylar_the problem is that its just far easier to blackmail/bribe/"convince" a CPU maker to put in secret backdoors than it is to say, manage to con the FSF in to doing it
12:04:54skrylar_or even just get microsoft to do it
12:05:18skrylar_i have a whitepaper around here somewhere that talks about doing it over firmware updates
12:05:35skrylar_anyway
12:05:51skrylar_reproducible is good. although i thought that's what ex. bundle files were for (admittedly thats a ruby thing)
12:06:18federico3it's much easier to plan malicious code using any other tool as part of a build process once an attacker gains access to a buildbot
12:06:22federico3and that happened
12:06:29*dddddd joined #nim
12:08:05Araqit doesn't only affect compilers either. a single malicious Linux binary can inspect the running gcc process and make it insert backdoors
12:08:25Araqagain, you might want to try to implement that one.
12:08:39skrylar_speaking of, the grsec guys stopped giving out the patch files :/
12:09:24skrylar_seem to have given up on FOSS and are off chasing patents involving code replay attacks
12:10:28Araqdoes Linux build on BSDs to prevent that a malicious Linux kernel inspects the gcc that builds the new version of the Linux kernel?
12:10:59skrylar_Araq, i mean, if i had enough sus then linux wouldn't build on anything because we would just use BSDs
12:11:02Araqdo the BSDs build on Linux for the same reason?
12:11:27Araqdoes anybody really give a fuck about "trusting trust" or is it just an intellectual masturbation?
12:11:51skrylar_"linux hackers make something that works right now. BSD hackers spend years trying to make sure the hack is perfect" :P
12:11:55Araqheck, does anybody really understand that paper...
12:12:09floppydhskrylar_: perfect ...
12:12:21skrylar_i meant hackers as in virus people, but well
12:12:23skrylar_it works either way
12:12:29floppydhsomeone link the paper again?
12:12:35federico3*facepalm*
12:12:55skrylar_https://www.schneier.com/blog/archives/2006/01/countering_trus.html
12:13:06floppydhskrylar_: ty
12:15:48*Snircle joined #nim
12:16:58skrylar_After dealing with IMEs, i have found the situation with fltk to be.. non-plussed.
12:18:01skrylar_Mostly in that the choies seem to be Qt (which is a lot of work, will break in 1-2 years when Qt6 happens), GTK (which will break again, same reason) or FLTK (which won't break, but then half the accessibility stuff doesn't work)
12:18:31skrylar_Still confused why GTK requires rewrites.
12:19:15skrylar_i mean a gui is fundamentally a canvas library with an event pipe
12:27:21*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:32:25skrylar_lib/nim/system.nim(199, 14) Error: internal error: rrGetSym: no reader found: +2 hmm...
12:40:33dom96Araq: The new `..` doesn't support (int, EnumValue.high), should this be supported?
12:40:59dom96it definitely works in 0.17.2
12:44:15flyxhmm. haven't seen alexday since he asked about NimYAML and I was afk :/. most of his questions were answerable
12:50:52dom96and I'm still getting an `type mismatch: got (uint32)` for the items iterator in my code
13:02:56*Snircle joined #nim
13:17:52FromGitter<andreaferretti> by the way, I still see some issues with generic concepts
13:18:26FromGitter<andreaferretti> mostly in my tests (https://github.com/unicredit/alea/blob/master/tests/test.nim) for alea
13:18:40FromGitter<andreaferretti> I had to comment out a few tests with current devel
13:19:18FromGitter<andreaferretti> are generic concepts considered mostly working now?
13:19:32*fraya quit (Quit: Leaving)
13:19:41FromGitter<andreaferretti> or are they still in course of being finished?
13:19:53*zippyy joined #nim
13:21:33*jjido joined #nim
13:22:29jjidoAraq shouldn't versioning work in the opposite direction.
13:23:50jjidoPackage Foo version 1.2.0.6, usable with codebase compiled with Foo 1.1 to 1.2.0.6
13:30:48FromGitter<andreaferretti> opened an issue https://github.com/nim-lang/Nim/issues/6842
13:40:35*zippyy quit (Ping timeout: 240 seconds)
14:03:12*MJCaley joined #nim
14:08:31*sakalli quit (Ping timeout: 248 seconds)
14:10:37skrylar_well thats neat
14:11:01skrylar_i just realized instead of doing a whole MxN table, can just use quickdraw's old region trick for table layouts
14:11:38skrylar_one of the things you can do in miglayout is say that ex. one item has some units of grid height, which requires storing collision data somewhere
14:18:41*floppydh quit (Quit: WeeChat 1.9.1)
14:18:57*floppydh joined #nim
14:23:43*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:25:38*zippyy joined #nim
14:30:01*zippyy quit (Ping timeout: 240 seconds)
14:41:27*arnetheduck joined #nim
14:46:23FromGitter<nitely> dom96: some dependency managers have a dependency resolution that will use the correct version for each package, even when pinned. See Cargo
14:47:02dom96nitely: so the pinning is ignored?
14:47:13FromGitter<nitely> it's not
14:47:36dom96then I'm not sure what you mean :)
14:47:43FromGitter<nitely> it has multiple versions of the same package, it even share the depencency if multiple packages depend on the same version
14:49:19FromGitter<nitely> I've not tried though, just read about it. No idea how they do it
14:49:50*floppydh quit (Quit: WeeChat 1.9.1)
14:50:03*floppydh joined #nim
14:51:55*MJCaley quit (Quit: MJCaley)
14:53:26FromGitter<nitely> npm and yarn do the same thing, they will just move the dependency to a sub-dir when there's a conflict. I guess that's easier in a dynamic language :P
14:57:45dom96I'm pretty sure Nimble does the same thing
14:57:54dom96s/does/supports/
14:58:07dom96It doesn't need to move any directories around, just needs to specify the path to the right dep
14:58:20FromGitter<nitely> it does? then what's the issue with pinning?
14:58:26dom96but you can have multiple versions of the same package installed in ~/.nimble/pkgs/
14:58:36dom96The issue is that it's not implemented at all :)
14:58:41FromGitter<nitely> ahahah
15:01:09FromGitter<nitely> well then, using `==` would be better than `> ... & < ...`, except for the nim-lang dependency, right?
15:02:06skrylar_i thought Araq had put stemmers in the stdlib or something, but if i search for 'nim porter stemmer' there's just one nimble package :b
15:02:41dom96nitely: the problem with using `==` is you'll end up with another package that uses `==` for a different version of the same package
15:02:46dom96and then you'll have a problem
15:02:56dom96I'm curious how this is solved in Cargo
15:06:43FromGitter<nitely> wait, so "you can have multiple versions of the same package installed in ~/.nimble/pkgs/" but you'll have a problem when using `==`? How so?
15:08:35dom96Okay, so imagine that package Jester depends on http == 1.0.1 and package FooBar depends on http == 1.0.2, you want to depend on Jester and FooBar in your package
15:08:52dom96Which means that your package would need to be built with http 1.0.1 and 1.0.2, which is impossible
15:09:27dom96if Jester and FooBar depend on http >= 1.0.1 & < 1.2 then there is no problem
15:09:43dom96we just build with the most recent http package that fits the range
15:10:12jjido"impossible"
15:11:42dom96(impossible in Nim :))
15:16:03FromGitter<tim-st> hi, just a short question: what is the expected output of "ä".runeAt(0).char() ?
15:17:16FromGitter<nitely> dom96: mmh, so you can *not* have multiple version of the same package installed
15:17:56dom96You can.
15:19:28FromGitter<nitely> goodamit :) we have enter an infinite loop
15:20:11FromGitter<mratsim> @dom96 that's been "solved" for years in distro package manager like pacman: "Incompatible dependencies".--> Done.
15:20:35dom96nitely: there is a difference between installation and compilation
15:21:04dom96mratsim: that's how Nimble has been solving it since its inception
15:21:26dom96but there must be more to it when lock files come into play
15:21:35*gokr quit (Ping timeout: 248 seconds)
15:22:46FromGitter<mratsim> I'm using the HoldPkg and IgnorePkg conf a lot for the nvidia-drivers/xorg on Archlinux
15:23:20FromGitter<mratsim> Dunno if it can help to design the pinning feature.
15:29:14*zippyy joined #nim
15:32:59skrylar_apt has a more in-depth pinning system
15:33:27skrylar_'holds' block all updates against held packages (i think it technically counts as a 'pin' with some ridiculously high weight)
15:33:56skrylar_then 'pins' let you set policies for packages like which repo they are actually taken from
15:34:26skrylar_so its possible to do things like have debian/stretch be the "default" and then explicit packages are taken from testing/sid
15:38:47FromGitter<andreaferretti> @dom96 I think that what @nitely means is actually using both versions at the same time
15:38:53FromGitter<nitely> @tim-st `char` is suppose to be a `uint8`, that Rune (228) is within range. `int(char.high) == 255` however, `char(256)` somehow works...
15:38:58FromGitter<andreaferretti> you can do this for sure in NPM
15:39:12FromGitter<andreaferretti> I don't know abot cargo, I guess that with compiled languages is trickier
15:39:27dom96andreaferretti: yeah, I understand.
15:39:50dom96Are you sure you can do it for NPM?
15:39:57FromGitter<andreaferretti> sure
15:40:00FromGitter<nitely> you can now
15:40:05dom96how does that work?
15:40:08FromGitter<andreaferretti> you always could
15:40:10FromGitter<andreaferretti> simple
15:40:30FromGitter<andreaferretti> each dependency has a subfolder with all its dependencies, recursively
15:40:38FromGitter<andreaferretti> hence dependencies form a tree
15:41:05dom96interesting
15:41:15FromGitter<andreaferretti> nowadays there is some form of linearization
15:41:19FromGitter<andreaferretti> of this tree
15:41:26FromGitter<andreaferretti> to avoid redundancy
15:41:28FromGitter<tim-st> @nitely Thanks for your answer. I tried to work between Rune and char and the yielded ord-value in nimlang is 228 and in Python2 it its 132. Currently trying to find out why they are different.
15:41:53FromGitter<andreaferretti> but version 1 was just like that - every package recursively includes all the deps on the filesystem
15:42:13dom96That would work for Nim if it wasn't for how it determines .c output file names.
15:42:14FromGitter<andreaferretti> notice that this creates a possible problem
15:42:25dom96although I'm sure that's not the only problem Nim would face
15:42:45FromGitter<andreaferretti> if you have two different versions of the same dependency which declare incompatible types
15:42:52FromGitter<andreaferretti> and the two must interoperate
15:42:55FromGitter<nitely> @tim-st Python3 returns 228 for `ord("ä")`
15:42:58*endragor quit (Remote host closed the connection)
15:44:09FromGitter<nitely> @tim-st mmh, Python2 as well
15:44:23cremFor different reasons.
15:44:24FromGitter<nitely> *as well/too
15:44:46crempython2 returns that only if your locale codepage is cp1252 (latin-1)
15:45:09*endragor joined #nim
15:45:16cremBecause unicode range of 128..255 largely happen to match latin-1
15:45:25FromGitter<tim-st> Alright, thanks for your answers. Than it was my mistake!
15:48:04*skrylar_ quit (Quit: Leaving)
15:49:03FromGitter<nitely> crem: that should not matter if you decode the input properly...
15:49:12*endragor quit (Ping timeout: 240 seconds)
15:49:39FromGitter<nitely> or you have an utf-8 file and do `ord(u"ä")`
15:51:00FromGitter<nitely> it should always return the right code point (for every unicode character). That's my understanding
15:51:03*PMunch quit (Quit: Leaving)
15:51:08cremFor unicode, yes.
15:51:46cremI told that if you just do ord("ä") in python2 and got a number, that's not unicode codepoint number.
15:51:53FromGitter<tim-st> I did input the code on the console and the resulting value was the ascii value 132
15:52:10FromGitter<tim-st> http://www.theasciicode.com.ar/extended-ascii-code/letter-a-umlaut-diaeresis-a-umlaut-lowercase-ascii-code-132.html
15:52:46FromGitter<nitely> ah, then you had the issue described by crem. You should decode that or use the u"" syntax
15:53:19FromGitter<tim-st> Thanks, is there any list for the values I actually need to know, like 228 for ä ?
15:53:24FromGitter<nitely> there are other ways but I think we can only talk about nim here :P
15:53:35crembtw, there is inaccuracy in dom96's book. It's written that nim's char "cannot store UTF-8 characters and can only store ASCII". :)
15:53:59dom96that's not inaccurate
15:54:12FromGitter<nitely> @tim-st There is the unicode database.
15:54:25FromGitter<tim-st> ok^^
15:55:14cremdom96: It is, as far as I understand char. There is no such thing as "utf-8 character", only codepoints and codeunits (and last ones it can store). And also it can store complete non-ASCII characters in single-byte encodings.
15:55:36FromGitter<nitely> @tim-st http://www.unicode.org/ucd/
15:56:19dom96Isn't å a UTF-8 character?
15:56:20*endragor joined #nim
15:56:25dom96You cannot represent that with a 'char'
15:56:35cremIt's Unicode character.
15:56:42FromGitter<tim-st> But the manual says: "A character is not an Unicode character but a single byte"
15:56:49cremUTF-8 is one of the ways to encode Unicode.
15:58:07dom96okay, maybe I should have written "Unicode"
15:58:57FromGitter<nitely> if char is uint8 and å is 228 then you can use char...
15:59:32FromGitter<nitely> but this `char(256)` works, not sure why it does...
15:59:44cremYes! And also that "it can only store ASCII characters" is not true, although I remember that it could be interpreted in the text the way it's not exclusive.
16:02:17FromGitter<nitely> `int(char.high) == 255`:\
16:02:48FromGitter<tim-st> Thanks for your answers! I have one question left: Is there a performance difference (runtime, memory) when I access a const set defined in the beginning of the file from a proc instead of defining the same set inside the proc again and accessing it from there?
16:03:58FromGitter<mratsim> Const are replaced by their actual value by the compiler iirc.
16:05:12FromGitter<mratsim> i.e. f you declare const one = 1 at the beginning of the file or in the proc, you will get the same C code (no const at all and the value inlined where const was used).
16:07:04*couven92 quit (Quit: Client disconnecting)
16:07:05*miran_ joined #nim
16:07:22FromGitter<tim-st> Ok, but e.g. in strutils often {'a'..'z'} is manually written instead of defined it once and referring to the global const value. Why is this if there is no performance difference?
16:10:23*MJCaley joined #nim
16:12:50*endragor quit (Remote host closed the connection)
16:13:56*gokr joined #nim
16:19:31dom96there is no const for this because it's easy to write
16:21:26FromGitter<alehander42> hm, I didn't suspect how differently enum sets are implemented compared to int sets
16:21:42FromGitter<alehander42> one thing I wonder is, why are they not "packed"
16:21:47*Trustable joined #nim
16:21:50FromGitter<tim-st> @dom96 OK thanks, that's all I wanted to know, because I moved from Python and wasn't sure about some things regarding performance.
16:22:29FromGitter<alehander42> actually nv,
16:22:33FromGitter<alehander42> nvm it makes sense
16:25:34*gokr quit (Ping timeout: 264 seconds)
16:59:12*miran_ quit (Quit: Konversation terminated!)
16:59:24*sendell quit (Remote host closed the connection)
17:01:43*nsf quit (Quit: WeeChat 1.9.1)
17:02:05*JappleAck quit (Ping timeout: 240 seconds)
17:08:32FromGitter<alehander42> Araq: is there a standard way to somehow mark a function with some flag which is propagadated until codegen ?
17:10:53*MJCaley quit (Quit: MJCaley)
17:12:44*jjido quit (Ping timeout: 276 seconds)
17:13:26Araqalehander42: .magic or .compilerproc depending on your needs
17:14:08*miran_ joined #nim
17:14:52*arecaceae quit (Remote host closed the connection)
17:15:11*arecaceae joined #nim
17:15:36FromGitter<alehander42> well I need it for the jsgen of async functions, so I am not sure if those are a good fit
17:17:38FromGitter<mratsim> @alehander42 I’m pretty sure I’ve seen a packed enum somewhere, I don’t remember where though
17:19:46*JappleAck joined #nim
17:19:54*couven92 joined #nim
17:20:07FromGitter<alehander42> no, I was confused about the packed enum thing
17:20:57FromGitter<alehander42> I was wrong* , it was something about sets of enums, but their impl is actually "packed" maximally
17:22:29*JappleAck quit (Client Quit)
17:25:05*PMunch joined #nim
17:25:16enthus1astguys, im trying to load a shared objekt, inside the shared obj i have an async function, my loader periodocally calls an "poll" function which in turn calls async poll. Can this work?
17:28:16*Jesin joined #nim
17:28:29*d10n-work joined #nim
17:28:37*zippyy quit (Ping timeout: 258 seconds)
17:28:46dom96enthus1ast: I guess so
17:28:51dom96Hard to say without more details
17:29:40*JappleAck joined #nim
17:29:43enthus1astlet me create a gist
17:30:34*Jesin quit (Remote host closed the connection)
17:32:50*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:33:03couven92@tim-st, I have had the pleasure of playing a lot with the unicode module lately :) (I have an ongoing PR there). `char` is uint8, meaning it can take values from 0 to 255. However, ASCI is 7-bit, so only up to 127. So if you have the right codepage printing a char with values between 128 and 255 will work nicely. Now `Rune` is actually a 32-bit integer storing the codepoint value **which is different to the UTF-8 bytes**! Converting a Rune to
17:33:03couven92a char will truncate the value to 8-bits. Converting a char value to a Rune will zero extend 8-bit to 32-bit (and for latin codepages this will work). However, `"ä"` is actually rewritten by Nim to a byte string with **two** bytes, that represent the UTF-8 pattern for the `"ä"` rune. The first byte will be in the range 128-255 (i.e. outside ASCII) to signal one UTF-8 continuation byte. The second byte will probably be a fairly small number.
17:36:17couven92also note that conversions from Runes to char (and especially from char to Rune) might be subject to signed/unsiged issues, as Rune is signed, whereas char is unsigned
17:37:56couven92basically, use char only for ASCII, use byte for 8-bit integers, use string for byte sequences, and use `$` to stringify a Rune into one or more (max 4) bytes
17:38:16*zippyy joined #nim
17:41:58*floppydh quit (Quit: WeeChat 1.9.1)
17:49:40FromGitter<nitely> couven92: ah, it truncates. That's why `char(256)` works
17:50:43FromGitter<nitely> and by "works" I mean it does not throw an error.
17:51:19couven92yeah, pretty much :)
17:57:22*zippyy quit (Ping timeout: 260 seconds)
18:02:54*jjido joined #nim
18:03:33enthus1astdom96: https://gist.github.com/enthus1ast/662a753b0d7bcc8a929d77ea36dd250f
18:03:57enthus1astthis is an runnable example
18:06:22*xet7 quit (Quit: Leaving)
18:07:08*zippyy joined #nim
18:07:46*couven92 quit (Read error: Connection reset by peer)
18:10:23*sakalli joined #nim
18:11:31*claudiuinberlin joined #nim
18:13:42*Sentreen quit (Ping timeout: 260 seconds)
18:18:22*jjido quit (Ping timeout: 260 seconds)
18:19:12*Trustable quit (Remote host closed the connection)
18:21:37*fraya joined #nim
18:26:05*Sentreen joined #nim
18:30:42dom96enthus1ast: does it work if you use module.nim as an ordinary nim import?
18:31:05*ketralnis quit (Quit: Coyote finally caught me)
18:31:23*zippyy quit (Ping timeout: 276 seconds)
18:33:03*BitPuffin|osx quit (Ping timeout: 248 seconds)
18:34:05*Ven`` joined #nim
18:34:10enthus1astdom96: yes work
18:35:40dom96Then I don't know. I'm guessing there is some extra initialisation you need to do with the DLL
18:37:31enthus1asti'm also a little unshure how it lays out in memory. Does the so have its own gb?
18:37:52FromGitter<tim-st> @couven92 Thanks for the detailled answer, appreciate it!
18:40:26*ipjk joined #nim
18:46:56*fraya quit (Quit: Leaving)
19:02:39*rbrt joined #nim
19:09:42*nsf joined #nim
19:19:56*MJCaley joined #nim
19:25:33*JappleAck quit (Quit: Leaving)
19:43:21*vlad1777d joined #nim
19:45:50*Snircle joined #nim
20:19:21*MJCaley quit (Quit: MJCaley)
20:22:38*MJCaley joined #nim
20:23:12*sz0 joined #nim
20:38:29*Vladar quit (Quit: Leaving)
20:56:04*jjido joined #nim
21:15:29*miran_ quit (Quit: Konversation terminated!)
21:28:30*Ven joined #nim
21:28:55*Ven is now known as Guest67933
21:29:39*astronavt joined #nim
21:42:24*PMunch quit (Quit: leaving)
21:45:28*jjido quit (Read error: No route to host)
21:50:35*astronavt quit (Remote host closed the connection)
21:50:55*astronavt joined #nim
21:51:17*astronavt quit (Remote host closed the connection)
21:55:29*klaver010110 joined #nim
21:59:28*klaver010110 quit ()
22:03:20*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:08:10rbrtis there a good example of going between a nim type and a python object using python ctypes or cffi?
22:08:42rbrtlooks like im running all over memory
22:09:17rbrt(getting values like 4.9*10^-324 lol)
22:10:02rbrttrying to do something like this example from ruby http://www.bootstrap.me.uk/bootstrapped-blog/nim-for-the-discerning-rubyist
22:10:07rbrtbut in python
22:15:56*Ven joined #nim
22:16:20*Ven is now known as Guest70676
22:16:23*Guest67933 quit (Read error: Connection reset by peer)
22:16:55Araqdom96, (int, EnumValue.high) should never have worked
22:17:12dom96why?
22:17:22Araqbecause type safety.
22:18:03dom96ok, what about `0 .. cuint:` ?
22:18:52Araqthat works.
22:19:35dom96here is the error I'm getting: https://gist.github.com/dom96/c545402dcc85d916984155f0a49fa889
22:20:10Araqwhat's the code?
22:21:16dom96for i in 0..<unit.getNumDiagnostics():
22:21:22dom96getNumDiagnostics returns cuint
22:21:58dom96as far as the (int, EnumValue.high), can I add support for it via lenientops?
22:23:21Araqno, fix your code
22:23:47Araq..< never supported multiple Ts
22:23:56Araq.. < did but that was just bad luck
22:24:31Araqfix your code but I just got an idea...
22:26:02*sakalli quit (Ping timeout: 276 seconds)
22:26:04dom96This isn't my code :)
22:28:04Araqok my idea works but ugh, it's such a hack...
22:28:39Araqtemplate `..<`*(a, b): untyped =
22:28:40Araq # reverse type inference rules: First look at the ``b`` expression:
22:28:40Araq b >.. a
22:29:42AraqI'll fix that damn type inference instead but it could take a while and who knows what it will break
22:30:35FromGitter<mratsim> @rbrt try looking into nim-pymod, and also the video of subsetpark for PyGotham 2017 about optimizing Python For loops using Nim. The link is on Nim Reddit
22:31:46dom96Araq: So it's just to do with the order of the arguments?
22:31:58Araqyes
22:32:36subsetparkmratsim rbrt also available for questions here - might also be useful to look at https://pypi.python.org/pypi/nim-types which does a tiny bit of the heavy lifting for you
22:36:03*skrylar joined #nim
22:47:19*gokr joined #nim
22:55:02*nsf quit (Quit: WeeChat 1.9.1)
22:55:34*MJCaley quit (Quit: MJCaley)
23:03:23rbrtmratsim, thanks for the refs
23:04:18rbrtsubsetpark, talk was fantastic, your use case is extremely similar to mine. im gonna dig a bit more into nim-pymod and your nim-types but ill let you know if i have any questions. thanks!
23:07:35subsetparkawesome! feel free to msg me
23:07:43subsetparkI'm on EST
23:10:51subsetparkOr actually - dom96 would say you should keep questions in channel so all can learn :)
23:13:07dom96True that :)
23:15:55*Guest70676 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:34:35*skrylar quit (Ping timeout: 240 seconds)
23:48:22*xet7 joined #nim