<< 10-08-2018 >>

00:00:35*Xoc17 joined #nim
00:00:38*Xoc17 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
00:15:06*nlsun joined #nim
00:15:18*nlsun is now known as Guest15279
00:15:45*Guest15279 quit (Killed (Sigyn (Spam is off topic on freenode.)))
00:24:04*ddstreet14 joined #nim
00:24:50*ddstreet14 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
00:34:10*wildlander quit (Quit: Konversation terminated!)
00:40:26FromGitter<arnetheduck> @data-man on #8185, in early versions of the patch, one would check for errors using -1, and later in your patch, it's... implementation-defined?
00:41:24FromGitter<data-man> @arnetheduck Yes. -1 was bad.
00:42:14FromGitter<arnetheduck> so what should the calling code do? compare with different values depending on what kind of stream it is?
00:42:30*pendo324 joined #nim
00:43:30FromGitter<data-man> Yes. E.g., I implemented the size for all stdlib's streams.
00:43:31*pendo324 quit (Killed (Sigyn (Spam is off topic on freenode.)))
00:43:52*arooni1 joined #nim
00:44:11FromGitter<arnetheduck> yeah. but imagine I'm using the interface.. isn't the idea for an interface of this kind that it behaves the same for all kinds of streams?
00:44:13FromGitter<data-man> Inspired by Delphi & FreePascal streams. :)
00:44:21*arooni1 quit (Killed (Sigyn (Spam is off topic on freenode.)))
00:44:30*PrimHelios joined #nim
00:45:45FromGitter<data-man> E.g. https://github.com/nim-lang/Nim/pull/8326
00:46:43FromGitter<data-man> @arnetheduck If you has your own stream, you should implement the size for this stream.
00:48:19FromGitter<arnetheduck> I understand that whoever makes a stream must implement size. what I don't understand is what they're supposed to return in case of error.. since it's not -1, what should it be? conversely, if I'm calling size, how do I know what size will return, if it's an error?
00:50:47FromGitter<data-man> Why is there no such question to the result of getPosition?
00:51:23FromGitter<arnetheduck> maybe there should be?
00:52:03FromGitter<data-man> I don't know :)
00:54:58FromGitter<arnetheduck> well, that's the thing with standard libraries - they age badly, and you're left with poor choices - keep shitty code, break user code or make up new names with numbers in them.. if someone didn't think clearly when writing getPosition, that becomes and argument for doing the same when writing the next function as well (I'm guessing getPosition exists already before your patch :))
00:55:20*dddddd quit (Remote host closed the connection)
00:59:57*arecaceae quit (Remote host closed the connection)
01:00:12FromGitter<data-man> I like the idea about splitting streams to readers and writers (as in Go, Rust or Zig).
01:00:16*arecaceae joined #nim
01:01:52*drazan joined #nim
01:02:12FromGitter<arnetheduck> I like the idea of streams being in a library so they can be iterated upon, without breaking user code that depends on a particular version of them ;) though if you break into r&w, you get another chance at designing a coherent API
01:08:52*stefanos82 joined #nim
01:10:36FromGitter<data-man> When system.nim will be splitted, readers and writers can be in the std.io. ;)
01:15:05*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:15:43*Jesin joined #nim
01:18:05*a__b__m quit (Ping timeout: 240 seconds)
01:36:54FromGitter<arnetheduck> a *nimble* library, outside of the main nim distro
01:38:27FromGitter<arnetheduck> speaking of the std library, what's the difference between `core`, `pure`, and `std` and `packages`?
01:45:01FromGitter<data-man> IMHO, packages and core should be removed, std is new and has big potential. :)
01:45:12FromGitter<xDotDash> pure is for things written 100% in nim I believe
01:45:44FromGitter<data-man> Everything in the lib written in Nim :-D
01:46:56FromGitter<data-man> Except several *.h, sorry.
01:47:51*mwbrown quit (Ping timeout: 268 seconds)
01:51:13*mwbrown joined #nim
01:51:19FromGitter<arnetheduck> `pure` depends on `c` and `posix` libraries at least, so the definition would be "mostly nim except when not".. impure depends on non-nim stuff for sure though - I guess the difference lies in how exotic the dependency is :)
01:53:05PrimHeliosperhaps pure is only dependent on C and posix, while impure is any external C lib?
01:53:57PrimHeliosis dependent upon any external lib*
01:54:57FromGitter<data-man> Is libc the external lib? :)
01:55:27*mwbrown quit (Ping timeout: 240 seconds)
01:57:00*red-00120 joined #nim
02:00:14PrimHeliosdoes libc count as an external lib? like 90% of C code depends on it in some way
02:02:35*red-00120 quit (Ping timeout: 240 seconds)
02:04:37FromGitter<data-man> And remove dependency from libc is the biggest task.
02:08:03*developers joined #nim
02:12:51*developers quit (Ping timeout: 240 seconds)
02:16:04FromDiscord_<emekoi> do converter type classes work yet?
02:19:37FromGitter<kayabaNerve> Converters work
02:20:10*gildarts_ joined #nim
02:20:20*gildarts_ is now known as Guest62181
02:26:13*Guest62181 quit (Ping timeout: 244 seconds)
02:26:49*vosper joined #nim
02:38:44*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:41:31*rayman240 joined #nim
02:43:45*rayman22201 quit (Ping timeout: 248 seconds)
02:44:57FromDiscord_<emekoi> sorry i meant converter concepts (concepts with a return in them)
02:53:35*chamar quit (Read error: Connection reset by peer)
02:58:32*Stummi26 joined #nim
02:58:43*Stummi26 quit (Remote host closed the connection)
03:13:01*endragor joined #nim
03:18:19*BitPuffin quit (Remote host closed the connection)
03:30:50*Cthalupa quit (Ping timeout: 268 seconds)
03:33:25*ipv629 joined #nim
03:35:08*ipv629 quit (Remote host closed the connection)
03:37:29*govg joined #nim
03:38:13*govg quit (Killed (Sigyn (Spam is off topic on freenode.)))
03:39:31*vosper joined #nim
03:59:58FromGitter<Quelklef> Any convention for naming helper functions?
04:05:30*atk21 joined #nim
04:05:43*atk21 quit (Killed (Sigyn (Spam is off topic on freenode.)))
04:27:24FromGitter<timotheecour> `FooImpl` => lots of such names in stdlib
04:27:44FromGitter<Quelklef> P sure that's for macros
04:35:45*stefanos82 quit (Quit: Quitting for now...)
04:43:52*leorize quit (Ping timeout: 256 seconds)
04:47:41*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:07:03*vosper joined #nim
05:19:04*nsf joined #nim
05:19:48*miran joined #nim
05:42:49*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:44:41*vosper joined #nim
05:51:45Araqthe "Pure" vs "not pure" distinction is about DLLs (shared objects)
05:52:26AraqDLLs not part of the OS that you would need to ship with your binary
05:53:10Araqlibc is usually kinda there and is considered part of the OS
05:54:03AraqI don't understand why 'getPosition' is bad today, essentially all IO/Stream procs can throw an exception on error
05:55:21*leorize joined #nim
05:57:33Araq'getPosition' doesn't return a hint of a position, 'size' returns a size *hint* as maybe the stream has no way of telling its size, it's a stream after all. apples and oranges.
05:59:14FromGitter<data-man> @Araq Any example for stream without a size?
06:00:09Araqa socket?
06:01:32Araqany protocol that uses a sentinel can't tell the message's size before having read the sentinel
06:02:27*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:02:39FromGitter<data-man> Socket has current size of recieved data
06:02:57FromGitter<data-man> (Or can be added)
06:03:49Araqiirc the OS's socket APIs don't offer that feature
06:04:49AraqgetPosition # number of bytes we have "consumed" in some sense.
06:05:00Araqsize # number of bytes still to consume.
06:05:05*miran quit (Ping timeout: 240 seconds)
06:05:23Araqspot the difference? you might not know 'size', you can always know 'getPosition'
06:05:38Araqone refers to the past, the other to the future.
06:07:07FromGitter<data-man> Anyway we haven't SocketStream as the Stream successor
06:07:36*BurningPrincess3 joined #nim
06:09:09*BurningPrincess3 quit (Remote host closed the connection)
06:12:45Araqwell Stream is an interface
06:13:08Araqand it should allow a SocketStream implementation
06:15:05FromGitter<data-man> Sure, and this implementation can returns all what you want.
06:21:20*vosper joined #nim
06:32:01*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:33:04Araqand what can it return for "I don't know"
06:33:22Araq?
06:34:41FromGitter<data-man> It's impossible, you know everything! :)
06:37:50*casdr23 joined #nim
06:38:51*cspar joined #nim
06:38:59*casdr23 quit (Killed (Sigyn (Spam is off topic on freenode.)))
06:48:35FromGitter<data-man> PicoC also migrated to gitlab: https://gitlab.com/zsaleeba/picoc
06:49:23*Our joined #nim
06:49:35*Our quit (Killed (Sigyn (Spam is off topic on freenode.)))
06:50:16leorizeI really don't understand this entire migration trend
06:50:19*dgwana joined #nim
06:50:27leorizeif you're afraid that github may kill off the repo
06:50:42leorizethe better way is to have muliple copies everywhere
06:51:48FromGitter<data-man> I tried gitlab and I like it more than github. :)
06:52:16FromGitter<gogolxdong> how to format nim code after pasting?
06:52:26FromGitter<gogolxdong> in vim.
06:53:49FromGitter<gogolxdong> or how to paste nim code from windows vscode to vim?
06:54:27leorizeif you have a good vim plugin
06:54:28leorizeselect the block
06:54:34leorizepress =
06:54:54leorizeif not, Ctrl+V
06:54:59FromGitter<gogolxdong> which nim plugin , using https://github.com/zah/nim.vim
06:55:41leorizeI don't know, I made my own :P Try if it's work
06:57:50FromGitter<gogolxdong> right click is the default paste key in xshell, but it produces incremental indentations for each line.
06:57:52FromGitter<mpcjanssen> or if it's formatted in the source do :set paste before pasting
06:59:56FromGitter<gogolxdong> sorry,middle click , and @mpcjanssen works.
07:00:09FromGitter<gogolxdong> thanks.
07:10:14*Vladar joined #nim
07:10:14*leorize quit (Read error: Connection reset by peer)
07:10:50*dgwana quit (Quit: Leaving)
07:14:05*ng0 joined #nim
07:15:35*leorize joined #nim
07:28:34*darkmagic joined #nim
07:28:41*darkmagic quit (Killed (Sigyn (Spam is off topic on freenode.)))
07:34:53*Cthalupa joined #nim
07:40:31*miran joined #nim
07:44:02*PMunch joined #nim
07:48:45norok2does nim have a sort of "killer app"?
07:49:16*vosper joined #nim
07:49:33*rayman22201 joined #nim
07:50:35ldleworknorok2: macros
07:50:41leorizenorok2: like an app that kill processes?
07:50:55ldleworkleorize: hehe
07:51:01norok2:'D
07:51:25norok2an application where it really shines
07:51:41norok2like I don't know, rust has firefox
07:52:01leorizenimbus :P
07:53:01AraqReel Valley was written in Nim
07:53:29*rayman240 quit (Ping timeout: 260 seconds)
07:53:34FromGitter<gogolxdong> what's the equivalent of ioctl in winlean.nim?
07:54:54leorizedoes windows even have ioctl?
07:54:59norok2@Araq you mean this: https://www.facebook.com/reelvalley/
07:56:02AraqWindows tends to have more specialized APIs than just "ioctl"
07:56:57Araqnorok2: yes
07:57:40FromGitter<gogolxdong> yes, it takes more effort to program on windows, which beyond my scope.
07:58:22norok2was it done with the JS back-end?
07:58:26FromGitter<gogolxdong> need a windows expert.
07:58:40leorizegogolxdong: or use msys2 :P
07:59:33FromGitter<gogolxdong> what is that?
07:59:37leorizenorok2: yes
07:59:47leorizegogolxdong: a better cygwin
08:00:18FromGitter<gogolxdong> I have mingw ,does it help?
08:00:29Araqnorok2: it uses emscripten and the JS backend, I think in the end emscripten had better performance, but it worked with both
08:01:30*leorize quit (Read error: Connection reset by peer)
08:03:09*gmpreussner_ quit (Quit: kthxbye)
08:04:00*gmpreussner joined #nim
08:07:15FromGitter<gogolxdong> I'm in msys2, can I write linux or posix code to compile windows executable?
08:10:21*rubdos24 joined #nim
08:10:21*rubdos24 quit (K-Lined)
08:12:45FromGitter<timotheecour> @araq for https://github.com/nim-lang/Nim/pull/8555 (doAssert, assert now print full path), which aspects don’t you like ?
08:13:42Araqthe FAKEFILE idea, the fact that it requires yet another rarely used public system.nim symbol
08:14:18FromGitter<timotheecour> `lineInfoToString` or `assertFailMsg` ?
08:14:31Araqall of it
08:14:52Araqthe compiler should use absolute paths and testament should strip them away
08:15:05FromGitter<timotheecour> `lineInfoToString ` is not rarely used ; it’s also used in macros. it avoids duplicating code to print (file, line,col) so it’s all in 1 place.
08:16:06FromGitter<timotheecour> this matters because (in subsequent PR) i want to enable user to customize it (eg for ppl using sublimetext, file:line:col is much better) ; so it’s best if it’s refactored in as few places instead of having code duplication
08:17:50FromGitter<timotheecour> what’s bad about FAKEFILE idea? i think it’s cleanest way to handle this: it avoids hacks I’ve seen which have to be updated when test changes (because they hardcode line numbers etc) or that’d need to be updated, say, if test file moves.
08:19:45*rayman22201 quit (Ping timeout: 248 seconds)
08:21:38Araqit's yet another subtle thing, "Why does my doAssert() suddenly produce FAKEFILE? It breaks my tests"
08:22:50FromGitter<timotheecour> well i can improve the name FAKEFILE to something w a very clear name; in any case it’s trivial to search and UNIQUE so anyone can find where it came from
08:23:45Araqevery step is reasonably simple and has clear benefits. and in the end you get another unittest.nim
08:24:44Araqor a system.nim file with over 4000 lines, not counting its includes
08:25:48*leorize joined #nim
08:26:58FromGitter<timotheecour> others have complained about `assert/doAssert` not giving enough context on failure; improving this makes sense IMO
08:27:38*abm joined #nim
08:29:42*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:29:55*heinrich5991 quit (Ping timeout: 268 seconds)
08:30:10*Guest94149 joined #nim
08:32:17FromGitter<timotheecour> > or a system.nim file with over 4000 lines, not counting its includes ⏎ ⏎ that’s a consequence of lack of mutial imports within a project ; that limitation may (hopefully) disappear, in which case we’ll just have 1 definition for assert+friends etc.
08:32:43*heinrich5991 joined #nim
08:33:24Araqno, it's not a consequence of a lack of mutual dependencies
08:33:44Araqit's a consequence of "I like to use this without having to write an 'import' "
08:34:30AraqC++ did that better, assert is in its header file that you need to #include
08:35:35*Guest94149 quit (Ping timeout: 240 seconds)
08:37:30FromGitter<timotheecour> I dont’ follow: system.nim does call assert in a number of places, how would that even work without mutual imports and with an assert defined outside of system.nim ?
08:41:10Araqsystem.nim doesn't call assert much
08:41:20Araqit uses sysAssert and gcAssert
08:44:05FromGitter<timotheecour> and assert.. cf items, mitems etc. and the fact we have several of these variants (assert, sysAssert), is another symptom of that.
08:44:38Araqit's not.
08:44:52Araq-d:useSysAssert is different from --assertions:on
08:47:55*sins- joined #nim
08:48:47*sins- quit (Killed (Unit193 (Spam is not permitted on freenode.)))
08:49:47Araqand different subsystem using different switches is a good practice IME. in a sense we need to make custom asserts easier to write, not assert easier to use
08:50:18Araq(but we can do both, of course)
08:50:21*rayman22201 joined #nim
08:50:30FromGitter<timotheecour> Ok for sysAssert. but general idea is: it’s easier to implement functions when we already have access to other functions to implement them. right now the workaround is to use a lot of magic procs to bootstrap system.nim, but with mutual imports a lot of these would not be necessary and could be in modules
08:53:51AraqI know of few magics that could be implemented without magics.
08:54:53FromGitter<timotheecour> they could but if system.nim needs them, then the only way out of this conundrum is mutual imports.
08:56:10FromGitter<timotheecour> having stuff like seq[T], etc in normal nim files would be a big improvement. Happy to help on mutual import support implementation if/when you’re convinced this can be beneficial
08:57:19FromGitter<timotheecour> (basically i’d rather spend time implementing than coming up with argumentation in favor)
08:59:41Araqwell you can follow my araq-devel branch on the new seqs and what it takes to make them library based
09:01:02Araqcyclic deps are the least of my worries
09:04:57*leorize quit (Ping timeout: 240 seconds)
09:10:41FromGitter<timotheecour> lack of cyclic deps is actually made worse by fact we dont have easy way to do cross-file fwd declarations (as done in C, C++) ; it results in link errors unless user is careful to avoid these. This could be an intermediate solution : supporting cross-module fwd decls (and avoiding link errors when compiler knows where these symbols are defined)
09:12:17AraqI don't get linker errors in Nim, I don't know what you're talking about
09:17:03miran`nre` is faster than `re`? (i'm only splitting strings based on some regex pattern)
09:17:32Araqusually it's slower
09:20:34*TheLemonMan joined #nim
09:23:37Araqbut again
09:23:56Araqthe compiler should use absolute paths and testament should strip them away. Simplest solution that can work.
09:25:40TheLemonManAraq, given a symbol `x` of type `var T` what type should `T(x)` evaluate to? `var T` or just `T` ?
09:28:00Araq`T`
09:28:52Araqyour FAKEFILE doesn't mean "I don't know the filename" it's a distinction between relative and absolute paths afaict
09:29:41*October joined #nim
09:31:33FromGitter<timotheecour> FAKEFILE avoids all the extra complications in having to parse testament output for patterns that look like filenames, and replace them with their base names ; definitely more complex than my trivial FAKEFILE idea
09:33:16Araqthat's testament's job though. it already parses the compiler's/program's output.
09:34:05Araqand nimsuggest's tester has the same problem too. nimsuggest must return absolute paths for stupid editors but for testing absolute files suck
09:34:42*October quit (Ping timeout: 256 seconds)
09:34:47Araqpush the complexity to where it belongs.
09:35:04FromGitter<timotheecour> Eg:
09:36:01FromGitter<timotheecour> (/Users/timothee/git_clone/nim/Nim/tests/ambsym/tambsym3.nim)
09:37:42FromGitter<timotheecour> it’s a form of mocking, which is commonly usd in testing frameworks. Nothing new in my proposal
09:41:49Araqdon't mock me.
09:43:43FromGitter<Bennyelg> Hey, I want to create something like the familliar javascript method ⏎ someList T .forEach(e => echo(e))
09:43:57FromGitter<Bennyelg> I am struggling :| anyone can advice ?
09:44:06miran`mapIt`?
09:44:26FromGitter<Bennyelg> No, I dont want to use those implementation I want to learn by creating one myself
09:45:02miransee how `mapIt` is implemented and base your own on that?
09:50:48FromGitter<Bennyelg> deduplicate not working for custom types? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6d5ff82a8e6c6083a3e34c]
09:51:24FromGitter<timotheecour> @araq in a similar vein, we run tests with hints off instead of trying to parse the output with hints and filter them out. That would be foolish, just as it’s pointless for testament to parse which part of output corresponds to file name and clean these up
09:52:35Araqyou just proposed we parse gcc's/clang's error messages and map them to our own
09:53:07Araqand yet testament should parse the compiler's output? even though it already does that and it's in fact a big part of its job?
09:53:16Araq*should not
09:53:21*Taylor_ joined #nim
09:53:35FromGitter<GULPF> @Bennyelg for ref types you need to define `==` yourself, otherwise they will use referential equality
09:53:49FromGitter<Bennyelg> Oh, now it's all clear
09:54:01FromGitter<Bennyelg> fantastish ;]
09:54:37FromGitter<timotheecour> you mean https://github.com/nim-lang/Nim/issues/8602 ? that’s just because there’s no simpler solution in that case (i can close that issue , not a big annoyance)
09:55:01*clyybber joined #nim
09:55:21*PrimHelios quit (Ping timeout: 240 seconds)
09:56:31Araqand testing absolute filenames is valuable anyway, Nim swallows the leading '/' sometimes and that could have been detected by the tests too
09:57:08Araqwe can give testament a regex filter before it does its comparisons
09:57:31FromGitter<timotheecour> sure, but that should be dealt with in either integration test or unittest, not a justificaiton for that
09:58:58FromGitter<timotheecour> maybe I’m just missing the motivations behind your thinking of why mocking file:line:col is bad, given that it demonstrably leads to simpler code
09:59:38FromGitter<Bennyelg> @GULPF Work like a charm@ thanks
10:05:10Araqyour PR is not simple.
10:07:00*cspar quit (Ping timeout: 256 seconds)
10:07:35FromGitter<timotheecour> all the FAKEFILE logic is there: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ `+ passing `-d:lineInfoToStringSquashForTesting` to a testament file (which could just be done by default later)` ... [https://gitter.im/nim-lang/Nim?at=5b6d63e7a6af14730b170417]
10:09:50TheLemonManAraq, enforcing that seems to break quite some code (eg: https://github.com/nim-lang/Nim/blob/devel/lib/system/sysio.nim#L144 and its usage of `.string` to get a `var string`)
10:10:03*thk127 joined #nim
10:10:10*thk127 quit (Killed (Sigyn (Spam is off topic on freenode.)))
10:16:00AraqTheLemonMan: type conversions from distinct or subtype conversions keep the l-value property intact
10:16:28Araqand have nothing to do with 'var T' afaik
10:17:24TheLemonManoh well, that's why I asked
10:17:41TheLemonMana `var T` is a l-value
10:18:07Araqyes but a 'var x: string; x' is a l-value that is not a 'var T'
10:18:39Araql-value is a property of an expression, not of a type
10:19:12AraqI don't want system.lineInfoToString
10:25:22Araqor system.$ for arrays, or system.assert, these should all be moved from system into different modules
10:26:10Araqthe existing stuff has the strategic advantage of existing though, but I can fight for that it's not getting worse all the time
10:33:52FromGitter<timotheecour> ok so would you accept PR with these 2 changes: ⏎ ⏎ 1) `lineInfoToString becomes private` ⏎ 2) keep pre-existing code duplication in macros.nim [https://gitter.im/nim-lang/Nim?at=5b6d6a1049932d4fe4c14175]
10:43:27*dddddd joined #nim
10:45:07Araqwhy is that so important?
10:45:27Araqimproving testament seems more valuable
10:49:08*leorize joined #nim
10:57:29FromGitter<timotheecour> given 2 approaches, I’m always in favor of the simplest one. my `FAKEFILE` approach is definitely simpler than adding more logic to testament.
10:58:24Araqit's not simpler. you're adding code to system.nim which affects everybody, adding code to testament affects few.
10:59:14FromGitter<timotheecour> not if I make `lineInfoToString` private, then it doesn’t add complexity to system.nim
10:59:19Araqor maybe it's "simpler" but "simple" is not the only criterion out there
11:00:17FromGitter<tim-st> Araq: here is an example that only fails when the proc is called, that's the example I meant yesterday:
11:00:26FromGitter<tim-st> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6d7049a3a93d242245e4d2]
11:15:08*Taylor_ quit (Quit: Leaving)
11:34:40*j-fish joined #nim
11:34:52*j-fish is now known as Guest64500
11:35:35*Guest64500 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
11:36:19*fsamareanu13 joined #nim
11:36:28*fsamareanu13 quit (Killed (Sigyn (Spam is off topic on freenode.)))
11:37:41*f16 joined #nim
11:37:58*f16 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
11:39:22*rockcavera quit (Remote host closed the connection)
12:06:06*graingert8 joined #nim
12:09:13*jdhorwitz quit (Quit: Connection closed for inactivity)
12:11:35*graingert8 quit (Ping timeout: 240 seconds)
12:12:19Araqthat's an implicit generic
12:12:36Araqbecause of the openArray[enum]
12:13:42FromGitter<tim-st> yes, I found out here too: https://github.com/nim-lang/Nim/issues/8603
12:14:14*noonien joined #nim
12:20:40*francisl joined #nim
12:21:32*PrimHelios joined #nim
12:25:04*MyMind quit (Read error: Connection reset by peer)
12:25:56*MyMind joined #nim
12:41:31*cryptocat1094 joined #nim
12:42:07*PrimHelios quit (Remote host closed the connection)
12:42:35*PrimHelios joined #nim
12:45:41*PrimHelios quit (Remote host closed the connection)
12:47:27*francisl quit (Ping timeout: 240 seconds)
12:49:39*floppydh quit (Quit: WeeChat 2.2)
12:49:50*floppydh joined #nim
12:58:54*francisl joined #nim
13:16:17*ehmry quit (Ping timeout: 248 seconds)
13:17:06*endragor quit (Remote host closed the connection)
13:18:04*ehmry joined #nim
13:24:39*dgwana joined #nim
13:27:21*abm quit (Ping timeout: 240 seconds)
13:35:10*endragor joined #nim
13:39:30*endragor quit (Ping timeout: 256 seconds)
13:46:56*Sveta joined #nim
13:47:15*Sveta quit (Killed (Sigyn (Spam is off topic on freenode.)))
13:56:31FromGitter<kayabaNerve> Is it seqs or tables that must be initialized to a power of 2?
13:57:19FromGitter<kayabaNerve> Tables. Got it.
13:59:45*ng0 quit (Quit: Alexa, when is the end of world?)
14:00:48FromGitter<data-man> What? Why "must be"?
14:03:15FromGitter<kayabaNerve> No idea. I just not they must be initialized SIZE WISE to a power of 2, even if you don't use it.
14:03:16FromGitter<kayabaNerve> https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L318
14:03:46*floppydh quit (Quit: WeeChat 2.2)
14:03:47FromGitter<kayabaNerve> Here's the better link: https://nim-lang.org/docs/tables.html#initTable,int
14:03:53FromGitter<tim-st> Tables, but in theory const tables could be replaced by minimal perfect hash functions that would use nearly size of items space
14:04:14FromGitter<tim-st> (internally without the dev to do it)
14:13:36FromDiscord_<awr> hello
14:14:08FromGitter<data-man> Hello!
14:14:16FromDiscord_<awr> how is everyone
14:15:48FromGitter<data-man> so-so (personally about me) :-D
14:16:09FromDiscord_<awr> @tim-st are const tables supported? last time i tried doing that it didn't work but this was probably a year ago
14:17:09FromGitter<tim-st> yes, afaik they are. but they use the space like desribed above. maybe it's a better idea to just use an array[k, v] and hope gcc creates a minimal perfect hash function
14:17:21FromGitter<tim-st> maybe someone can findout if that is done^^
14:25:48*PMunch quit (Quit: Leaving)
14:29:55*ZetaDot joined #nim
14:31:22dom96yeah, the main examples all work
14:31:28dom96You may see some deprecation warnings though
14:33:40federico3any success story with py2nim?
14:33:56mirandom96: are you talking to someone we don't see?
14:36:15*Jesin quit (Remote host closed the connection)
14:36:23dom96unregistered users are muted due to spammers
14:36:31dom96and so I can only see them
14:36:55ZetaDotah ok, where can I register?
14:37:45miranZetaDot: now you're visible (if it was you before that we didn't see)
14:38:15TheLemonManfederico3, I'm using nimpy for some numpy/matplotlib/seaborn stuff
14:38:43ZetaDotyes it was me, ok so it seems I am ‘registered'
14:39:01miranTheLemonMan: i would be very interested to see that - i often use numpy and matplotlib
14:39:15mirancan you share the code?
14:40:31*vivus joined #nim
14:40:39TheLemonManmiran, not quite, but I just added support for named arguments to it the other day so you can just write everything as it were plain old python (with more discard's)
14:40:43*Jesin joined #nim
14:42:32TheLemonManmiran, https://gist.github.com/LemonBoy/132cf570228b10bb968179b24d073827 a small snippet I wrote the other day
14:43:16miranwow, this is quite elegant/simple! i didn't expect this would work
14:44:22mirani used to `execCmd(python foo.py)` just to run some matplotlib
14:44:41miranthis is much nicer and powerful
14:45:30TheLemonManI have some rough DSL that outputs gnuplot files for my graphing needs
14:45:51TheLemonManat some point I said "screw everything" and got back to matlab heh
14:46:22miranmatlab, ugh
14:47:02FromDiscord_<awr> is there a way I can check if a proc is defined for a type at compiletime
14:47:59*orliesaurus joined #nim
14:48:08*orliesaurus quit (K-Lined)
14:50:19*dgwana quit (Quit: Leaving)
14:52:16*planetmaker25 joined #nim
14:53:25TheLemonManawr, use a concept maybe?
14:53:31*planetmaker25 quit (Read error: Connection reset by peer)
14:53:36federico3TheLemonMan: I'm talking about the py2nim tool
14:53:49miranTheLemonMan: would something like `let (fig, ax) = plt.subplots(); ax.plot(n); fig.tight_layout()` work?
14:58:23TheLemonManmiran, sure
14:58:45TheLemonManyou have to add `.to((PyObject, PyObject))` after the subplots
15:00:34FromGitter<Vindaar> @TheLemonMan @miran: woah, I also had no idea nimpy was this advanced. That's awesome!
15:00:43*ZetaDot quit (Quit: ZetaDot)
15:02:30TheLemonManthat's because the Nim Evangelism Force is too weak
15:06:31*bathtub_shark21 joined #nim
15:07:22*bathtub_shark21 quit (Remote host closed the connection)
15:11:00*nsf quit (Quit: WeeChat 2.2)
15:14:09FromGitter<kayabaNerve> What's the fastest way to cut the last 5 elements of the seq off? sequtils.delete or...
15:14:50AraqsetLen
15:15:21FromGitter<kayabaNerve> Thanks
15:16:00*monoxane6 joined #nim
15:16:28*monoxane6 quit (Remote host closed the connection)
15:22:23*michagogo18 joined #nim
15:22:42*michagogo18 quit (K-Lined)
15:25:09*paperManu left #nim (#nim)
15:37:32*Trustable joined #nim
15:41:40*NimBot joined #nim
15:43:35*miran quit (Ping timeout: 240 seconds)
15:44:16*rayman218 joined #nim
15:45:23*rayman22201 quit (Ping timeout: 260 seconds)
15:47:37FromGitter<kayabaNerve> Can someone here who knows what Merkle Trees are (even binary trees, hash the two below it until you're at the top), mind reviewing my code?
15:47:56*ZetaDot joined #nim
15:50:14*DarkArctic joined #nim
16:07:46*Vladar quit (Remote host closed the connection)
16:09:25*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
16:14:28FromGitter<Varriount> @kayabaNerve Do Merkle trees only grow in Germany?
16:14:55FromGitter<arnetheduck> @dom96, for choosenim, is it possible to activate it only in a particular shell, and not globally? ie it seems that choosenim changes links in `.nimble/bin` which means I can't run two nims side by side in two terminals (easily).. is there maybe a flag for this? notably, this is how python venv's work
16:15:18AraqKanada is also affected, I think
16:15:58dom96arnetheduck: AFraid not
16:17:49*yglukhov[i] quit (Remote host closed the connection)
16:21:39FromGitter<arnetheduck> would it be considered as a feature req? worth jotting down in github?
16:22:02*francisl quit (Ping timeout: 255 seconds)
16:22:27*francisl joined #nim
16:26:45FromGitter<kayabaNerve> @Varriount Lol
16:29:18FromGitter<kaushalmodi> @arnetheduck Not sure if the per shell thing can work.
16:29:43FromGitter<kaushalmodi> Though, this might be possible.. what if choosenim creates symlinks for all versions?
16:30:05FromGitter<kaushalmodi> Like `nim_0180`, `nim_devel`
16:30:14*HYP3RBOR3A_ joined #nim
16:30:29FromGitter<kaushalmodi> `nim` will point to whatever user last ran the choosenim to pick.
16:30:55*HYP3RBOR3A_ quit (Remote host closed the connection)
16:31:11dom96choosenim doesn't create symlinks
16:31:25dom96so yes, it's perfectly possible
16:31:28dom96Sure, make a feature request
16:32:26FromGitter<kaushalmodi> @arnetheduck Can you create that request? (Anyways choosenim doesn't work for me on RHEL 6 :P)
16:33:25FromGitter<kaushalmodi> Just thinking out loud here.. would those symlinks work? Would also need to ensure that the right version of stdlib, docs, cfg, etc is picked..
16:33:28federico3https://github.com/nim-lang/Nim/issues/8437
16:33:30FromGitter<arnetheduck> @kaushalmodi of course it can work - instead of modifying a binary in '.nimble/bin', it can update `$PATH` to point to `.nimble/nim-version-XXX/bin`that contains the specific version - or like python, create a folder specific for the environment/project and update path to there...
16:35:00FromGitter<kaushalmodi> I use GNU Stow that symlinks all the files from my versioned Nim installations to the "stowed" dir that's added to PATH
16:35:16federico3adding translation to Nim docs sounds good. I wonder how to translate the library docs tho
16:35:36FromGitter<kaushalmodi> So when I switch to v0.18.0, all files from that version get used via symlinks
16:35:38FromGitter<arnetheduck> this also neatly takes care of one of the biggest deficiencies of nimble: it's global package registry, where version matching regularly gets messed up
16:37:35FromGitter<kaushalmodi> Also, food for thought.. I don't use Windows, so not sure if the symlinks would work there.
16:42:16FromGitter<arnetheduck> so as dom96 says, there are no symlinks involved.. I used the term casually, but what happens in reality is that choosenim relies on `.nimble/bin` being in your `PATH`.. what it could do is update `PATH` instead of that binary..
16:43:26Araq1. symlinks don't work well on windows indeed.
16:43:48Araq2. --nimbleDir can be project specific, it doesn't have to be a global package registry
16:43:56dom96arnetheduck: I think you misunderstand how choosenim works too
16:44:05dom96choosenim creates a proxy executable in ~/.nimble/bin
16:44:13dom96This executable reads ~/.choosenim/current
16:44:22dom96and then launches the specified toolchain
16:44:44dom96In what way does version matching get messed up in Nimble?
16:46:47FromGitter<arnetheduck> @dom96 right.. same end result though
16:52:11FromGitter<arnetheduck> @dom96 it's a global registry - it means that running nimble on project a, then project b will change which packages are used for project a.. example: you're compiling a with stable version 1.0, then for project b, you want to try out `#head`... when you try to compile a again, you'll find that `#head` is matched even though you didn't change anything about a..
16:53:08FromGitter<arnetheduck> so what versions it matches all depends on what happens to sit in the `pkgs` folder which is global.. it means you cannot `nimble develop` some package comfortably because it breaks all the other projects you're trying to build
16:53:17dom96Sure, Nimble isn't feature complete yet. The plan is to implement lockfiles to solve this
16:54:43FromGitter<arnetheduck> does that plan include never ever ever depending on global state?
16:55:38FromGitter<arnetheduck> http://cewing.github.io/training.python_web/html/presentations/venv_intro.html points this out in a succinct way: ⏎ For every package ⏎ installed in the ⏎ system Python, the ⏎ gods kill a kitten ... [https://gitter.im/nim-lang/Nim?at=5b6dc38aa3a93d242247f299]
16:57:33*Jesin quit (Remote host closed the connection)
17:00:03*wildlander joined #nim
17:02:21*Hoolootwo joined #nim
17:02:57*Hoolootwo quit (Remote host closed the connection)
17:05:02*Jesin joined #nim
17:07:37Araqas I said, you can use --nimbleDir
17:14:36FromGitter<arnetheduck> and I can use my own shell script to update path to a full nimble+nim installation with aliases that replace nim, nimble etc to add `--nimbleDir` and all the other flags! oh wait, I just implemented choosenim...
17:17:22*vosper joined #nim
17:20:17Araqmaybe, but if the script is short enough...
17:22:22*ng0 joined #nim
17:22:58AraqI thought shell scripts are universally regarded as the pinnacle of human achievement.
17:24:21FromGitter<arnetheduck> well, the point of a tool like `choosenim` and `nimble` is to take care of those things conveniently in a way that promotes a good workflow about which you can write tutorials for newcomers.. just like global variables in code, having them depend on global state is.. problematic and causes unnecessary friction when trying to use nim
17:25:15*TBloemink22 joined #nim
17:25:40*TBloemink22 quit (Killed (Sigyn (Spam is off topic on freenode.)))
17:26:19FromGitter<arnetheduck> it's the same story repeated all over again: windows3.11 didn't have isolated memory spaces for apps, python2 didn't have isolated package repos, C overused global vars in basic functions leading to races and reentrancy problems... I guess history is not that great of a teacher ;)
17:34:27Araqsure, actually you don't have to convince me, I wrote 'nawabs' fwiw
17:36:26Araqlol "Is this valid Nim code or a typo?"
17:36:53FromGitter<arnetheduck> https://github.com/dom96/choosenim/issues/78
17:37:24Araq"Is that art or can I trash it?"
17:37:43*themagician quit ()
17:44:17*miran joined #nim
17:44:38FromGitter<dom96> Offtopic: I'm calling it now, this is where UIs are heading https://news.ycombinator.com/item?id=17733515. I've thought about creating a UI toolkit with a minimal implementation of HTML5/CSS3.
17:44:50FromGitter<dom96> Eventually someone will make a good enough version of this so it's used for many desktop apps.
17:56:04FromGitter<zetashift> Flutter works kind of like that no? Instead of C++ it uses dart tho
17:56:15FromGitter<zetashift> and skia as the backend renderer
17:58:54*jgh- joined #nim
18:00:51jgh-hey guys, i'm messing around with macros a bit and i made one like this: `checkSame(x: typed): bool = sameType(getType(float32), x.getType)` i get an error `got <int literal(1)> expected bool`. If I change the return type to `int` I get `got bool expected int`
18:01:39jgh-i found a workaround is to set return type to int, cast to int prior to returning, and do if checkType(v) == 1: instead of if checkType(v):
18:02:30jgh-is there a way to have it emit bool instead of an int? Seems strange that it can't do that.
18:03:05Araqplease create an issue for it
18:06:11jgh-ok
18:12:16FromGitter<kungtotte> Dominik: I think we'll see a shared-lib version of Electron before we'll see any real shift in the UI space. Ultimately
18:12:32jgh-https://github.com/nim-lang/Nim/issues/8606
18:13:30*marduk1917 joined #nim
18:15:16*clyybber quit (Quit: good night)
18:16:20*marduk1917 quit (K-Lined)
18:17:24Araqty
18:22:34*jgh- quit (Remote host closed the connection)
18:27:17*jgh- joined #nim
18:29:17*jgh- quit (Remote host closed the connection)
18:30:18*themagician joined #nim
18:41:24*yglukhov[i] joined #nim
18:46:59*cspar joined #nim
18:54:40*yglukhov[i] quit (Remote host closed the connection)
19:07:07*Cthalupa quit (Quit: ZNC 1.6.6+deb1ubuntu0.1 - http://znc.in)
19:08:12*nsf joined #nim
19:12:42*Cthalupa joined #nim
19:23:46zacharycarter[m]TheLemonMan: Thank you for working on - https://github.com/nim-lang/Nim/issues/8535 - I didn't have time to take your recommendation in and really study cgthreadvars. I'm noticing though, that threadvar access still isn't correct for OSX
19:24:12zacharycarter[m]I'm still able to produce an error like - `error: use of undeclared identifier 'jobAllocator_pIfSFgeWayCCdkwxetqviA'
19:24:13zacharycarter[m] objectInit((&jobAllocator_pIfSFgeWayCCdkwxetqviA), (&NTI_DmbOJrP8XPh21ejU3vT4EA_));`
19:24:26zacharycarter[m]when jobAllocator is a threadvar
19:25:00zacharycarter[m]although I think the generated C code now does look different
19:25:31*zacharycarter[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/vEQGkRewZQGlSHtgcKshXtKM >
19:25:46zacharycarter[m]I'm not sure if you were done with the code changes or not - if not - is there any way I can assist?
19:29:06*yglukhov[i] joined #nim
19:36:58*rayman218 quit (Ping timeout: 260 seconds)
19:37:26*rayman22201 joined #nim
19:42:20*abm joined #nim
19:56:51*RichiH10 joined #nim
19:57:29*RichiH10 quit (Killed (Sigyn (Spam is off topic on freenode.)))
20:01:58*cryptocat1094 quit (Quit: later)
20:09:29*TheLemonMan joined #nim
20:12:01*DarkArctic quit (Read error: Connection reset by peer)
20:12:29zacharycarter[m]it'd be super nice if that ultralight lib had a C99 API
20:12:47TheLemonManzacharycarter[m], I still have to have a look at the test failures, if you have more code that's broken please add it to the original ticket
20:17:00zacharycarter[m]TheLemonMan: I'll try to create something reproducable - it's a rather large project that it's failing in atm, so I'll work on it now and see if I can figure out what's causing it
20:18:20TheLemonManzacharycarter[m], I think that some chunks of the C file where the error is are enough (and the corrisponding nim code ofc :)
20:19:10*noonien quit (Quit: Connection closed for inactivity)
20:19:21zacharycarter[m]okay cool - I will get that going now
20:33:40zacharycarter[m]TheLemonMan: I hope this helps - https://github.com/zacharycarter/frag
20:34:12zacharycarter[m]Please ping me and let me know if I can help to reproduce anything
20:34:15zacharycarter[m]or upload more examples / try out fixes
20:38:13TheLemonManzacharycarter[m], compiles fine here w/ my patch
20:38:31TheLemonManI just had to bump the TLS size (yikes) as the compiler kindly suggested
20:38:56zacharycarter[m]hrm
20:39:27zacharycarter[m]weird
20:39:43zacharycarter[m]let me re-install Nim and make sure I have your patch applied correctly
20:45:49dom96zacharycarter[m]: it'd also be nice if ultralight wasn't proprietary :)
20:45:59dom96The C++ API is usable from Nim thanks to Nim's awesomness
20:48:03zacharycarter[m]well I know Nim can bind to C++ - I just have never managed to do it successfully / tried hard enough - but I plan on trying this feature out soon
20:48:06*SuchWow21 joined #nim
20:48:18zacharycarter[m]I didn't realize ultralight was proprietary - yes that sucks too
20:48:42*SuchWow21 quit (Remote host closed the connection)
20:49:36zacharycarter[m]TheLemonMan: this is def my fault - my bad, I only copied a portion of your change - my internet is super slow atm but I will confirm asap that your fix also compiles on my system
20:58:05*miran quit (Ping timeout: 244 seconds)
21:04:46*francisl quit (Quit: francisl)
21:04:57*TheSilentLink26 joined #nim
21:05:08*TheSilentLink26 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
21:05:21zacharycarter[m]TheLemonMan: change looks good :thumbsup:
21:05:43TheLemonManzacharycarter[m], and I just fixed the tests that were red
21:06:32zacharycarter[m]😂
21:07:52zacharycarter[m]thanks so much for fixing this!
21:08:28TheLemonMannp, I hate when bugs break your flow :)
21:09:48zacharycarter[m]amen! it's so nice that you're becoming such a Nim compiler wiz! the community just keeps getting better and better! I can't wait to see what's in store for the future of Nim 😀
21:12:39zacharycarter[m]I'm trying to learn more about compilers work before I take that dive - looking at your fix - there's no way I would have arrived at that
21:19:47*yglukhov[i] quit (Remote host closed the connection)
21:19:57*vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:20:59*Sabotender18 joined #nim
21:21:57*Sabotender18 quit (Killed (Sigyn (Spam is off topic on freenode.)))
21:32:58*vosper joined #nim
21:33:07*Trustable quit (Remote host closed the connection)
21:40:42FromDiscord_<treeform> zacharycarter, I bound to C++ api, the auto wrap tools did not work but manually I made progress.
21:48:42*nsf quit (Quit: WeeChat 2.2)
22:19:51*smt quit (Read error: Connection reset by peer)
22:21:54*rayman282 joined #nim
22:24:23*rayman22201 quit (Ping timeout: 260 seconds)
22:34:18*rayman282 quit (Ping timeout: 260 seconds)
22:37:58*Jesin quit (Remote host closed the connection)
22:43:31*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
22:48:16*Jesin joined #nim
22:49:25*cottongin29 joined #nim
22:50:41*smt joined #nim
22:53:51*cottongin29 quit (Ping timeout: 240 seconds)
23:17:31*Pisuke joined #nim
23:19:46*MyMind quit (Ping timeout: 268 seconds)
23:21:24*siinus`26 joined #nim
23:21:40FromGitter<kayabaNerve> TIL Nim cross-file inheritance can stop you from accessing members.
23:22:10FromGitter<kayabaNerve> I wanted descendants to have access to the members but not any file, so I had to create getters/setters for the class itself to use...
23:22:57*siinus`26 quit (Remote host closed the connection)
23:47:50*ng0 quit (Quit: Alexa, when is the end of world?)