<< 23-02-2018 >>

00:04:19*miran_ quit (Ping timeout: 260 seconds)
00:22:43FromGitter<nitely> yes, like nimYAML
00:29:23FromGitter<nitely> nimYAML could have an API that require just a file name, and then the one that takes a stream for special cases I can't think off
00:30:12*MJCaley quit (Quit: MJCaley)
00:45:23*Jesin quit (Quit: Leaving)
00:59:22*MJCaley joined #nim
01:09:10GitDisc<pooboy> Hello guys !!
01:11:08FromGitter<zetashift> yello!
01:12:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:14:32GitDisc<pooboy> nim is awesome !!!
01:14:53GitDisc<pooboy> How to use the modulus operator ?
01:17:11FromGitter<zetashift> I agree! And modulus is used like ```a mod b```
01:17:23FromGitter<zetashift> !eval 4 mod 2
01:17:24NimBotCompile failed: in.nim(1, 3) Error: expression '0' is of type 'int literal(0)' and has to be discarded
01:17:37FromGitter<zetashift> whoops
01:17:54FromGitter<zetashift> !eval echo(4 mod 2)
01:17:56NimBot0
01:18:19FromGitter<zetashift> this is what I get for learning multiple languages at the same time ><
01:21:05GitDisc<pooboy> Lol
01:21:16GitDisc<pooboy> Thanks !!
01:21:25FromGitter<zetashift> Are you coming from other languages @pooboy?
01:25:08GitDisc<pooboy> Yes..im coming from ruby,python , java ..im no programmer..im an enthusiast :)
01:25:46FromGitter<zetashift> @pooboy , this might help: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers and http://blog.zdsmith.com/posts/nim-for-python-programmers.html
01:26:01FromGitter<zetashift> For quick small experiments you can use: https://play.nim-lang.org/
01:26:10FromGitter<zetashift> I'm actually in the same boat
01:27:07GitDisc<pooboy> 👌 👌 👌 👌 👌
01:27:33GitDisc<pooboy> Can i create my own package for nim ?
01:27:59FromGitter<zetashift> yes check out: https://github.com/nim-lang/nimble
01:28:40GitDisc<pooboy> Great !
01:53:56*yglukhov joined #nim
01:54:03GitDisc<pooboy> can we cross-compile binaries ?
01:55:11FromGitter<zetashift> @pooboy, yes see: https://nim-lang.org/docs/nimc.html#cross-compilation
01:55:35FromGitter<zetashift> I don't have any experience with it though but if you run into troubles just ask here or open a forum thread
01:58:05*yglukhov quit (Ping timeout: 240 seconds)
02:04:01GitDisc<pooboy> niceeeee
02:16:22FromGitter<zacharycarter> I guess I need to work on the playground this weekend :) will get me back into writing some Nim
02:18:47GitDisc<pooboy> 😇 😇 😇
02:19:52GitDisc<pooboy> how to write and call a procedure
02:21:13FromGitter<zacharycarter> pooboy: https://play.nim-lang.org/?gist=c2874ef069977ca708fd46ab6466cf6e
02:21:48FromGitter<zacharycarter> also please read the manual, answers to simple questions like yours are easily found there - https://nim-lang.org/docs/manual.html
02:24:06GitDisc<pooboy> Ohh cool
02:24:09GitDisc<pooboy> Thanks
02:24:49FromGitter<zacharycarter> sure thing
02:25:10FromGitter<zetashift> @pooboy also the https://nim-lang.org/docs/tut1.html#procedures official tutorial covers imho everything you need to make programs in Nim
02:25:18FromGitter<zetashift> @zacharycarter how's the gamedevving?
02:26:39FromGitter<zacharycarter> @zetashift - I haven't been doing much lately. I just started in the past few weeks to write the core of an engine, but I'm writing it in C++. I plan to add support for Nim as a language for gameplay code.
02:28:32FromGitter<zetashift> Have you seen http://kha.tech/ you might be able to draw some inspiration from that, IIRC it's core is written in C++
02:28:58FromGitter<zetashift> and with the wealth of information about C++ and gamedev I wouldn't blame you for writing it in C++
02:30:29FromGitter<zacharycarter> Ah I guess it's from the armory folks? Looks like they have a link to that project in the screenshot frame.
02:31:09FromGitter<zetashift> Armory is based on it yes but Kha is from a different person
02:31:19FromGitter<zacharycarter> gotcha
02:31:51GitDisc<pooboy> Noted
02:32:07FromGitter<zetashift> when I tried digging it into it they said don't think of it as an engine but as an alternative to SDL
02:34:30FromGitter<zacharycarter> I don't know - some of their features make no sense to me... like the ability to run on top of Unity. Why on earth would you want to run something like SDL on top of Unity?
02:36:09FromGitter<zetashift> I believe they added it so they could target consoles too as they didn't have the official SDKs
02:36:37FromGitter<zacharycarter> gotcha
02:42:21*poopBotTelefon quit (Ping timeout: 264 seconds)
02:50:23*MJCaley quit (Quit: MJCaley)
02:57:42*athenot_ joined #nim
02:58:12*athenot quit (Ping timeout: 260 seconds)
03:09:04*vlad1777d quit (Ping timeout: 268 seconds)
03:10:53*Faster-Fanboi_ quit (Quit: ZNC 1.7.x-git-876-42939c9 - https://znc.in)
03:12:36*Faster-Fanboi joined #nim
03:50:43FromGitter<zetashift> Can anyone help me why I get an out of bounds error? https://play.nim-lang.org?gist=8c1998c4d9932e0b643bd075fd806122
03:51:29FromGitter<zetashift> I'm following a data structures book with Nim and I've done this before in JS but that doesn't translate too well
03:52:46FromGitter<zetashift> doing ``` var existingNumbers = newSeqint (a.len) removes it but I don't get the correct answer then
03:53:05FromGitter<zetashift> whoops I mean ``` var existingNumbers = newSeqint (a.len) ```
03:56:25FromGitter<zetashift> it seems to always branch out to the true clause so I'm making a logic error but can't figure it quite out
04:05:47FromGitter<zetashift> Fixed the out of bounds error and the correct boolean operator is != and nim initializes int seqs with 0's
04:07:23*tefter quit (Remote host closed the connection)
04:15:36FromGitter<zetashift> and now it always prints false; Should I use arrays instead? https://play.nim-lang.org?gist=fb805d73085178df67094213cba633be
04:17:31*SenasOzys quit (Ping timeout: 268 seconds)
04:30:09*Sembei joined #nim
04:32:19*Pisuke quit (Ping timeout: 268 seconds)
04:46:11*Faster-Fanboi quit (Ping timeout: 256 seconds)
04:52:57*Faster-Fanboi joined #nim
05:07:01*dddddd quit (Remote host closed the connection)
05:07:19*pecanpie joined #nim
05:13:41FromGitter<Varriount> zetashift: I don't see how that algorithm is supposed to detect duplicate entries.
05:14:09*Faster-Fanboi quit (Ping timeout: 248 seconds)
05:14:51*pecanpie quit (Quit: Leaving)
05:15:03FromGitter<Varriount> You either need a second, nested `for` loop, or a `Set[int]` to store numbers that have been seen.
05:16:56FromGitter<Varriount> (Note that `Set[int]` is not the same as the built-in `set` type.)
05:20:52*Faster-Fanboi joined #nim
05:31:58*mal`` quit (Quit: Leaving)
05:41:42*mal`` joined #nim
05:46:24*r3d9u11 joined #nim
05:58:12*radagast_04 joined #nim
06:08:47*nsf joined #nim
06:25:50*r3d9u11 quit (Remote host closed the connection)
06:29:42*rockcavera quit (Remote host closed the connection)
06:38:54GitDisc<ethanpmorgan> Bonjour
06:38:58GitDisc<ethanpmorgan> My dudes
06:43:46FromGitter<zetashift> @Varriount I need a proc that checks for duplicates in a single loop; Everytime I encounter a new number I store it a 1 at the index of the corresponding number in existingNumbers
06:45:00FromGitter<Varriount> Yes, but
06:45:17FromGitter<zetashift> @ethanpmorgan hello! how's it going?
06:45:56FromGitter<Varriount> All the function will do is create an array filled with 1's
06:46:29FromGitter<epmor> Hey, gave up with Haskell, Nim seems like a great language to learn programming with, changed my previous project to from Haskell to Nim and Nim's quite rich in the stdlib compared to Haskell
06:46:31FromGitter<zetashift> here's the js: https://pastebin.com/9RTerCEP
06:47:44FromGitter<Varriount> You can't do it in a single loop, as you need to check whether the current number has been seen before
06:49:06*rockcavera joined #nim
06:49:11FromGitter<zetashift> mhhmmh, I guess I've just misinterpreted something wrong while reading; thanks for some clarity!
06:51:25FromGitter<zetashift> @epmor I had the same with Scala; still taught me alot about programming in general
06:53:28FromGitter<epmor> Yeah I've been jumping language to language to see what I like, but none of them seems "fun", so far Nim's simple and speedy so it's a win win. And the community is smallish which is nice
07:07:39FromGitter<tim-st> @zetashift something like `len(openArray) != len(set(openArray))` would solve your problem
07:07:59FromGitter<tim-st> (pseudo code)
07:09:54*r3d9u11 joined #nim
07:21:17*SenasOzys joined #nim
07:21:19*yglukhov joined #nim
07:25:48*yglukhov_ joined #nim
07:26:54*yglukhov_ quit (Client Quit)
07:27:57*yglukhov quit (Ping timeout: 264 seconds)
07:28:53*yglukhov joined #nim
07:29:04*miran_ joined #nim
07:30:48*rockcavera quit (*.net *.split)
07:30:48*avsej quit (*.net *.split)
07:30:48*Araq quit (*.net *.split)
07:30:48*derlafff quit (*.net *.split)
07:30:48*mgdelacroix[m] quit (*.net *.split)
07:30:48*pydsigner quit (*.net *.split)
07:31:20*joshbaptiste quit (*.net *.split)
07:31:20*subsetpark quit (*.net *.split)
07:31:20*hohlerde quit (*.net *.split)
07:31:20*jonafato quit (*.net *.split)
07:36:57*yglukhov quit (Read error: Connection reset by peer)
07:40:53FromGitter<Varriount> @tim-st Wouldn't it be better to just maintain a set of already seen integers, and check/add to it every loop?
07:41:23FromGitter<Varriount> That way you can bail out early if a duplicate is found.
07:48:40FromGitter<epmor> How do you use case with object types?
07:49:03FromGitter<epmor> I'll pastebin my code
07:49:23FromGitter<epmor> https://pastebin.com/wazpaKZp
07:50:11FromGitter<epmor> I haven't finished it, hoping to get it to be more usable, but just trying to get the case working with the object/struct
07:50:59*miran_ left #nim (#nim)
07:51:07*miran_ joined #nim
07:51:46*miran_ left #nim (#nim)
07:52:22*miran1 joined #nim
07:53:22*joshbaptiste joined #nim
07:53:22*subsetpark joined #nim
07:53:22*hohlerde joined #nim
07:53:22*jonafato joined #nim
07:56:07*pydsigner joined #nim
07:56:35*miran1 quit (Client Quit)
07:57:34*rockcavera joined #nim
07:57:34*avsej joined #nim
07:57:34*Araq joined #nim
07:57:34*derlafff joined #nim
07:57:34*mgdelacroix[m] joined #nim
07:58:31*miran joined #nim
07:59:49*mgdelacroix[m] quit (Ping timeout: 240 seconds)
08:00:02*byteflame quit (Ping timeout: 248 seconds)
08:00:02*survivorm[m] quit (Ping timeout: 248 seconds)
08:00:03*ehmry quit (Ping timeout: 248 seconds)
08:00:03*dyce[m] quit (Ping timeout: 248 seconds)
08:00:09*hohlerde quit (Ping timeout: 255 seconds)
08:00:13*notdekka[m] quit (Ping timeout: 240 seconds)
08:00:13*xincognito10[m] quit (Ping timeout: 240 seconds)
08:00:14*hiway quit (Ping timeout: 240 seconds)
08:00:14*unclechu quit (Ping timeout: 240 seconds)
08:00:18*planetis[m] quit (Ping timeout: 255 seconds)
08:00:21*Jipok[m] quit (Ping timeout: 252 seconds)
08:00:22*TheManiac quit (Ping timeout: 260 seconds)
08:00:22*Miguelngel[m] quit (Ping timeout: 260 seconds)
08:00:22*Yardanico quit (Ping timeout: 260 seconds)
08:00:22*Demos[m] quit (Ping timeout: 260 seconds)
08:00:50*macsek1911[m] quit (Ping timeout: 276 seconds)
08:00:51*shashlick quit (Ping timeout: 276 seconds)
08:01:12*tiorock joined #nim
08:01:12*tiorock quit (Changing host)
08:01:12*tiorock joined #nim
08:01:12*rockcavera quit (Killed (wolfe.freenode.net (Nickname regained by services)))
08:01:12*tiorock is now known as rockcavera
08:01:37FromGitter<epmor> Nevermind I got it
08:03:25*Ven`` joined #nim
08:04:40FromGitter<mratsim> @epmor, if you have questions on how to translate some Haskell constructs to Nim feel frree, several of us have Haskell or Scala background and added libraries for idiomatic (but fast) functional programming (chaining zip, map, fold, filter, etc)
08:07:08FromGitter<mratsim> @Lite5h4dow it’s me who told you you can use streams. It’s more of an advanced way to read anything (files, network, Gzip on the-fly uncompression). basically you open a handler to a “stream” (a file read line by line, a network stream, a file uncompressed on-the fly, a download ...), read some, process, read some, process on the fly, etc.
08:07:25FromGitter<epmor> Ah thanks @mratsim Just trying to implement Result into Nim
08:07:27FromGitter<mratsim> It can be a camera feed, a mic
08:09:12FromGitter<mratsim> @epmor, you can create a tuple: `type Result[T]: tuple[value: T, error: YourErrorSuccessEnumType]`
08:09:51FromGitter<mratsim> but in that case Nim uses exceptions rather than returning a result type like in Haskell Rust or Go.
08:10:10FromGitter<mratsim> I mean, it’s idiomatic to use exceptions
08:10:35*SenasOzys quit (Remote host closed the connection)
08:11:48*Ven`` quit (*.net *.split)
08:11:48*avsej quit (*.net *.split)
08:11:48*Araq quit (*.net *.split)
08:11:48*derlafff quit (*.net *.split)
08:11:50*joshbaptiste quit (*.net *.split)
08:11:50*subsetpark quit (*.net *.split)
08:11:50*jonafato quit (*.net *.split)
08:11:56FromGitter<epmor> Ah I see
08:12:00FromGitter<epmor> Cheers my dude
08:13:37FromGitter<epmor> Wanna make something that'll be used or useful
08:16:31*Ven`` joined #nim
08:16:37*Arrrr joined #nim
08:21:32*PMunch joined #nim
08:22:27*subsetpark joined #nim
08:22:33*jonafato joined #nim
08:22:38*joshbaptiste joined #nim
08:23:18Arrrrhttps://www.reddit.com/r/programming/comments/7zird1/nim_at_fosdem_frequently_asked_questions/
08:24:57FromGitter<mratsim> @epmor You can have a look at nimfp for example: https://github.com/vegansk/nimfp
08:25:12FromGitter<mratsim> For example the Either type: https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim
08:26:40FromGitter<epmor> Ah sweet, thanks @mratsim
08:30:21PMunchArrrr, did you like it?
08:31:56ArrrrYes. But people on reddit will not know how does nim look like.
08:33:12*avsej joined #nim
08:33:12*avsej quit (Changing host)
08:33:13*avsej joined #nim
08:33:14PMunchHmm, that's true, but it's a quick google search away :)
08:33:34*Araq joined #nim
08:34:01ArrrrImagine people are lazy
08:34:06*derlafff joined #nim
08:34:45*xkapastel quit (Quit: Connection closed for inactivity)
08:35:06FromGitter<mratsim> You have 5 sec to capture someone attention on a webpage
08:35:42FromGitter<mratsim> at least that’s what growth hackers, designers and frontend dev work with
08:38:15PMunchHmm, maybe I could sprinkly some code examples in there..
08:42:21FromGitter<mratsim> apparently last npm upgrade crashed all linux servers
08:43:20PMunchmratsim, yup pretty brutal :P
08:43:32PMunchIt changed a bunch of permissions for system folders like /etc
08:44:10FromGitter<mratsim> I wonder if nimble did that how many people would hear of Nim :evilgrin:
08:45:15PMunchHaha, what kind of sysadmin would end up reinstalling over some broken file permissions?
08:46:20FromGitter<mratsim> Someone who didn’t have to deal with systemd or pulseaudio 10 years ago ;)
08:47:45PMunchHmm, is GitHub down for you too?
08:48:00FromGitter<mratsim> I don’t even understand why you would deliver your production packages through npm without a docker or LXC or VM. It’s like Python, versioning/compat is too random
08:48:31FromGitter<mratsim> Works for me™
08:48:44PMunchHmm, I can't pull repos or visit their main site..
08:51:22FromGitter<honewatson> Just wanted to say thanks to the Nim crew. You have done an amazing job! Its almost unbelievable what you have achieved!
08:52:28PMunchAgreed!
08:59:46*floppydh joined #nim
09:01:20ArrrrAll the bugs that arise from naming both type and module the same ...
09:01:35*hiway joined #nim
09:03:56AraqArrrr: filenames should be all lowercase anyway :P
09:04:14Araqhonewatson: thank you. :-)
09:10:10*rokups joined #nim
09:14:54*dyce[m] joined #nim
09:14:54*Yardanico joined #nim
09:14:54*shashlick joined #nim
09:14:55*Miguelngel[m] joined #nim
09:14:55*unclechu joined #nim
09:14:55*mgdelacroix[m] joined #nim
09:14:55*Demos[m] joined #nim
09:14:55*xincognito10[m] joined #nim
09:15:01*byteflame joined #nim
09:15:02*macsek1911[m] joined #nim
09:15:02*TheManiac joined #nim
09:15:02*hohlerde joined #nim
09:15:02*notdekka[m] joined #nim
09:15:02*planetis[m] joined #nim
09:15:02*ehmry joined #nim
09:15:03*survivorm[m] joined #nim
09:15:04*Jipok[m] joined #nim
09:30:03*yglukhov joined #nim
09:34:22*couven92 joined #nim
09:41:14FromGitter<gogolxdong> @PMunch are you writing a protobuf library in Nim ?
09:44:05*Ven` joined #nim
09:44:06*Ven`` quit (Read error: Connection reset by peer)
09:45:18PMunchYup
09:45:46FromGitter<gogolxdong> How is it going?
09:47:42FromGitter<gogolxdong> Where to apply ?
09:49:37PMunchApply?
09:49:42PMunchIt's going pretty well
09:50:18PMunchI'm developing a parser library as well to parse the file with. So currently I'm working on improving the error messages from the parser so it's easier to see what you did wrong
09:50:38PMunchBut for parsing correct data it works pretty well
09:50:52PMunchAnd I've implemented the varargs and sig-sag signed ints
09:50:53FromGitter<gogolxdong> IPFS uses protobuf.
09:51:32PMunchSo the only thing thats really left is to generate the types and the procs to read and write messages
09:52:11PMunchIPFS?
09:52:32PMunchhttps://github.com/PMunch/protobuf-nim
09:52:38PMunchhttps://github.com/PMunch/combparser
09:52:47PMunchThat's the repos for both project
09:52:48PMunchs
09:52:50FromGitter<Vindaar> InterPlanetary FileSystem ;)
09:53:27PMunchHmm, interesting
09:54:04FromGitter<gogolxdong> thanks . I will check and see whether can give a hand.
09:55:37PMunchThat'd be great :)
09:57:36PMunchThe protobuf-nim repository is kinda messy :P
09:57:55PMunchSo don't hesitate to ask questions
09:59:38*yglukhov quit (Remote host closed the connection)
10:00:21couven92dom96, I didn't have time watching you live, but I am watching the YT now! Looking forward to it!!!! :)
10:02:07couven92tea actually sound real nice, hmm... git to make myself a cup first :P
10:03:07*Vladar joined #nim
10:05:34FromGitter<gogolxdong> Though we can't access into IPFS due to Data Security Law , it's a paradim-shifting practice which our government encourages.
10:07:18FromGitter<gogolxdong> What we can do is a interChinese FileSystem.
10:15:16FromGitter<narimiran> test 1 2
10:16:33*miran quit (Quit: Page closed)
10:18:36FromGitter<narimiran> ok, this works (i was having problem with IRC this morning). it's miran, btw, if it was not clear....
10:25:46Araqso ... again the question: how do we ensure imports from a nimble package?
10:25:52Araqimport nimble / random ?
10:26:05Araqbut nimble itself is a nimble package so that would be ambiguous
10:33:54FromGitter<andreaferretti> for what it's worth, there could be two nimble packages defining the same module
10:34:09FromGitter<andreaferretti> so it is not only an issue of nimble vs stdlib
10:34:49FromGitter<andreaferretti> path import are kind of a solution right now
10:35:07FromGitter<andreaferretti> import "nim-random/v0.6/random"
10:35:15FromGitter<andreaferretti> or something like that, I don't remember
10:35:29FromGitter<andreaferretti> but you have to know the actual path in the nimble directory
10:35:43FromGitter<andreaferretti> and it depends on the version number, which is unfortunat
10:35:44FromGitter<andreaferretti> e
10:36:39FromGitter<narimiran> doesn't sound like an elegant solution.... :(
10:37:06FromGitter<andreaferretti> it is not
10:37:15FromGitter<andreaferretti> just telling what works right now
10:38:18FromGitter<andreaferretti> there should be a way to define a namespace in your nimble package
10:38:24FromGitter<andreaferretti> so that one could do
10:38:31FromGitter<andreaferretti> import mynamespace/mymodule
10:38:44FromGitter<andreaferretti> or just import mymodule if it is not ambiguous
10:39:18FromGitter<narimiran> shouldn't nimble authors be the ones responsible to not use the same names as std lib?
10:39:49FromGitter<andreaferretti> yup
10:40:00FromGitter<andreaferretti> but modules can be added to the stdlib
10:40:02couven92narimiran: Yeah, how well is that going to go?
10:40:07FromGitter<narimiran> and if some conflict arises currently because of additions to std lib - well, nim is still in pre-1.0 phase and this should be expected
10:40:10FromGitter<andreaferretti> I think this is what happened with random
10:40:22FromGitter<narimiran> and you and your package need to find another name
10:40:43FromGitter<andreaferretti> the real problem is conflicts between modules in different nimble packages
10:41:27Araqmost nimble packages do require import mynamespace/mymodule
10:42:52FromGitter<andreaferretti> yeah, but is there any check on uniqueness of namespaces?
10:43:44FromGitter<andreaferretti> I think something was done when nimble started adding warnings for modules named differently from the nimble package
10:49:59Araqthe problem is that 'import jester/jester' or import random/random is not sexy and so Nimble allows for a different directory structure where 'import jester' works
10:50:37Araqwhich is fine for names like 'jester' that do not have technical names like 'random', I guess
10:55:10*SenasOzys joined #nim
11:03:09dom96andreaferretti: the package name **is** the namespace
11:03:51dom96And indeed, the warnings are there to ensure uniqueness
11:03:55dom96Eventually they will be errors
11:06:37FromGitter<andreaferretti> but can one do `import packagename/modulename`?
11:06:46FromGitter<andreaferretti> that is, is this supported
11:06:47FromGitter<andreaferretti> ?
11:07:08FromGitter<andreaferretti> I only remember `import "packagename/$version/modulename"`
11:07:44dom96yes
11:08:20dom96Where are you getting `import "packagename/$version/modulename"` from?
11:08:25dom96That was never possible
11:09:34couven92LOL, dom96 "nimisawesome" used 6 times! :D
11:09:43dom968 times, no? :)
11:10:00couven92ah, low res on my small-on-the-side-screen
11:10:02couven92sry
11:10:12couven92yeah, 8 times! :)
11:10:19FromGitter<andreaferretti> @dom96 it is possible because it is the actual path on disk of the nim file
11:10:20dom96yeah, I wish I remembered to change the font size :(
11:10:38dom96andreaferretti: but it's not. The path is packagename-$version/modulename
11:10:44couven92and go was not awesome! :P
11:10:48FromGitter<andreaferretti> ah ok sorry
11:10:59FromGitter<andreaferretti> I got that wrong but it was what I meant
11:11:20FromGitter<andreaferretti> the question remains
11:11:22dom96also that requires your nim path to contain ~/.nimble/pkgs
11:11:26dom96does it by default?
11:11:39FromGitter<andreaferretti> whe. run by nimble apparently it does
11:12:07couven92dom96, though tbh, as a git teacher at UiT, I take issue at you running `git init` AFTER you were done coding the main parts! :P
11:12:23FromGitter<andreaferretti> the point is `import "packagename-$version/modulename"` is inconvenenient
11:12:29couven92AND calling your commit "Initial Commit"
11:12:39FromGitter<andreaferretti> does `import packagename/modulename` work?
11:12:55dom96couven92: oh? I was never taught git formally
11:12:58FromGitter<andreaferretti> otherwise I would not say that packagename is a namespace
11:12:59FromGitter<alehander42> I always call my first commit "First" :D
11:13:09FromGitter<andreaferretti> except in some philosophical sense
11:13:51*derlafff quit (Remote host closed the connection)
11:13:57dom96andreaferretti: it works for modules that the package puts in a 'packagename' folder
11:14:06*derlafff joined #nim
11:14:14dom96`import "packagename-$version/modulename"` shouldn't work
11:14:14couven92Yeah, I don't teach a subject with syllabus on Git, but I have been giving evening classes for three years now...
11:14:19dom96Amazed that it does
11:14:56dom96couven92: I can see why calling 'git init' earlier is a good idea, but what's wrong with my commit message?
11:15:16couven92dom96, it does not describe what you did in you commit at all!
11:15:21FromGitter<andreaferretti> @dom96 then it's just the path
11:15:40dom96couven92: I see lol
11:16:08couven92Normally I put the .gitignore and LICENSE in the Initial Commit
11:16:14FromGitter<andreaferretti> what I meant is
11:16:29couven92(in cases where those two need to be there, but do not really matter)
11:16:57FromGitter<andreaferretti> if I call my package `strutils` and it only consists of a file `strutils.nim`, I should be able of doing `import strutils/strutils`
11:17:18FromGitter<andreaferretti> this would distinguish it from the stdlib module
11:17:32FromGitter<andreaferretti> because the package name acts as namespace
11:17:42dom96andreaferretti: the only way to implement this would be to special case it in the compiler though
11:18:10FromGitter<andreaferretti> I know, that is why I was asking for the compiler to support a notion of namespace
11:18:24FromGitter<andreaferretti> which then would be the package name for nimble packages
11:19:18FromGitter<andreaferretti> an alternative that does not require changes in the compiler would be
11:19:19couven92dom96, you said you wanted to write your own Password manager, PMunch and I wanted to write a command-line integration for KeePass in Nim :)
11:19:39FromGitter<andreaferretti> for nimble to use the current directory structure
11:19:57*Ven` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:20:00*lesshaste joined #nim
11:20:11FromGitter<andreaferretti> but put in the path some directories named packagename, which are symlinks to packagename-$version
11:20:24FromGitter<andreaferretti> for the currently used version
11:21:03FromGitter<andreaferretti> (this breaks on windows and is probably unsafe to run two instances of nimble concurrently though)
11:21:55PMunchcouven92, that is actually partially done :)
11:22:17couven92PMunch, get dom96 to join! :P
11:22:40dom96KeePass corrupted my password DB once
11:22:49couven92oooh...
11:22:51dom96So i'll be staying away from it forever now :)
11:23:52*vlad1777d joined #nim
11:24:21PMunchOuch, that's not good
11:27:25lesshastehow does nim handle multiplication of complex numbers in terms of SIMD speedups?
11:28:00*lesshaste quit (Quit: Leaving)
11:28:38*lesshaste joined #nim
11:29:24dom96andreaferretti: yeah... so any other ideas? :)
11:29:54*r3d9u11 quit (Remote host closed the connection)
11:32:18couven92dom96, we saw that UNIX (or POSIX) has getpass for password, Windows has CredMan Win32 API functions to enter the password
11:32:31couven92create a password-terminal package? :O
11:32:42dom96Do it :P
11:32:45couven92:D
11:33:35*vlad1777d quit (Ping timeout: 240 seconds)
11:33:37couven92Though the Windows thingy is REALLY advanced... It will actually print the hostname and username questions on the command-line in your native locale
11:34:55*jackprob joined #nim
11:35:21couven92eating the chars for the password on the command-line is not a Linux thing, native Windows, also eats password chars!
11:36:13*MJCaley joined #nim
11:37:12dom96:o
11:37:15dom96But whyyy
11:37:16FromGitter<alehander42> o.O I didn't know that
11:37:57couven92because writing asterisks is a little unsafe, as it shows the length of your password in the cmd! :P
11:38:25dom96lol
11:38:35dom96Time to submit webkit/gecko bugs
11:38:40couven92(and yes every other GUI totally ignores that by printing password dots!)
11:40:35couven92dom96, you can totally have line-feeds in your password! You can even have emojis in your password (you can just not login if you do afterwards)
11:42:46dom96Hrm, I wonder if most websites just reject emojis and other unicode characters
11:44:48couven92at NDC London there was an Emoji talk, at the end of the talk the presenter said that you UNIX-password can contain any Unicode, but that the password input field on Mac and most linux fields don't allow you to enter any Unicode chars, meaning that you might not be able to enter your super-duper cool poop-emoji password! :P
11:46:51*MJCaley quit (Quit: MJCaley)
11:59:42GitDisc<Yardanico> 1231
11:59:49*GitDisc quit (Remote host closed the connection)
12:00:45*GitDisc joined #nim
12:02:20*Snircle joined #nim
12:06:00*yglukhov joined #nim
12:08:43*Yardanico is now known as Yardanico[m]
12:08:46*Yardanico_ joined #nim
12:11:53*Yardanico[m] left #nim ("User left")
12:14:04*dddddd joined #nim
12:14:07Araqwell?
12:14:38*Yardanico_ quit (Quit: Leaving)
12:14:49*Yardanico joined #nim
12:17:25dom96Araq: Let's flip this around. If you were starting Nim from scratch, how would you solve this problem?
12:17:36Araqbefore dreaming up rules with symlinks and re-inventing how to resolve versions, can we decide on a name?
12:18:23Araqdom96: I would require 'import jester / jester' or maybe 'import jester / _'
12:18:57dom96A name for what?
12:19:23*Yardanico quit (Client Quit)
12:19:50Araqfor "import from $nimblepath"
12:20:01Araqor some other way to solve the problem
12:20:03*Yardanico_ joined #nim
12:21:18dom96'import pkg/'?
12:21:30dom96We already have 'std', right? so it fits
12:22:59FromGitter<alehander42> @Araq j("\\\"") works, but j"\\\"" fails with " error, is that a known limitation of this syntax
12:23:34FromGitter<alehander42> `j("\\\"") works, but j"\\\""` (fixing paste)
12:23:39dom96alehander42: You escape " with a double "" in blah""
12:23:43dom96(raw string literal syntax)
12:23:48Araqj"" is a raw string literal, j("") is not
12:24:20Araqwe don't have suffix operators so 'import pkg/' doesn't parse
12:24:29FromGitter<alehander42> I see, ok
12:25:07Araqbesides, that does not fix the problem since 'import random/random' does not work due to its structure
12:25:09dom96Araq: huh?
12:25:17dom96We have 'import std/'
12:25:23Araqwe don't.
12:25:26dom96so let's have 'import pkg/random'
12:25:32Araqwe have import std / modulename
12:25:45dom96that's what I mean...
12:25:55Araqoh
12:25:56dom96What would 'import std/' even mean?
12:26:01FromGitter<alehander42> do we have import std/x :O
12:26:23Araqdunno, I thought you were proposing to import every file in 'std' with this syntax
12:26:29Araq;-)
12:26:31dom96lol why
12:26:39dom96That would be 'import std/*' ;)
12:26:42Araqok, so 'pkg' is a keyword
12:26:47Araq?
12:26:53dom96But anyway, I think my solution is good
12:27:03dom96depends what you mean by "keyword"?
12:27:07*Yardanico joined #nim
12:27:26Araqwell it's obviously not a directory, is it?
12:27:41dom96it's special-cased
12:27:54dom96It's not a keyword in the sense that you can't define a 'pkg' variable
12:27:59dom96(Same for 'std' right now, right?)
12:28:01Araqok, so special cased, yes
12:28:09*Yardanico__ joined #nim
12:28:12Araq(yes, same for 'std')
12:28:18dom96Yeah
12:28:21dom96Sounds good to me
12:28:49dom96How does 'std' work right now?
12:28:55dom96How is 'import std/sha1' handled?
12:28:57Araqcompiler voodoo.
12:29:02dom96Can I do 'import std/std/sha1'? :P
12:29:15Araqno.
12:29:32dom96why not?
12:29:33Araq(maybe if there is a bug, but not in principle)
12:29:40dom96okay
12:30:07dom96So before I go into arguing about "Sha1 shouldn't be in std/"
12:30:21dom96Are we happy with `import pkg/random` vs. `import std/random`?
12:30:51Araqstd is like "lookup, if fails, try lib/pure/ etc", but 'std' itself is NOT in the search path
12:31:11Araqso if some module is physically in std/ then the std/ directory is required
12:31:22dom96yes, makes sense
12:31:44dom96but what does "etc" mean here?
12:31:58Araqlib/impure, lib/wrappers
12:32:04*Ven`` joined #nim
12:32:11Araqand some others that the stdlib happens to use
12:32:16dom96I think you should introduce a '--pkgPath'
12:32:27dom96and --stdPath?
12:32:35AraqI don't want to, we have --libpath and --nimblePath
12:32:41*Yardanico__ left #nim (#nim)
12:32:51Araqor maybe it's just called --lib, don't remember, I never use it
12:33:01dom96The problem is that Nimble has to pass --path explicitly when building
12:33:03Araqbut it exists.
12:33:15dom96so that will then fail if somebody uses `import pkg/random`
12:33:22dom96since 'random' will be in the "path"
12:33:41Araqhmm not sure I'm following
12:33:57Araqwould std / random (enforced) help with that?
12:34:03dom96nimble build -> nim c --path:~/.nimble/pkgs/random-0.1.0/ mybin.nim
12:34:29dom96The compiler won't know whether that's part of the stdlib or Nimble
12:34:39dom96because AFAIK all stdlib modules are defined via --path
12:35:13dom96Not sure what --libpath does
12:35:24dom96But --nimblePath should then be built on top of this new --pkgPath
12:35:38dom96You'll need a separate list in the compiler anyway I think
12:35:47dom96so I don't see why creating this distinction will hurt
12:35:57dom96it follows from this 'std'/'pkg' feature
12:36:10AraqI wanted to introduce import $package / foo so that you can do: --find:package=over/here
12:36:29Araqbut you talked me out of $dollar because "too hard to teach"
12:36:34dom96yes
12:36:36dom96I did
12:36:54dom96because it doesn't work well with what he have currently
12:36:55Araqthen --path would not be a stupid list but specialized by package
12:37:02dom96*we
12:37:21dom96everybody would need to change their imports to use this $dollar thing
12:37:43dom96It's an overly-generalised feature, I don't see anyone else using this
12:37:48Araqtrue but it's a clear distinction between path imports and package imports
12:38:05Araqwell I don't see why 'std' and 'pkg' should be special
12:38:19dom96Yes, but I want the distinction only to be necessary for resolving conflicts
12:38:37dom96The current module system is good
12:38:43dom96and it works for 99% of cases
12:38:59dom96The remaining 1% need this `pkg`/`std` feature to disambiguate
12:39:57FromGitter<alehander42> why can't you import random from pkg vs import random from std ⏎ I think the keyword illustrates better the difference and reusing the namespace a / b syntax can be confusing (as they're not really namespaces)
12:40:50dom96That implies that 'pkg'/'std' are modules.
12:40:55Araqfrom strutils import toLowerAscii from std ?
12:41:34Araqcan't see that one working out well, regardless if 'std' is a real keyword or not
12:42:05Araqfrom std / strutils import toLowerAscii # makes more sense IMO
12:42:26dom96agreed
12:42:50FromGitter<alehander42> ok, what happens if you have a directory called 'std'
12:42:55FromGitter<alehander42> or called 'pkg'
12:43:07Araqyou really shouldn't and that's the end of the story. :-)
12:43:49Araqunless we come back to my $std proposal :P where we get these lovely dollars for "namespaces"
12:45:15dom96actually, that's a valid concern
12:46:08dom96There will undoubtedly be users who create 'std' or 'pkg' directories in their project
12:46:17Araqwe can name them 'stdlib' and 'stdpkg' and then people who name their directory 'stdlib' need to be punished
12:46:31dom96stdpkg? lol
12:46:46dom96or
12:47:05dom96we also have 'cwd'
12:47:06dom96or 'dir'
12:47:08dom96or 'local'
12:47:17dom96wait
12:47:17FromGitter<tim-st> Is there something like a macro or template that can add one `of` line to a given case and the of statement should be passed?
12:47:20dom96Don't we have '.'?
12:47:27dom96'import ./pkg/foo'
12:47:31dom96Problem solved?
12:47:39Araqtim-st: a template cannot do that, but a macro surely can
12:47:40FromGitter<andreaferretti> if I understand correctly, as things are now, one can explicitly choose to opt in the stdlib prefixing std to the import path, but not opt in nimble packages
12:47:52FromGitter<tim-st> @Araq thanks!
12:47:57FromGitter<andreaferretti> so it makes sense that nimble packages are searched first
12:48:05dom96andreaferretti: we are changing that
12:48:19dom96You will be able to explicitly ask for a Nimble package
12:48:35FromGitter<andreaferretti> I see, I was trying to figure the smallest change that would work
12:48:50Araqdom96: 'import "./pkg/foo" ' works but I really think people shouldn't use 'pkg' or whatever we end up using
12:49:04FromGitter<andreaferretti> if nimble packages have the priority, there should be no need to explicitly choose them
12:49:28dom96Araq: I agree. But if there is some unforseen reason that they must use this directory name, it's good that there is a workaround
12:49:42Araqok.
12:50:14*athenot_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:50:27Araqandreaferretti: problem is that nimble packages creep into my nimbledir and will break things
12:51:05Araqsay for illustration that I install a 'strutils' package which can be imported as 'import strutils' (just an example)
12:51:33Araqnow every Nim program doesn't compile anymore if nimble packages get preferred over the other stuff in my search path
12:52:22AraqI can patch my Nim code to say 'import std / strutils' everywhere
12:52:48Araqbut I don't want to. :-)
12:53:01FromGitter<narimiran> nimble package owners should make sure their libraries have unique name. end of story.
12:53:27*couven92 quit (Ping timeout: 240 seconds)
12:53:28Araq'random' used to be unique before we added it to the stdlib
12:53:35Araqsame for sha1.
12:53:44Araqand it will happen again, why wouldn't it?
12:53:49dom96yep
12:53:51dom96precisely
12:53:54FromGitter<narimiran> araq: i'll copy my comment from before:
12:53:58Araqwe cannot dream up of strange stdlib module names just to prevent clashes.
12:54:11FromGitter<narimiran> "and if some conflict arises currently because of additions to std lib - well, nim is still in pre-1.0 phase and this should be expected"
12:54:25FromGitter<narimiran> "and you and your package need to find another name"
12:54:36Araqwe want to be able to grow Nim past 1.0 is released
12:54:36dom96Nim won't be in a pre-1.0 phase forever
12:54:40*radagast_04 quit (Ping timeout: 240 seconds)
12:54:47FromGitter<narimiran> dom96 - prove that
12:54:53FromGitter<narimiran> :D
12:55:30Araqwell that's a good joke but nothing more.
12:55:46Araqeven if we never release 1.0 a working solution would be desirable.
12:55:52FromGitter<narimiran> agreed
12:56:58FromGitter<narimiran> imho, imports from stdlib should remain as they are, and be as simple as possible
12:58:13FromGitter<narimiran> imports from nimble should also be as simple as possible when there are no conflicts, and have some addition (details not yet known) when there are conflicts either with stdlib or another nimble package
12:59:53FromGitter<narimiran> and there is a possibility that "my code had worked in nim 1.1, but doesn't work in 1.2" because of same-name lib added to stdlib in v1.2 - and this code should be now corrected with more explicit import
13:00:52*BitPuffin joined #nim
13:01:24Araqyes and for this to work we need a way to disambiguate
13:01:25*r3d9u11 joined #nim
13:01:42Araqwhich we currently lack for nimble packages that do not use a "namespace"
13:02:20Araqor not, import "../package-1.1/foo" works I guess
13:02:36FromGitter<narimiran> first - is there a possibility for two nimble packages to have the same import?
13:03:05Araqnot sure, seems unlikely
13:03:23Araqbut it can clash with anything in your --path
13:03:29FromGitter<narimiran> thought so. then this makes the problem easier
13:03:42FromGitter<narimiran> damn
13:04:09FromGitter<narimiran> `nimble import random`?
13:04:31*couven92 joined #nim
13:04:50FromGitter<Vindaar> you could even nimble import -> nimport (only half joking here...)
13:05:08dom96Each Nimble package name has to be unique
13:06:31dom96I just remembered something though and I wonder how well it will interact with this disambiguation
13:06:56dom96It would be nice to scope Nimble packages
13:07:25FromGitter<andreaferretti> require each pckage author to use a the reverse of a url they own :-P
13:07:51FromGitter<andreaferretti> import com.apache.common.random :-D
13:08:02dom96npm does it like this: require('@myorg/mypackage')
13:08:32dom96import dom96/jester ? lol
13:09:27FromGitter<narimiran> @andreaferretti don't give them the ideas :D :D
13:09:31dom96I think it might be too late to enforce this
13:09:57*SenasOzys quit (Ping timeout: 264 seconds)
13:10:00Araqdom96: yglukhov argued against it before
13:10:12Araqtoo often does the "vendor" change for this to be viable
13:10:14dom96oh? What was his argument?
13:10:51GitDisc<ethanpmorgan>
13:10:51GitDisc<ethanpmorgan> https://cdn.discordapp.com/attachments/371759389889003532/416582680982061056/20180223_131037.png
13:10:53FromGitter<narimiran> if you have `uniqueName` package, you can import with either `import uniqueName` or `nimble import uniqueName` for the same effect
13:11:02GitDisc<ethanpmorgan> The deer is done. My first programming book
13:11:02dom96So rename and scope and an alias for the old name
13:11:19yglukhovhey guys whats up
13:11:19GitDisc<ethanpmorgan> The deed is done. My first programming book
13:11:22Araqwhat does "scope" mean here?
13:11:28dom96ethanpmorgan: yay :D
13:11:36FromGitter<narimiran> if you have `usedName` package, if you use `import usedName` it will import stdlib version. you need to import it with `nimble import usedName`
13:11:50dom96Araq: The username in "import dom96/jester"
13:12:02Araqok so what I called "vendor"
13:12:16dom96vendoring is a different package manager concept
13:12:17GitDisc<ethanpmorgan> College has us doing VB.net I'll let Nim help fix my insanity
13:12:23dom96so "scope" is a better name
13:12:37Araqit really isn't. but "username" is ;-)
13:12:55Araq"scope" already has a different meaning in a PL context.
13:12:56dom96narimiran: no clue what you mean
13:13:17Araqhe is proposing a new syntax, a 'nimble import' statement
13:13:24Araqcrazy talk. ;-)
13:13:32FromGitter<narimiran> @dom96 that's my proposal for this import confusion
13:13:59dom96righttttt
13:14:26Araqmaybe we should allow URL imports and let people deal with the mess
13:14:46FromGitter<narimiran> what if there is a great package from user `fuckthisshit`? i wouldn't want to see that in my code
13:15:01dom96Araq: We're not savages
13:15:24Araqthen we only need a way to do string interpolation like import "$foo" so that $foo can become https://etcetc
13:15:38dom96narimiran: why not? Brainfuck is a thing :P
13:15:50dom96Hrm... could I create a poop emoji Nimble package?
13:16:00dom96I bet I could
13:16:07Araqyeah, what if the module name is 'fuckthisshit'?
13:16:14FromGitter<narimiran> tru dat
13:16:17Araqyou fork and rename? there you go.
13:16:33Araqbut real packages have real names, in general.
13:16:41livcdwhat if the code contains master/slave and all the SJWs get mad. 1st world problems.
13:16:49AraqLOL
13:16:53couven92naming is hard!
13:17:34couven92unfortunenately still one of the great unsolved problems... :P
13:17:54livcdkill me but i like go get :PPP
13:18:03FromGitter<narimiran> ok, @Araq, so you think `nimble install` is not a good/simple way to deal with this?
13:18:08dom96livcd: :'(
13:18:29Araqnarimiran: you mean 'nimble import'?
13:19:03FromGitter<narimiran> yeah, sorry
13:19:08dom96what would that even do?
13:19:32*SenasOzys joined #nim
13:19:52Araqwe don't need more keywords and the split between stdlib and nimble packages is questionable design to begin with IMO.
13:20:06FromGitter<narimiran> @dom96 `nimble import pkgname` would make sure you're importing nimble package, and not the stdlib one
13:20:29AraqI would like to have a solution that does more than just stdlib vs nimble package
13:20:47Araqbut oh well, probably too late for that
13:22:20livcdI would prefer simple instead of smart
13:22:51FromGitter<narimiran> ok, you two (araq and dom) have mentioned you are afraid of post-1.0 time when something would be a nice addition to stdlib, and there is a nimble package of the same name - how often do you think something like that would happen?
13:23:08Araqagain, it already happened twice.
13:23:23FromGitter<narimiran> nim is not in post-1.0 phase yet ;)
13:23:25Araqand in general stdlib names want to be "standard"
13:23:37dom96what it should have been from the beginning is 'std/' prefix for all stdlib packages
13:23:40dom96but it's too late forthat
13:24:12FromGitter<narimiran> @dom96 would that mean `import std/strutils, std/sequtils, std/math`?
13:24:17Araqhttp, url, uri, cgi, every protocol name makes a good "stdlib" name
13:24:30dom96narimiran: yes
13:24:38Araqor
13:24:44FromGitter<narimiran> let me find some vomiting smiley....
13:24:50Araqimport std / [strutils, sequtils, math]
13:24:51dom96although 'import std/[strutils, sequtils, math]` would be possible
13:25:09dom96optional 'std' is a good compromise IMO
13:25:26FromGitter<narimiran> `import std: strutils, sequtils, math` to look more nim-like?
13:25:35dom96So let's get it in there and move on
13:25:43Araqyup.
13:25:55Araqok, so we add 'pkg' too and call it a day
13:25:57Araq?
13:26:15FromGitter<krux02> I just joined.
13:26:20FromGitter<krux02> you want to add pkg to what?
13:26:33dom96yes
13:26:43Araqas the second pseudo directory, krux02
13:27:07FromGitter<krux02> the second?
13:27:15dom96Araq: But also --pkgPath (and possibly --stdPath)
13:27:19Araqthe first one is 'std'
13:27:23Araqargh
13:27:34FromGitter<krux02> I know in linux there are a lot of folders with the suffix `.d` for directory
13:27:42Araq--pgkPath and --stdPath, why?
13:27:51dom96I already explained why :(
13:28:01Araqyeah I know
13:28:03Araqbut I mean
13:28:11Araq"can't we do without?"
13:28:13FromGitter<narimiran> @Araq can you show us the example of the proposed import of stdlib package and nimble package?
13:28:24dom96no, we can't. Nimble needs a way to tell the compiler which is which
13:28:32FromGitter<narimiran> or even better - multiple packages
13:28:38dom96unless you have a better idea
13:28:52dom96narimiran: import pkg/random vs. import std/random
13:29:34Araqdom96: how does it even fix the problem? say I have 'import random' in my program.
13:29:54Araqthen nobody knows if it's std/random or pkg/random
13:30:13dom96'import random' will behave as it does now, search through the stdlib paths and then the nimble paths
13:30:23dom96This is about 'import pkg/random'
13:30:29FromGitter<krux02> whell the compiler could complain and say it's not unique
13:30:41dom96If Nimble specifies --path:~/.nimble/pkgs/random-0.1.0/ then you'll get an error
13:30:48FromGitter<narimiran> if there is 'pkg' prefix, then `import random` should be only the stdlib one
13:30:49Araqwhy?
13:31:01FromGitter<narimiran> so there is no confusio
13:31:20dom96Araq: Because `import pkg/random` will search through the nimble paths
13:31:26dom96And only those
13:31:38FromGitter<narimiran> imports without prefix = always stdlib package, nothing else
13:31:48Araqoh I see your point. hm.
13:31:58livcdI would just force people to pick a different name than awesomepkg: random
13:32:00FromGitter<andreaferretti> @narimiran that shi has sailed
13:32:07FromGitter<krux02> well I see this as, when you use `import strutils` without the pkg prefix then installing a package called strutils could break coda that already works.
13:32:17FromGitter<andreaferretti> there is already a lot of code using import without prefix for nimble stuff
13:32:18FromGitter<krux02> well, not if you build with nimble
13:32:22FromGitter<krux02> I see
13:32:45FromGitter<narimiran> once again - nim is pre-1.0, everybody should expect breaking changes!
13:33:07FromGitter<andreaferretti> not a breaking change that breaks half of the existing ecosystem without a second thought
13:33:07FromGitter<narimiran> we all knew what we "signed for"
13:33:13Araqwe don't break every Nim program out there without a deprecation path, that's crazy talk.
13:33:20FromGitter<narimiran> ok ok :)
13:33:40Araqbtw we also must be able to bootstrap ;-)
13:34:03FromGitter<krux02> well, but I think that at some point things that are deprecated should be removed when they are deprecated for a long time, just to clean up the code.
13:34:28FromGitter<krux02> make it ten years or something, but give it a date when something can be removed
13:34:42dom96Araq: Only problem with my idea to use --pkgPath is that Nimble will stop working with older Nim compilers
13:35:11Araqdom96: it can query the compiler's version if we really care that much about it
13:35:18dom96true
13:36:00Araqok, so --pkgPath is actually what I thought of, it's not a list of options, but a concrete mapping from package name to its location?
13:36:50FromGitter<andreaferretti> does nimble currently pass the path of the stdlib using --path?
13:36:54dom96Araq: no, there is no mapping
13:37:03Araqbut there should.
13:37:04dom96Araq: It's just a single path
13:37:07dom96Why?
13:37:20dom96andreaferretti: no
13:37:25Araqbecause it's cleaner.
13:37:38Araqnimble tells the compiler how to resolve pkg/foo
13:37:40dom96Araq: what use is the package name?
13:37:56FromGitter<andreaferretti> @dom96 then why cannot --path be used where you think to use --pkgPath?
13:38:10dom96andreaferretti: because that will become "--stdPath"
13:38:31dom96andreaferretti: Nimble needs a way to distinguish
13:38:35FromGitter<andreaferretti> The compiler already knows where the stdlib lives, right?
13:38:40FromGitter<andreaferretti> It's not nimble telling
13:38:41FromGitter<krux02> I just realized I failed at contributing to the conversation :P just ignore me I am procrastinating
13:38:45*Arrrr quit (Ping timeout: 265 seconds)
13:38:51dom96andreaferretti: yes, but that's defined in Nim's config file... using --path
13:39:01FromGitter<andreaferretti> uh I see
13:39:06Araqactually, it's --lib
13:39:28FromGitter<andreaferretti> great, then there is no need to introduce two new names
13:39:35FromGitter<andreaferretti> --lib -> --stdPath
13:39:41FromGitter<andreaferretti> --path -> --pgkPath
13:39:43Araqwhich gives the location of system.nim. probably a bad thing to have both
13:39:48dom96https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L34 ?
13:39:52dom96looks like --path to me
13:39:52FromGitter<andreaferretti> --lib and --path are good enough
13:40:02Araqespecially since I'm not sure what --lib does...
13:40:26Araqfeature creep.
13:41:00dom96why do you want a mapping?
13:41:30Araqto not further hardcode this nimble vs stdlib distinction
13:41:45Araqthe stdlib should be a package like others
13:41:57Araqunrealistic at this point, I know, but still.
13:42:15dom96pkg and std will be hard coded
13:42:18dom96there is no avoiding it
13:42:47dom96--pkgPath/--stdPath (or whatever you want to call these, this isn't all that important right now) is the natural way to implement this
13:43:34dom96Unless you're thinking --map:pkg:path1 --map:pkg:path2
13:43:52dom96to allow more than just 'pkg' and 'std'
13:43:53Araqthat is what I have in mind.
13:44:11dom96that's far more disruptive
13:44:43dom96We can make `--path` mean `--pkgPath` (add an alias so that it can be renamed in time)
13:44:55dom96and change the Nim config to use --lib for --stdPath
13:45:12dom96(and also create an alias for --lib, or just rename it since no outside tools use it)
13:45:16AraqI don't fully understand the difference between --path and --pkgPath
13:45:32dom96--path:foo -> --map:std:foo
13:45:40dom96--pkgPath:foo -> --map:pkg:foo
13:45:56FromGitter<andreaferretti> this would break everything
13:45:56dom96(--path = --stdPath in this case)
13:46:20FromGitter<andreaferretti> there are already projects using path, generally for things not in the stdlib
13:46:40dom96But perhaps you're wondering what the difference between --path and --pkgPath is as --path is currently implemented
13:46:44Araqyeah, my projects use it too
13:46:55Araqdom96: yes.
13:46:58Araqthat too.
13:47:21dom96--path is used by ``import random``
13:47:25dom96to find 'random'
13:47:41Araqyeah ok
13:47:50Araqthe other thing is more of a rewrite rule
13:48:08dom96In our new implementation `import random` will use the list of --stdPath followed by --pkgPath
13:48:11Araqrewrite pkg/random to bla-1.0/random
13:48:17dom96`import std/random` will only use --stdPath
13:48:22dom96`import pkg/random` will only use --pkgPath
13:48:33*athenot joined #nim
13:48:41dom96no
13:48:49dom96You don't need to worry about that
13:49:00dom96That is taken care of by --nimblePath
13:50:23Araqunless overriden by --pkgPath, yes
13:50:44dom96--nimblePath:~/.nimble/pkgs iterates through each directory in ~/.nimble/pkgs, for each package name it finds the latest version and adds it using --path (right now, but in the future it will use --pkgPath)
13:51:05dom96--pkgPath doesn't override anything
13:51:12dom96it just adds a new path to the list of paths
13:51:18dom96the same thing that --nimblePath does
13:51:39Araqyou lost me.
13:51:56Araqso you mean
13:52:07Araq--pkgPath does work with --noNimblePath?
13:52:17Araqto resolve the issue?
13:52:38dom96I think so. Not 100% sure what you mean.
13:52:47Araqok
13:52:49dom96--noNimblePath instructs the compiler to ignore --nimblePath
13:53:14dom96(needed because the Nim config file contains these --nimblePath flags)
13:53:47dom96Is everything clear?
13:53:53Araqyes
13:54:02dom96great
13:54:06AraqI don't like it, but now it is clear
13:54:40dom96why not?
13:57:06Araqbecause it's too obviously a patch.
13:57:28FromGitter<andreaferretti> what about
13:57:44FromGitter<andreaferretti> instruct the compiler to look into --path for import pkg/foo
13:57:57FromGitter<andreaferretti> change the compiler to use --lib instead ofp--path
13:58:09FromGitter<andreaferretti> that's it
13:58:25FromGitter<andreaferretti> --path stays exactly as it is today
13:58:38FromGitter<andreaferretti> nimble stays exactly as it is today
13:58:57dom96Araq: Not if it's named --pkgPath and --stdPath :)
13:59:04FromGitter<andreaferretti> the only thing to change is the logic for the imports in the compiler
13:59:04FromGitter<andreaferretti> to prefer --lib over --path
13:59:20dom96andreaferretti: that's exactly what I suggested above...
13:59:48FromGitter<tim-st> If someone has edit rights to an example section of nim macros, please add an good and easy example for beginners like this one I made:
13:59:49FromGitter<tim-st> macro echoX*(): typed = result = "echo x".parseStmt() ⏎ var x = 1 ⏎ echoX()
14:02:19Araqtim-st: that's wrong.
14:02:31Araqit should use 'quote do' or template+getAst
14:02:36Araqor the API construction.
14:03:02Araqstring based AST manipulations are a last resort when everything else fails
14:03:37FromGitter<tim-st> I assumed this, but it's very easy to use^^
14:04:19Araqit's only easy when you don't do anything whatsoever with the string
14:04:58FromGitter<tim-st> For my case thing that's working
14:05:11Araqdom96: I think andreaferretti has the right idea here
14:05:21Araqtim-st: for your case a 'template' would do too.
14:05:42FromGitter<tim-st> ok, will have a look, thanks
14:06:43Araqthe point is "if 'pkg' is a special case, we can make --path work with it too"
14:07:13Araqso --path:foo would effect 'std/foo'
14:07:26Araqer no
14:07:31AraqI mean 'pkg/foo'
14:08:51dom96I'm pretty sure that's precisely what I suggested above.
14:09:00dom96--path means --pkgPath
14:09:07dom96--lib means --stdPath
14:09:23Araqwell my proposal leaves out the --lib part :P
14:09:48dom96so how do you specify stdlib paths to Nim?
14:10:08Araqyou don't. Nim knows where the stdlib is
14:10:12Araqwell
14:10:25Araqdepending on how you look at it, it stays the same. the config sets --lib
14:10:35Araqbut Nimble doesn't.
14:10:49Araqbut I guess this is what you meant
14:11:00Araqand you only requested the rename for consistency.
14:11:33Araq--path is ambiguous then, influencing where to find nimble packages as well as being the general search path
14:11:36dom96yep
14:12:14dom96I don't really see a reason to argue over this
14:12:21dom96This is just a couple of extra flags and sequences in the compiler
14:12:36Araqit's already complex
14:12:39Araqand had bugs.
14:13:00Araqand it's misdesigned, I don't like --path nor --nimblePath
14:13:16dom96I love it
14:13:31Araqso asking me to add --pkgPath or changing how --path works
14:14:01Araqdoes not make me happy.
14:15:12AraqI like my import $variable / [stuff] idea. you specify what $variable resolves to elsewhere. problem solved.
14:16:13Araqand both --nimblePath and --path become unnecessary.
14:17:06dom96Please let's just get this pkg/std distinction
14:19:06Araqthat's more work to implement and less flexible :-(
14:19:46Araqit's also as hard to learn as $variable, IMO.
14:20:21dom96$variable is too flexible
14:20:33dom96there is no need for this to be in the user's face
14:20:52dom96I don't understand how that can possibly be less work
14:21:15AraqI wrote the code for it and disabled it recently.
14:21:39Araqso ok, maybe that's unfair.
14:21:51Araqanyway, I like it much more.
14:22:26dom96and how do you define what $variable means?
14:22:34Araqif Nimble supports / enforces user names one day, Nim doesn't have to change, it was $jester all along
14:23:25dom96so your solution is to break all existing package imports?
14:23:30Araqvia the config or command line, --var:jester=$nimble/jester
14:23:56Araqno, I don't break anything, I only add a feature
14:23:57dom96so I install jester using Nimble
14:24:09dom96I can't use the global installation anymore unless I specify --var:jester=...
14:24:44dom96I also personally dislike this `$` thing
14:24:51Araqyes.
14:25:59dom96So you're breaking an established workflow
14:26:48dom96This is a much more disruptive change and I don't envision many use cases for its flexibility
14:27:23Araqthis whole problem is a problem of "Don't repeat yourself", I don't want to write 'import ../nimble/pkgs/jester-1.0/jester' because it's tedious and the relative addressing super fragile
14:27:55Araqso instead I want $nimble/jester or even short just 'jester'
14:28:01Araq*shorter
14:28:20Araqbut it's too ambiguous so I propose $jester
14:29:23Araqwhich cannot be confused with a real path/filename
14:29:46dom96if you want we can ask the community what they think
14:32:32Araqwell we're having this discussion in #nim
14:32:44Araqwe had an RFC already
14:32:50Araqwith plenty of opinions
14:32:56Araqand no real solution afaict
14:33:29AraqI thought my recent 'std' addition would be good enough but it's not and now I don't want to add even more patches on top of it
14:34:51FromGitter<data-man> @Araq: Can I to use --var:std=mySuperCoolStd?
14:35:08Araqdata-man: in my proposal, yes.
14:35:18dom96If you implement this then that will be the end of it
14:35:35dom96I will double check your commit to make sure you've done it right :P
14:35:45Araqthat would be ok if I was happy with --path and --nimblePath, but I'm not.
14:36:06Araqand Nimble is getting "multiple packages per git repo"
14:36:17Araqand maybe later "username support" in some form
14:36:32FromGitter<alehander42> hey, I have a global level var and nim js compiles a for label, value in <var>: to `for(.. in var_variable)` which is a weirdly obvious bug
14:36:34Araqso I don't think you can promise me it won't grow again.
14:36:43FromGitter<alehander42> does anybody remember such a bug
14:37:05Araqalehander42: nope. report it please
14:37:24dom96Araq: multiple packages per git repo won't be a problem
14:37:53dom96they'll just be installed separately
14:38:04dom96usernames may never happen
14:38:14dom96by the time they do 1.0 will be out
14:39:49FromGitter<data-man> I like --var:
14:41:08dom96data-man: why?
14:41:42FromGitter<data-man> E.g. for NewStd with new runtime.
14:45:07Araqdom96: what if we use --var without the $ as a general mechanism to override --path?
14:45:40Araqthen Nimble can use --var:pkg/foo=path/foo-1.0/foo
14:46:17FromGitter<andreaferretti> wouldn't this break existing imports anyway?
14:46:40FromGitter<andreaferretti> or do you plan for this to also support just import foo when it is not ambiguous
14:47:28dom96Araq: That's better, but --nimblePath will also need to introduce the same mappings
14:48:17dom96I fear it's too much power though
14:48:45Araqusername support is really important though and it's covered by it
14:49:07Araqjust saying "nimble will never support usernames" doesn't seem wise.
14:49:25dom96I can achieve the same thing by getting Nimble to place the packages inside a username/ directory...
14:50:10FromGitter<data-man> And this will simplify the development of new functions in the stdlib. Or comparing performance with existing functions. Without using the git.
14:51:49FromGitter<krux02> Araq: I give up on the modulo discussion. `div` on integers should round towards 0 because that is the behaviour in assembler and in C and many other languages. I don't like it, but I can accept it. Same way should `mod` be the pair of `div` meaning (x div y) * y + (x mod y) should be zero
14:52:14FromGitter<krux02> and mod on floats should change it's behaviour to be the same as fmod in c++
14:52:34*sz0 joined #nim
14:52:42Araqdata-man: that's already possible via a Nimscript config
14:53:00Araqkrux02: what caused this change of mind?
14:54:22FromGitter<krux02> But I think a function `proc divmod(a,b: int): [a,b: int]` should exists, because both division and modulo division is calculated with the same asm instruction just with the result in a different register and integer division is the slowest math instruction even slower than floating point division.
14:55:07Araqdom96: what do you mean? "--nimblePath will also need to introduce the same mappings"?
14:55:25Araqkrux02: agreed.
14:55:38FromGitter<krux02> Well I think it's important to be consistent and stick to standards. Certain things are just fighting agains windmills.
14:55:43dom96Araq: I mean it will also need to implicitly specify --var:pkg/foo=... for each package
14:56:01dom96otherwise I won't be able to write 'import pkg/random' and compile via Nim
14:56:36Araqthat's conceptually what --nimblePath does, it's just that the implementation is different?
14:56:38FromGitter<krux02> It's like the guys who wants decimal floating point numbers because he things the float type is bad.
14:56:55AraqI prefer fractions fwiw
14:56:57FromGitter<krux02> Yes float is not perfect, but everything is float. Arguing against it is pointless.
14:57:15Araqand saturated arithmetic :-)
14:57:47FromGitter<krux02> And now I called `mod` from c++ glm `modulo` in nim-glm.
14:57:54dom96Araq: I'm just mentioning that you will still need --nimblePath
14:58:04dom96and that it will need to work with this new --var thing
14:58:14Araqyes, and add 'pkg' as a special name
14:58:14dom96I still prefer --stdPath/--pkgPath
14:58:15FromGitter<krux02> that modulo function has the behavior I want,
15:01:25Araqdom96: ok, but I am happy with the compromise.
15:01:41FromGitter<krux02> I solved the conflict by just choosing a different name.
15:02:25dom96Araq: I'm not :/
15:02:25FromGitter<krux02> Araq: should I make a pull request with the change to `mod` on float behavior?
15:02:56Araqkrux02 was it wrong?
15:03:05Araqiirc is uses 'fmod' already
15:03:10Araq*it
15:03:36FromGitter<krux02> when it does use fmod, then it is good.
15:03:51dom96I feel like we already agreed on --stdPath/--pkgPath
15:04:01dom96and you keep pushing this --var stuff
15:04:03FromGitter<alehander42> @Araq https://github.com/nim-lang/Nim/issues/7249 that's the js problem, I can try to fix it quickly but I am not sure if the problem is in for generation or in what's assigned to a
15:04:35FromGitter<data-man> @krux02: Maybe this library will be useful for you http://www.jhauser.us/arithmetic/SoftFloat.html ⏎ zig language used it.
15:05:26Araqdom96: "I fear it's too much power though" it not a convincing argument for Nim
15:06:17Araqand all that --pkgPath does is to hardcode this pkg/ prefix
15:06:21dom96the fact is that it won't be obvious where this strange random special cased paths are coming from
15:06:38dom96'pkg' and 'std' is already bad enough
15:06:49dom96and you want to encourage people to add their own weird names
15:07:00dom96with nothing to distinguish them from normal paths
15:07:02dom96it's a bad idea
15:07:30Araqbut $foo is ugly, you can't have it both ways
15:08:08dom96I don't want it at all
15:08:49Araqyou are also overly concerned with a niche case, namely 'nimble install jester' and then writing in some nim file 'import jester' (not even 'import jester / _')
15:09:05Araqwithout any configuration change
15:09:05*Ven`` quit (Ping timeout: 240 seconds)
15:09:19FromGitter<andreaferretti> is it a niche case?
15:09:28AraqI always have a configuration file anyway.
15:09:30FromGitter<andreaferretti> I think most nim projects are written this way
15:09:33dom96that's literally what everyone does
15:10:05Araqwell I don't.
15:10:29dom96You mostly work on a project that doesn't use Nimble
15:10:34FromGitter<krux02> Araq: nope mod does not use fmod: http://ix.io/Oft/nim
15:10:54*Jesin joined #nim
15:11:21AraqI work on quite some projects.
15:11:31Araqnone that lacks a configuration file.
15:11:55*Ven`` joined #nim
15:12:05*pwntus_ is now known as pwntus
15:12:06FromGitter<andreaferretti> by a configuration file do you also mean a nimble file
15:12:07FromGitter<andreaferretti> ?
15:12:18*pwntus quit (Changing host)
15:12:18*pwntus joined #nim
15:12:21FromGitter<andreaferretti> because all my projects have nimble files, none of them has a .cfg file
15:12:27Araqa .nims or a .nim.cfg file
15:12:41FromGitter<andreaferretti> i don't have any of those
15:12:50FromGitter<andreaferretti> i have a nimscript file called foo.nimble
15:12:52Araqok but you do have a .nimble file, so there :P
15:12:58FromGitter<andreaferretti> ah ok
15:13:00FromGitter<andreaferretti> that's good
15:15:14dom96Araq: ugh, why are you now arguing for the removal of --nimblePath?
15:15:28AraqI am not
15:15:32dom96You are
15:15:56Araqno, I want something like --var instead of --pkgPath because it's more flexible
15:16:15dom96I don't understand your latest argument then
15:16:27dom96But I'm still unconvinced
15:16:49dom96--pkgPath/--stdPath is the more strict implementation
15:16:56dom96if we want we can always make it more flexible in the future
15:17:02dom96we can't go the other way around
15:17:42Araqwell I disagree. all we can do with the inflexible solution is to add more features
15:18:00AraqI want one "too powerful" feature and be done with it
15:18:30Araqand that is exactly what did happen in the past.
15:18:35Araqwe had --path
15:18:35dom96That's my point, you want to create this flexible feature because of some imaginary problem in the future
15:18:40Araqthen we needed --nimblePath
15:18:45Araqthen --noNimblePath
15:18:49Araqand now --pkgPath
15:19:09Araqcome on, at least my solution makes the old shit redundant in theory
15:19:20dom96it doesn't
15:20:08dom96by your logic it all is redundant, I mean how hard is it to open the configuration file and add --path:~/.nimble/pkgs/random-0.1.0 in there anyway?
15:20:34dom96the idea is to give tools the necesssary hooks to make it easy on the user
15:20:51dom96not to give the user more tools to make things less obvious
15:21:21Araqthe original problem was that I am unable to say import pkg / random
15:21:32AraqI fail to see how a config file change deals with that
15:22:14Araqbut ok, if I use the fact that --path is an ordered search
15:22:22Araqthen it might work out indeed.
15:22:28Araqwith 'import random'
15:22:32dom96Well, I was referring to your "old shit" comment
15:22:40dom96which I interpreted as referring to --nimblePath
15:22:56Araqno, it also refers to --path
15:24:29Araqmaybe even moreso to --path. it's already subtle to see where things are coming from since the path is ordered and this order is used to prioritize the search
15:25:44AraqI fail to see how an explicit mapping makes things worse
15:27:07dom96because --path is already established
15:27:43Araqestablished but requires --pkgPath. --var is a single feature that covers both.
15:32:21Araqbut how about this: we don't add 'pkg', import random means "import from stdlib", import jester means "import from nimble package" and the random nimble package is fixed
15:32:56dom96no, we will need a way to disambiguate between packages
15:33:04dom96I have always wanted this
15:33:10dom96I thought you were going to implement it this way
15:33:11Araqand in the future "no namespace nimble packages" are inspected to use sane names
15:33:18dom96but you implemented this weird $thing, then rolled it back
15:33:31dom96added 'std', called it a day and now you're complaining that you have to implement another thing
15:33:49Araqwell the person who does the work is allowed to complain about the work
15:33:57dom96true
15:34:08dom96And fair enough
15:35:02FromGitter<GULPF> about the mod/div discussion - I already have a PR for changing `mod` for floats to use fmod
15:35:08Araqlet's face it. 'import random' for a nimble package never was a good idea
15:35:10FromGitter<GULPF> https://github.com/nim-lang/Nim/pull/7118
15:35:38dom96So does that mean you'll remove 'std'?
15:35:48Araqwhen the established meaning of 'import foo' was local import or stdlib import.
15:36:00Araq(already ambiguous btw)
15:36:05FromGitter<krux02> Araq: how do I set a fucntion to just emit some code for the target language?
15:36:30dom96import pkg/random, std/random, ./random # is the perfect tri-fecta IMO
15:36:32FromGitter<krux02> @gulpf: ah yes sorry for that
15:37:53dom96We already have 'std'
15:38:02dom96and we should have had 'pkg'
15:38:35dom96And there should have been a way to tell the compiler "This is a 'std' path" and "this is a non-std path"
15:38:44Araqimport dir/random # kaboom
15:38:56dom96?
15:38:58Araq'std' and 'pkg' are introduced as pseudo directories
15:39:11Araqit's not a perfect tri-fecta
15:39:21Araqit leaves out an important case.
15:39:29dom96which is?
15:39:38Araqimport someOtherSubDir / random
15:39:55dom96wut
15:40:00dom96why wouldn't that work?
15:40:19Araqit would but it proves it's not all that natural
15:40:46dom96well, yeah... 'std' and 'pkg' are special-cases
15:40:48dom96'.' isn't
15:40:52AraqI like the "stlib is just another package" much more conceptually.
15:41:19Araqand then 'std' and 'pkg' is a weird beast.
15:41:24dom96okay, I was happy with that
15:41:28dom96and then you said "no" in that issue
15:41:57dom96But that would still leave us hanging on the 'pkg' disambiguation front
15:42:39dom96Hrm
15:42:41Araqthe pkg disambiguation is solved by --var
15:42:55Araq--var:jester=dom96/jester
15:42:56Araqvs
15:43:00Araq--var:jester=araq/jester
15:44:09dom96that's a very obtuse way to solve it
15:44:15Araqor --var:jester=$nimble/araq/jester
15:44:35Araqdepending on how Nimble's solution looks like.
15:45:34Araqkrux02: proc foo() = {.emit: """code here""".}
15:45:47Araqbut I think I misunderstand your question, krux02
15:47:58dom96I'd prefer to disambiguate in the code rather than via some flag
15:48:15Araqbut then you're back at the original problem
15:48:20*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:48:20Araqviolating DRY.
15:48:42Araq(which might be acceptable)
15:48:58Araqthere is not a single point where you import dom/jester
15:49:02dom96also, what if I want to import std/random in one module, but pkg/random in another?
15:49:41*athenot joined #nim
15:50:00Araqyou want to be able to say "my project imports jester. today it's dom's jester. tomorrow it's krux02's fork of it. then it's dom's again"
15:51:03dom96In fact
15:51:05dom96this cannot work
15:51:11dom96I'll tell you why
15:51:32dom96What if Jester (or some other package) wants 'pkg/random' but my program wants std/random?
15:51:38dom96That is sure to happen
15:51:49dom96library packages cannot have configuration files
15:52:00Araqthen it's not pkg/random, but random/random
15:52:11Araqthat Jester imports
15:52:20dom96?
15:52:34dom96What does 'random/random' mean?
15:52:45Araqwell as I said
15:52:57Araqimport random to mean "import nimble's random"
15:53:02Araqwas a bad idea to begin with.
15:53:33Araqand no patch really works for it.
15:54:08dom96I feel like you're missing the point
15:54:14dom96This disambiguation needs to happen in the code
15:54:21dom96Otherwise libraries cannot disambiguate
15:54:52dom96You can't have `import random` mean two different things in two different modules
15:55:05Araqnever argued otherwise
15:55:12AraqI am aware of this point.
15:55:54Araqbut the Nimble package lists its dependencies
15:55:57*floppydh quit (Quit: WeeChat 2.0.1)
15:55:58FromGitter<krux02> Araq: thanks, it is solved. I think I was looking for importcpp "# % #". Gulpf already did that for `mod`.
15:56:26Araqand so 'import pkg / random' would usually work since the Nimble file contains the dependency to the random package
15:56:50Araqand the random package is unique, nimble enforces it.
15:57:00FromGitter<krux02> Gulpf: can you add an entry to the changelog.md in your pull request?
15:57:18dom96You keep forgetting that some users compile via nim
15:57:32dom96and that Nimble doesn't get rid of the stdlib 'random' from the path
15:57:37Araqno, I am not.
15:57:55Araqimport pkg / random fails if there is no random nimble package.
15:58:17Araqwell
15:58:22*solitudesf joined #nim
15:58:25Araqwhat are you arguing about?
15:58:28Araqimport random
15:58:29Araqor
15:58:36Araqimport pkg / random ?
15:59:08dom96You seem to be proposing that users will disambiguate by writing `import random` and --var:random=~/.nimble/...
15:59:30dom96right?
15:59:48dom96or are we back to the 'pkg'/'std' implemented via --var idea?
15:59:53Araqkind of, but no, I mean
16:00:11Araqyes, that would work but only as a workaround and not in a nimble package
16:00:39Araqusually you would resolve a package name, not a module name
16:00:47Araqvia --var
16:01:09dom96You'd need this 'pkg'/'std' to be convention
16:01:19dom96so flexibility offered by --var is pointless
16:01:30Araqyou can use it to make 'import random' mean 'import .nimble/.../random.nim'
16:01:42dom96but why would I?
16:01:48Araqbut it's a bad idea because it should mean "import from stdlib"
16:01:54dom96yes
16:01:56dom96exactly
16:02:01Araqwhy would you? to make code compile quickly.
16:02:13Araqwhen you can't be bothered to fix it properly :P
16:02:27Araq(maybe random was recently added to the stdlib)
16:02:37dom96so you change it to 'pkg/random'
16:02:42dom96it's not hard to search and replace
16:02:46Araqthe flexibility offered
16:02:49dom96and it's the correct fix
16:02:56Araqis mostly for username support.
16:03:13AraqIMO.
16:03:29dom96Like I said, it's not necessary
16:03:38dom96username support can be handled by Nimble
16:04:11dom96and we don't know if we truly want it yet
16:04:29PMunchUsername support?
16:04:50dom96scoped packages
16:05:15Araqok, how about this. we keep 'std' because it allows to say
16:05:30Araq"import from stdlib, not my local random.nim file"
16:05:41Araqand leave the rest as it is now?
16:05:46*Ven`` quit (Read error: No route to host)
16:05:50Araqand fix the random nimble package
16:05:55dom96No
16:05:58*Ven`` joined #nim
16:06:02Araqwhat problems would it cause?
16:06:04dom96You've already suggested this and I said 'no'
16:06:16dom96You yourself said that we will run into this problem in the future
16:06:35Araqhmm
16:06:45Araqwell
16:06:48PMunchMabye put up an RFC on GitHub? You've been discussing this all day :P
16:06:49Araqno.
16:07:07dom96lol
16:07:15dom96and RFC will take months
16:07:15Araqwe won't run into this problem if Nimble gets stricter about "packages without namespace"
16:07:29Araqto which you never really replied.
16:07:39dom96But I don't want to write `import jester/jester` :P
16:07:39FromGitter<krux02> the easier it is to just use someone's code. The better it is.
16:08:29Araqyeah, ok. I'm not gonna add more features just because 'import jester / jester' looks a bit ugly
16:08:48Araqespecially since the features are not wanted anyway.
16:09:14AraqIMO import jester / _ could be added to deal with that
16:09:25Araqbut you don't like that either anyway, so why bother.
16:09:29dom96lol
16:09:38dom96another feature to make it slightly better but still ugly
16:09:54dom96when a package vs stdlib path distinction makes sense anyway
16:10:09dom96I am still wondering how 'std' works currently
16:10:10FromGitter<krux02> dom96 whas do you really want or need.
16:10:24FromGitter<krux02> you two are arguing for quite a while now and it doesn't seem to settle.
16:10:27dom96How does it know what is the stdlib and what isn't?
16:10:32FromGitter<krux02> sometimes it better to just sleep about it.
16:10:49FromGitter<krux02> Like I did and I changed my mind about the `mod` operator
16:11:08PMunchHow about if nothing matches "jester" then "jester/jester" is attempted?
16:11:12FromGitter<krux02> I don't like the behavior but I agree that it should behave like it does.
16:11:33*Trustable joined #nim
16:11:41*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:11:44PMunchOr to put it another way, if it's not found in the stdlib then look for a namespaced version in nimble
16:12:19Araqthen jester still needs to be patched to allow import jester/jester
16:12:21*couven92 quit (Ping timeout: 264 seconds)
16:12:23Araqand so does random.
16:12:31PMunchWhy?
16:12:39PMunchBoth jester/jester and jester would work
16:12:39dom96Araq: How does 'std' distinguish stdlib paths and other paths?
16:12:56Araqbecause 'import jester' is a shortcut for 'import jester / jester' the long winded version needs to work too
16:13:11Araqand the short version of 'import random' is what got us into this trouble in the first place.
16:13:19PMunchAraq, not really
16:13:23AraqI can say 'import random/random'
16:13:33Araqyes, really.
16:13:53PMunchOh shit, I've literally got to run
16:13:56*PMunch quit (Quit: Leaving)
16:14:00dom96PMunch: I would need to modify the jester repo and move ---
16:14:01dom96okay then
16:14:12FromGitter<krux02> I don't really understand the problem
16:14:34dom96krux02: there is no way for me to import the 'random' nimble package
16:14:42Araqdom96, https://github.com/nim-lang/Nim/blob/devel/compiler/modulepaths.nim#L150
16:15:24dom96Araq: hm
16:15:32FromGitter<krux02> how it looks like when I import things is really not the most important feature of the programming language. Because it is not what I spent most of my time with. And if I spend too much time to get my imports right and cross platform. Then I should start thinking if there is something wrong. But that is not the case.
16:15:50Araqnimble enforces a unique package name but then might not use it as the namespace
16:16:15Araqit's like nimble is fine with the 80% solution
16:16:29dom96that's not really fair, 'import random' is enforcing the namespace
16:17:00dom96the problem is that the stdlib is in the "global" namespace
16:17:41Araqyes but the stdlib came first and so took the most convenient syntax possible
16:17:56Araqand actually it wasn't a namespace either
16:17:59dom96yes, and I can't fault you for that
16:18:06Araqit's what --path allows
16:18:37*yglukhov quit (Remote host closed the connection)
16:19:01dom96This is such a simple change
16:19:09dom96from what I can tell
16:19:15dom96based on the code you've shown me
16:19:32dom96we can reuse --path for packages
16:19:54dom96and add --stdPath, change the config file, change the modulepaths code slightly, add another if for 'pkg', done.
16:20:25FromGitter<krux02> I really think this nimble thing needs very good Documentation. Not just about how to use it, but also on how it looks for something and the reasoning behind it. How it chooses a package on the path, how the path is structured, etc. And what the differce is when you build a file with "nim c" vs "nimple c".
16:20:53dom96krux02: Have you read the Nimble readme? Most of that is documented
16:21:11FromGitter<krux02> well I did, but it was quite a while ago.
16:23:51*fvs joined #nim
16:26:54Araqwhat if the Nim compiler read the .nimble file properly. would it make things simpler?
16:27:16Araqthen nimble doesn't have to teach it how to resolve pkg / foo
16:27:35FromGitter<krux02> dom96: I just looked at the readme and it is missing the most important part, the introduction. It doesn't explain what problem it solves and how it tries to solve it. It just assumes you know what problem it solves and jumps right to requirements and installation.
16:28:01Araqkrux02: well it's a package manager.
16:28:06Araqwhat else is there to say about it?
16:28:12dom96Araq: No
16:28:19Araqit's like a wife. can't live with one, can't live without one.
16:28:19FromGitter<krux02> It says it's a package manager. But I am on linux, I already have a package manager, why does Nim needs it.s own package manager?
16:28:23*Ven`` joined #nim
16:28:50dom96krux02: sure, that's a good question.
16:29:22FromGitter<krux02> And if you know what a package manager is, it doesn't explain what kind of package manager it is. Does it install handle binaries, does it handle src.
16:30:22FromGitter<krux02> Simply talk a little bit about the problem of managing dependencies in a software project and what main inspiration nimble has for it's structure.
16:31:22*couven92 joined #nim
16:32:20FromGitter<krux02> Simply answer the most important question: "Why do I need to care about nimble"
16:34:50*MJCaley joined #nim
16:35:32AraqIMO a real documentation page would be more important, I'm fed up with gitub pages
16:35:49Araqbut whatever ... now what do we do with 'pkg'? nothing?
16:36:18FromGitter<krux02> I am OK with github pages. The content is what I care about.
16:36:21*Jesin quit (Quit: Leaving)
16:36:39dom96I guess we should sleep on it
16:36:49dom96I'm tired of discussing this
16:37:25FromGitter<krux02> yes, thumbs up for that idea
16:41:27*xkapastel joined #nim
16:47:55*miran joined #nim
16:56:07*solitudesf quit (Quit: solitudesf)
17:02:52*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:05:48FromGitter<Vindaar> So I got the getPassword proc working. Implemented an unsetControlCHook analogously to setControlCHook. Just reverts c_signal back to the signalHandler defined in excpt.nim. Seems to work just fine!
17:07:18FromGitter<krux02> @Vindaar I have no idea what you are talking about.
17:09:05FromGitter<Vindaar> Haha, sorry. Mentioned it yesterday after Dom's stream. I tried to implement a proc to read a password from stdin, without showing characters using readLine instead of getch(). So that one can use Ctrl-C and have it quit, and also use backspace in the input
17:12:19*solitudesf joined #nim
17:13:15FromGitter<Vindaar> Here: https://gist.github.com/Vindaar/f5cb17a6c47f6d4cdf3a4995ce2bf3ae
17:25:18shodan45it's the anti-Nim! https://hackaday.com/2018/02/22/quickbasic-lives-on-with-qb64/
17:28:33AraqVindaar: candidate for terminal.nim?
17:28:41Araqseems generally useful for many
17:30:14*yglukhov joined #nim
17:30:14*yglukhov quit (Read error: Connection reset by peer)
17:30:51*MJCaley quit (Quit: MJCaley)
17:37:56*miran quit (Quit: Konversation terminated!)
17:45:28FromGitter<Vindaar> Yeah, that was the intention. Should I make a PR?
18:02:36*Zevv joined #nim
18:03:19ZevvHi, is there a reason that the nim source files do not have a newline at the end?
18:03:42ZevvThis seems to confuse Git, it complains in 'git diff' telling me 'no newline at end of file'
18:03:57*SenasOzys quit (Ping timeout: 264 seconds)
18:05:06*sz0 quit (Quit: Connection closed for inactivity)
18:11:43AraqZevv, usually they do
18:11:57Zevvyeah, once more I'm complaining too early without investigating properly
18:12:04Zevvthat's because you guys are too helpful
18:12:11Zevvit's easier to ask then to figure it out myself :)
18:14:00*SenasOzys joined #nim
18:14:53Zevvmy vim messes things up
18:14:54Zevv:set noendofline
18:14:57Zevvthat's new to me
18:16:43Zevvsorry for the noise, once again
18:18:21*francisl joined #nim
18:23:34*natrys joined #nim
18:36:43*Syneh___ joined #nim
18:37:38*dashed_ joined #nim
18:38:45*francisl_ joined #nim
18:41:17*francisl_ quit (Client Quit)
18:42:40*francisl quit (Quit: francisl)
18:43:05*avsej_ joined #nim
18:43:06*avsej_ quit (Changing host)
18:43:06*avsej_ joined #nim
18:43:09shashlickwhat's the best way to get/send binaries with other devs? something that doesn't need an account ideally
18:43:36*huonw_ joined #nim
18:43:41*Cthalupa- joined #nim
18:43:44*francisl joined #nim
18:44:45*avsej quit (*.net *.split)
18:44:45*Cthalupa quit (*.net *.split)
18:44:46*huonw quit (*.net *.split)
18:44:46*Syneh__ quit (*.net *.split)
18:44:46*dashed quit (*.net *.split)
18:44:48*Syneh___ is now known as Syneh__
18:44:50*avsej_ is now known as avsej
18:44:51dom96shashlick: you mean share files?
18:45:02*dashed_ is now known as dashed
18:48:10shashlickyep, share a test build of an app
18:53:05dom96Maybe this? https://send.firefox.com/
19:06:54shashlicknice
19:17:49*francisl quit ()
19:21:34*francisl joined #nim
19:24:08*r3d9u11 quit (Remote host closed the connection)
19:24:38*r3d9u11 joined #nim
19:34:04*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
19:41:53*r3d9u11 quit (Remote host closed the connection)
19:53:34*BitPuffin quit (Remote host closed the connection)
19:58:43*tongir joined #nim
20:05:53*tongir quit (Ping timeout: 248 seconds)
20:08:02*tongir joined #nim
20:19:34Calinouthat one's pretty nice, but files don't last long
20:19:39Calinouthey last 14 days on https://transfer.sh/
20:19:45Calinou(plus, it has a CLI available)
20:20:07Calinoushashlick: ^
20:23:51*yglukhov joined #nim
20:30:11*dddddd quit (Ping timeout: 276 seconds)
20:34:19dom96so I have a git repo URL such as https://github.com/nimble-test/multi.git
20:34:29dom96Is there a natural way to specify a subdirectory within that git repo inside this URL?
20:36:12shashlickCalinou: that's nice
20:37:06*Vladar quit (Quit: Leaving)
20:38:02Calinoudom96: you can't clone a subdirectory directly
20:38:16dom96yes, I know
20:38:19CalinouGit submodules allow referencing a Git repository commit inside another repository, and cloning it when passing --recursive
20:38:26Calinou(or `git submodule --update init`)
20:38:36dom96but is there a URL convention that would allow me to specify the subdirectory naturally?
20:38:45dom96GitHub kind of screws this up for HTTPS urls
20:38:46dom96hrm
20:38:52Calinounot that I know of
20:40:44*dddddd joined #nim
20:44:30dom96https://github.com/nimble-test/multi.git/alpha
20:44:48dom96Rule: look for *.git and use the rest as the subdirectory, too hackish?
20:45:35AraqNimble already has two URLs in its JSON description
20:45:43Araq"url" and "web"
20:45:51dom96yeah, so I could add another field called "subdir" as well
20:45:55Araqmake "url" the URL and "web" the starting point?
20:46:12Araqbut then why does the "root" matter?
20:46:26dom96what?
20:46:33Araqcan't I have
20:46:39Araqhttps://github.com/nimble-test/multi.git/alpha
20:46:40Araqand
20:46:43Araqhttps://github.com/nimble-test/multi.git/beta
20:46:47Araqas 2 Nimble packages?
20:46:54dom96yes
20:46:56dom96that's the idea
20:47:11Araqso ... you don't have to implement anything?
20:47:20dom96yes I do
20:47:25Araqand what?
20:47:26dom96You can't just ask git to clone that
20:47:57Araqah ok
20:48:05Araqso yeah, do it as you described
20:48:24dom96it's hacky though
20:48:31dom96https://github.com/nimble-test/multi/alpha # won't work
20:48:31Araqwhy?
20:48:44Araqthat's ok
20:49:10AraqI think it's more hacky if I have to look up what the root is just to be sure
20:49:35Araqand don't make Nimble ask about the root, it's already chatty and wants to know too much things
20:49:43dom96I think a lot of people would argue for adding a separate field to the JSON heh
20:49:47Araq*too many things
20:50:00Araqthe JSON is not the problem
20:50:04dom96But I prefer this solution too
20:50:12dom96Because I can easily install on the command line
20:50:16Araqthe problem is that you then need to ask the programmer about it eventually.
20:50:34dom96I don't think that's a problem
20:50:40dom96You won't ever need to ask the programmer that
20:50:54Araqhow could you avoid it?
20:51:07Araqif the URL is allowed to be ambiguous?
20:51:07dom96I know that yglukhov would prefer requires("https://github.com/nimble-test/multi", subdir="alpha")
20:51:25Araqthat is not a solution.
20:51:32yglukhov?
20:51:33Araqthat is the REAL hack.
20:52:04dom96yglukhov: we're discussing how to handle nimble packages that are not at the root of a git repo
20:52:33Araqso ... how is the poor user of a package supposed to know about
20:52:40Araqrequires("https://github.com/nimble-test/multi", subdir="alpha") ?
20:53:16dom96well, this only applies to packages not in the registry
20:53:29yglukhovok, that sounds like something i would prefer. =) even though i can't see a single reason to do that.
20:53:30dom96You'd need to know the url needs to have '/alpha' appended
20:53:56dom96But I do too prefer https://github.com/nimble-test/multi/alpha
20:54:04Araqa URL is full of cruft already, the '.git' won't kill anybody
20:54:23dom96*https://github.com/nimble-test/multi.git/alpha
20:54:36yglukhovdom96: how do you know which part of url is git url or subpath
20:54:49dom96Everything after *.git/ is subpath
20:55:00Araqyeah, please go with that
20:55:06dom96hrm
20:55:10dom96but what about hg
20:55:19Araqhg is dead.
20:55:19yglukhovwhat if the package is served by git url which does not end in .git?
20:55:30Araqthen make it end in .git.
20:55:45yglukhov=)
20:55:48Araqor maybe just require the dot in there
20:55:54Araqfoo.bar/path/here
20:56:19yglukhovwhats the point in a subpath package anyway?
20:56:25yglukhov=)
20:56:28dom96monorepos
20:56:43yglukhovlike it should mean anything to me?
20:56:45Araqyou don't have to have 5 github entries
20:57:01dom96Everything in a single massive repo
20:57:03Araqfor a single larger package that consists of 5 different but related parts
20:57:38yglukhovwhy are those separate packages then? and not a single package?
20:58:20dom96https://github.com/zserge/webview/pull/111#issuecomment-367561320
20:58:29*rokups quit (Quit: Connection closed for inactivity)
20:59:09dom96(scroll up)
21:01:22dom96Maybe I should use // as a delimiter
21:01:30dom96https://github.com/nimble-test/multi//alpha
21:01:48yglukhovdom96: is it "requires" syntax you're talking about?
21:02:05yglukhovand nimble install syntax?
21:02:07Araqso ... because github ignores the '//'?
21:02:12dom96yes
21:02:16Araqand it's generally ignored in URLs?
21:02:37dom96Araq: Yeah, because in URLs it's generally ignored
21:02:43AraqI prefer the dot
21:02:46*el_tejon joined #nim
21:03:13dom96I'd use : but that is already used by git/hg
21:03:26dom96[email protected]:nimble-test/multi.git
21:03:43Araqwell if you remove the special syntax in Nimble before you make the request
21:03:49dom96oh, it's only used by git: ssh://[email protected]/BitPuffin/linagl
21:04:09dom96yeah, I will of course remove it
21:04:20Araqthen you can use whatever you want to.
21:04:55dom96https://github.com/nimble-test/multi/(/alpha)
21:04:56dom96:P
21:05:17Araq#/ perhaps
21:05:40dom96ahh yes
21:05:43Araqnot sure if that can cause conflicts or not but #/ is for SPAs, right?
21:05:55dom96or...
21:05:59dom96?subdir=/alpha
21:06:14Araqcan URLs have comments? :P
21:06:40*arthurz joined #nim
21:06:40dom96I think query key/values work perfectly here
21:06:47dom96and give us the basis for other parameters
21:08:10dom96wow, that confuses git
21:09:05dom96hg actually detects it and gives a nice error
21:09:13dom96abort: unsupported URL component: "subdir=/alpha"
21:09:52dom96git tries to clone into multi?subdir=/alpha
21:10:10dom96oh well, that does actually make sense
21:10:26dom96So anyway, any objections?
21:16:15yglukhovnot that i care much, but yeah, i think it's not the best idea to invent a new url format, that is a superset of hg/git urls.
21:18:08*francisl quit (Remote host closed the connection)
21:20:42dom96What would you propose?
21:38:46yglukhovdom96: you have already said for myself =)
21:39:37yglukhovrequires("https://github.com/nimble-test/multi", subdir="alpha")
21:40:58yglukhovanother option is to forbid multi-package repos
21:41:13*Trustable quit (Remote host closed the connection)
21:42:37yglukhovtbh i still fail to understand the reason behind it. creating a git repo is not much harder than a new nimble file
21:46:26yglukhovbut like i said, i'm not going to argue a lot about it. it's not the most critical question to me. maybe a hacky url extension is ok after all :)
21:46:55*yglukhov quit (Remote host closed the connection)
21:49:43AraqI would use #/ but ?subdir=/bla is ok too
22:03:48*nsf quit (Quit: WeeChat 2.0.1)
22:04:01*francisl joined #nim
22:18:50*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:45:40dom96Thought that would be easier to implement
22:46:44FromGitter<Vindaar> Well, here we go, opened a PR for getPassword: https://github.com/nim-lang/Nim/pull/7254
22:46:51FromGitter<Vindaar> First PR is scary :P
22:47:10*francisl quit (Remote host closed the connection)
22:49:52*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
22:51:36dom96Nothing to be scared of :)
22:51:41dom96Thanks for the PR!
22:53:04*Snircle joined #nim
22:55:01*vivus joined #nim
22:55:33*solitudesf quit (Ping timeout: 264 seconds)
22:57:08FromGitter<Vindaar> Haha, no worries. :D I'm off to bed now. good night!
22:57:15dom96'night!
22:57:23dom96So I think it's about time I release a new Nimble version
22:58:06FromGitter<zacharycarter> :shipit:
23:19:23dom96https://github.com/nim-lang/nimble/blob/master/changelog.markdown#0810---23022018
23:23:39*Sentreen quit (Remote host closed the connection)
23:26:54*zolk3ri joined #nim
23:39:19*natrys quit (Quit: natrys)
23:50:56*xkapastel quit (Quit: Connection closed for inactivity)
23:52:46GitDisc<spaceghost> dom96: I was just thumbing through your nimkernel repository. I had to discover it by looking up what you're up to on github rather than see it weeks ago when I was looking at different young kernels on github. You should definitely tag it appropriatel.
23:53:36GitDisc<spaceghost> dom96: I was just thumbing through your nimkernel repository. I had to discover it by looking up what you're up to on github rather than see it weeks ago when I was looking at different young kernels on github. You should definitely tag it appropriately.
23:56:30*vlad1777d joined #nim