00:04:19 | * | miran_ quit (Ping timeout: 260 seconds) |
00:22:43 | FromGitter | <nitely> yes, like nimYAML |
00:29:23 | FromGitter | <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:10 | GitDisc | <pooboy> Hello guys !! |
01:11:08 | FromGitter | <zetashift> yello! |
01:12:34 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:14:32 | GitDisc | <pooboy> nim is awesome !!! |
01:14:53 | GitDisc | <pooboy> How to use the modulus operator ? |
01:17:11 | FromGitter | <zetashift> I agree! And modulus is used like ```a mod b``` |
01:17:23 | FromGitter | <zetashift> !eval 4 mod 2 |
01:17:24 | NimBot | Compile failed: in.nim(1, 3) Error: expression '0' is of type 'int literal(0)' and has to be discarded |
01:17:37 | FromGitter | <zetashift> whoops |
01:17:54 | FromGitter | <zetashift> !eval echo(4 mod 2) |
01:17:56 | NimBot | 0 |
01:18:19 | FromGitter | <zetashift> this is what I get for learning multiple languages at the same time >< |
01:21:05 | GitDisc | <pooboy> Lol |
01:21:16 | GitDisc | <pooboy> Thanks !! |
01:21:25 | FromGitter | <zetashift> Are you coming from other languages @pooboy? |
01:25:08 | GitDisc | <pooboy> Yes..im coming from ruby,python , java ..im no programmer..im an enthusiast :) |
01:25:46 | FromGitter | <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:01 | FromGitter | <zetashift> For quick small experiments you can use: https://play.nim-lang.org/ |
01:26:10 | FromGitter | <zetashift> I'm actually in the same boat |
01:27:07 | GitDisc | <pooboy> 👌 👌 👌 👌 👌 |
01:27:33 | GitDisc | <pooboy> Can i create my own package for nim ? |
01:27:59 | FromGitter | <zetashift> yes check out: https://github.com/nim-lang/nimble |
01:28:40 | GitDisc | <pooboy> Great ! |
01:53:56 | * | yglukhov joined #nim |
01:54:03 | GitDisc | <pooboy> can we cross-compile binaries ? |
01:55:11 | FromGitter | <zetashift> @pooboy, yes see: https://nim-lang.org/docs/nimc.html#cross-compilation |
01:55:35 | FromGitter | <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:01 | GitDisc | <pooboy> niceeeee |
02:16:22 | FromGitter | <zacharycarter> I guess I need to work on the playground this weekend :) will get me back into writing some Nim |
02:18:47 | GitDisc | <pooboy> 😇 😇 😇 |
02:19:52 | GitDisc | <pooboy> how to write and call a procedure |
02:21:13 | FromGitter | <zacharycarter> pooboy: https://play.nim-lang.org/?gist=c2874ef069977ca708fd46ab6466cf6e |
02:21:48 | FromGitter | <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:06 | GitDisc | <pooboy> Ohh cool |
02:24:09 | GitDisc | <pooboy> Thanks |
02:24:49 | FromGitter | <zacharycarter> sure thing |
02:25:10 | FromGitter | <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:18 | FromGitter | <zetashift> @zacharycarter how's the gamedevving? |
02:26:39 | FromGitter | <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:32 | FromGitter | <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:58 | FromGitter | <zetashift> and with the wealth of information about C++ and gamedev I wouldn't blame you for writing it in C++ |
02:30:29 | FromGitter | <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:09 | FromGitter | <zetashift> Armory is based on it yes but Kha is from a different person |
02:31:19 | FromGitter | <zacharycarter> gotcha |
02:31:51 | GitDisc | <pooboy> Noted |
02:32:07 | FromGitter | <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:30 | FromGitter | <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:09 | FromGitter | <zetashift> I believe they added it so they could target consoles too as they didn't have the official SDKs |
02:36:37 | FromGitter | <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:43 | FromGitter | <zetashift> Can anyone help me why I get an out of bounds error? https://play.nim-lang.org?gist=8c1998c4d9932e0b643bd075fd806122 |
03:51:29 | FromGitter | <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:46 | FromGitter | <zetashift> doing ``` var existingNumbers = newSeqint (a.len) removes it but I don't get the correct answer then |
03:53:05 | FromGitter | <zetashift> whoops I mean ``` var existingNumbers = newSeqint (a.len) ``` |
03:56:25 | FromGitter | <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:47 | FromGitter | <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:36 | FromGitter | <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:41 | FromGitter | <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:03 | FromGitter | <Varriount> You either need a second, nested `for` loop, or a `Set[int]` to store numbers that have been seen. |
05:16:56 | FromGitter | <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:54 | GitDisc | <ethanpmorgan> Bonjour |
06:38:58 | GitDisc | <ethanpmorgan> My dudes |
06:43:46 | FromGitter | <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:00 | FromGitter | <Varriount> Yes, but |
06:45:17 | FromGitter | <zetashift> @ethanpmorgan hello! how's it going? |
06:45:56 | FromGitter | <Varriount> All the function will do is create an array filled with 1's |
06:46:29 | FromGitter | <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:31 | FromGitter | <zetashift> here's the js: https://pastebin.com/9RTerCEP |
06:47:44 | FromGitter | <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:11 | FromGitter | <zetashift> mhhmmh, I guess I've just misinterpreted something wrong while reading; thanks for some clarity! |
06:51:25 | FromGitter | <zetashift> @epmor I had the same with Scala; still taught me alot about programming in general |
06:53:28 | FromGitter | <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:39 | FromGitter | <tim-st> @zetashift something like `len(openArray) != len(set(openArray))` would solve your problem |
07:07:59 | FromGitter | <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:53 | FromGitter | <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:23 | FromGitter | <Varriount> That way you can bail out early if a duplicate is found. |
07:48:40 | FromGitter | <epmor> How do you use case with object types? |
07:49:03 | FromGitter | <epmor> I'll pastebin my code |
07:49:23 | FromGitter | <epmor> https://pastebin.com/wazpaKZp |
07:50:11 | FromGitter | <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:37 | FromGitter | <epmor> Nevermind I got it |
08:03:25 | * | Ven`` joined #nim |
08:04:40 | FromGitter | <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:08 | FromGitter | <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:25 | FromGitter | <epmor> Ah thanks @mratsim Just trying to implement Result into Nim |
08:07:27 | FromGitter | <mratsim> It can be a camera feed, a mic |
08:09:12 | FromGitter | <mratsim> @epmor, you can create a tuple: `type Result[T]: tuple[value: T, error: YourErrorSuccessEnumType]` |
08:09:51 | FromGitter | <mratsim> but in that case Nim uses exceptions rather than returning a result type like in Haskell Rust or Go. |
08:10:10 | FromGitter | <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:56 | FromGitter | <epmor> Ah I see |
08:12:00 | FromGitter | <epmor> Cheers my dude |
08:13:37 | FromGitter | <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:18 | Arrrr | https://www.reddit.com/r/programming/comments/7zird1/nim_at_fosdem_frequently_asked_questions/ |
08:24:57 | FromGitter | <mratsim> @epmor You can have a look at nimfp for example: https://github.com/vegansk/nimfp |
08:25:12 | FromGitter | <mratsim> For example the Either type: https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim |
08:26:40 | FromGitter | <epmor> Ah sweet, thanks @mratsim |
08:30:21 | PMunch | Arrrr, did you like it? |
08:31:56 | Arrrr | Yes. 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:14 | PMunch | Hmm, that's true, but it's a quick google search away :) |
08:33:34 | * | Araq joined #nim |
08:34:01 | Arrrr | Imagine people are lazy |
08:34:06 | * | derlafff joined #nim |
08:34:45 | * | xkapastel quit (Quit: Connection closed for inactivity) |
08:35:06 | FromGitter | <mratsim> You have 5 sec to capture someone attention on a webpage |
08:35:42 | FromGitter | <mratsim> at least that’s what growth hackers, designers and frontend dev work with |
08:38:15 | PMunch | Hmm, maybe I could sprinkly some code examples in there.. |
08:42:21 | FromGitter | <mratsim> apparently last npm upgrade crashed all linux servers |
08:43:20 | PMunch | mratsim, yup pretty brutal :P |
08:43:32 | PMunch | It changed a bunch of permissions for system folders like /etc |
08:44:10 | FromGitter | <mratsim> I wonder if nimble did that how many people would hear of Nim :evilgrin: |
08:45:15 | PMunch | Haha, what kind of sysadmin would end up reinstalling over some broken file permissions? |
08:46:20 | FromGitter | <mratsim> Someone who didn’t have to deal with systemd or pulseaudio 10 years ago ;) |
08:47:45 | PMunch | Hmm, is GitHub down for you too? |
08:48:00 | FromGitter | <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:31 | FromGitter | <mratsim> Works for me™ |
08:48:44 | PMunch | Hmm, I can't pull repos or visit their main site.. |
08:51:22 | FromGitter | <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:28 | PMunch | Agreed! |
08:59:46 | * | floppydh joined #nim |
09:01:20 | Arrrr | All the bugs that arise from naming both type and module the same ... |
09:01:35 | * | hiway joined #nim |
09:03:56 | Araq | Arrrr: filenames should be all lowercase anyway :P |
09:04:14 | Araq | honewatson: 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:14 | FromGitter | <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:18 | PMunch | Yup |
09:45:46 | FromGitter | <gogolxdong> How is it going? |
09:47:42 | FromGitter | <gogolxdong> Where to apply ? |
09:49:37 | PMunch | Apply? |
09:49:42 | PMunch | It's going pretty well |
09:50:18 | PMunch | I'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:38 | PMunch | But for parsing correct data it works pretty well |
09:50:52 | PMunch | And I've implemented the varargs and sig-sag signed ints |
09:50:53 | FromGitter | <gogolxdong> IPFS uses protobuf. |
09:51:32 | PMunch | So the only thing thats really left is to generate the types and the procs to read and write messages |
09:52:11 | PMunch | IPFS? |
09:52:32 | PMunch | https://github.com/PMunch/protobuf-nim |
09:52:38 | PMunch | https://github.com/PMunch/combparser |
09:52:47 | PMunch | That's the repos for both project |
09:52:48 | PMunch | s |
09:52:50 | FromGitter | <Vindaar> InterPlanetary FileSystem ;) |
09:53:27 | PMunch | Hmm, interesting |
09:54:04 | FromGitter | <gogolxdong> thanks . I will check and see whether can give a hand. |
09:55:37 | PMunch | That'd be great :) |
09:57:36 | PMunch | The protobuf-nim repository is kinda messy :P |
09:57:55 | PMunch | So don't hesitate to ask questions |
09:59:38 | * | yglukhov quit (Remote host closed the connection) |
10:00:21 | couven92 | dom96, I didn't have time watching you live, but I am watching the YT now! Looking forward to it!!!! :) |
10:02:07 | couven92 | tea actually sound real nice, hmm... git to make myself a cup first :P |
10:03:07 | * | Vladar joined #nim |
10:05:34 | FromGitter | <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:18 | FromGitter | <gogolxdong> What we can do is a interChinese FileSystem. |
10:15:16 | FromGitter | <narimiran> test 1 2 |
10:16:33 | * | miran quit (Quit: Page closed) |
10:18:36 | FromGitter | <narimiran> ok, this works (i was having problem with IRC this morning). it's miran, btw, if it was not clear.... |
10:25:46 | Araq | so ... again the question: how do we ensure imports from a nimble package? |
10:25:52 | Araq | import nimble / random ? |
10:26:05 | Araq | but nimble itself is a nimble package so that would be ambiguous |
10:33:54 | FromGitter | <andreaferretti> for what it's worth, there could be two nimble packages defining the same module |
10:34:09 | FromGitter | <andreaferretti> so it is not only an issue of nimble vs stdlib |
10:34:49 | FromGitter | <andreaferretti> path import are kind of a solution right now |
10:35:07 | FromGitter | <andreaferretti> import "nim-random/v0.6/random" |
10:35:15 | FromGitter | <andreaferretti> or something like that, I don't remember |
10:35:29 | FromGitter | <andreaferretti> but you have to know the actual path in the nimble directory |
10:35:43 | FromGitter | <andreaferretti> and it depends on the version number, which is unfortunat |
10:35:44 | FromGitter | <andreaferretti> e |
10:36:39 | FromGitter | <narimiran> doesn't sound like an elegant solution.... :( |
10:37:06 | FromGitter | <andreaferretti> it is not |
10:37:15 | FromGitter | <andreaferretti> just telling what works right now |
10:38:18 | FromGitter | <andreaferretti> there should be a way to define a namespace in your nimble package |
10:38:24 | FromGitter | <andreaferretti> so that one could do |
10:38:31 | FromGitter | <andreaferretti> import mynamespace/mymodule |
10:38:44 | FromGitter | <andreaferretti> or just import mymodule if it is not ambiguous |
10:39:18 | FromGitter | <narimiran> shouldn't nimble authors be the ones responsible to not use the same names as std lib? |
10:39:49 | FromGitter | <andreaferretti> yup |
10:40:00 | FromGitter | <andreaferretti> but modules can be added to the stdlib |
10:40:02 | couven92 | narimiran: Yeah, how well is that going to go? |
10:40:07 | FromGitter | <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:10 | FromGitter | <andreaferretti> I think this is what happened with random |
10:40:22 | FromGitter | <narimiran> and you and your package need to find another name |
10:40:43 | FromGitter | <andreaferretti> the real problem is conflicts between modules in different nimble packages |
10:41:27 | Araq | most nimble packages do require import mynamespace/mymodule |
10:42:52 | FromGitter | <andreaferretti> yeah, but is there any check on uniqueness of namespaces? |
10:43:44 | FromGitter | <andreaferretti> I think something was done when nimble started adding warnings for modules named differently from the nimble package |
10:49:59 | Araq | the 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:37 | Araq | which is fine for names like 'jester' that do not have technical names like 'random', I guess |
10:55:10 | * | SenasOzys joined #nim |
11:03:09 | dom96 | andreaferretti: the package name **is** the namespace |
11:03:51 | dom96 | And indeed, the warnings are there to ensure uniqueness |
11:03:55 | dom96 | Eventually they will be errors |
11:06:37 | FromGitter | <andreaferretti> but can one do `import packagename/modulename`? |
11:06:46 | FromGitter | <andreaferretti> that is, is this supported |
11:06:47 | FromGitter | <andreaferretti> ? |
11:07:08 | FromGitter | <andreaferretti> I only remember `import "packagename/$version/modulename"` |
11:07:44 | dom96 | yes |
11:08:20 | dom96 | Where are you getting `import "packagename/$version/modulename"` from? |
11:08:25 | dom96 | That was never possible |
11:09:34 | couven92 | LOL, dom96 "nimisawesome" used 6 times! :D |
11:09:43 | dom96 | 8 times, no? :) |
11:10:00 | couven92 | ah, low res on my small-on-the-side-screen |
11:10:02 | couven92 | sry |
11:10:12 | couven92 | yeah, 8 times! :) |
11:10:19 | FromGitter | <andreaferretti> @dom96 it is possible because it is the actual path on disk of the nim file |
11:10:20 | dom96 | yeah, I wish I remembered to change the font size :( |
11:10:38 | dom96 | andreaferretti: but it's not. The path is packagename-$version/modulename |
11:10:44 | couven92 | and go was not awesome! :P |
11:10:48 | FromGitter | <andreaferretti> ah ok sorry |
11:10:59 | FromGitter | <andreaferretti> I got that wrong but it was what I meant |
11:11:20 | FromGitter | <andreaferretti> the question remains |
11:11:22 | dom96 | also that requires your nim path to contain ~/.nimble/pkgs |
11:11:26 | dom96 | does it by default? |
11:11:39 | FromGitter | <andreaferretti> whe. run by nimble apparently it does |
11:12:07 | couven92 | dom96, 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:23 | FromGitter | <andreaferretti> the point is `import "packagename-$version/modulename"` is inconvenenient |
11:12:29 | couven92 | AND calling your commit "Initial Commit" |
11:12:39 | FromGitter | <andreaferretti> does `import packagename/modulename` work? |
11:12:55 | dom96 | couven92: oh? I was never taught git formally |
11:12:58 | FromGitter | <andreaferretti> otherwise I would not say that packagename is a namespace |
11:12:59 | FromGitter | <alehander42> I always call my first commit "First" :D |
11:13:09 | FromGitter | <andreaferretti> except in some philosophical sense |
11:13:51 | * | derlafff quit (Remote host closed the connection) |
11:13:57 | dom96 | andreaferretti: it works for modules that the package puts in a 'packagename' folder |
11:14:06 | * | derlafff joined #nim |
11:14:14 | dom96 | `import "packagename-$version/modulename"` shouldn't work |
11:14:14 | couven92 | Yeah, I don't teach a subject with syllabus on Git, but I have been giving evening classes for three years now... |
11:14:19 | dom96 | Amazed that it does |
11:14:56 | dom96 | couven92: I can see why calling 'git init' earlier is a good idea, but what's wrong with my commit message? |
11:15:16 | couven92 | dom96, it does not describe what you did in you commit at all! |
11:15:21 | FromGitter | <andreaferretti> @dom96 then it's just the path |
11:15:40 | dom96 | couven92: I see lol |
11:16:08 | couven92 | Normally I put the .gitignore and LICENSE in the Initial Commit |
11:16:14 | FromGitter | <andreaferretti> what I meant is |
11:16:29 | couven92 | (in cases where those two need to be there, but do not really matter) |
11:16:57 | FromGitter | <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:18 | FromGitter | <andreaferretti> this would distinguish it from the stdlib module |
11:17:32 | FromGitter | <andreaferretti> because the package name acts as namespace |
11:17:42 | dom96 | andreaferretti: the only way to implement this would be to special case it in the compiler though |
11:18:10 | FromGitter | <andreaferretti> I know, that is why I was asking for the compiler to support a notion of namespace |
11:18:24 | FromGitter | <andreaferretti> which then would be the package name for nimble packages |
11:19:18 | FromGitter | <andreaferretti> an alternative that does not require changes in the compiler would be |
11:19:19 | couven92 | dom96, 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:39 | FromGitter | <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:11 | FromGitter | <andreaferretti> but put in the path some directories named packagename, which are symlinks to packagename-$version |
11:20:24 | FromGitter | <andreaferretti> for the currently used version |
11:21:03 | FromGitter | <andreaferretti> (this breaks on windows and is probably unsafe to run two instances of nimble concurrently though) |
11:21:55 | PMunch | couven92, that is actually partially done :) |
11:22:17 | couven92 | PMunch, get dom96 to join! :P |
11:22:40 | dom96 | KeePass corrupted my password DB once |
11:22:49 | couven92 | oooh... |
11:22:51 | dom96 | So i'll be staying away from it forever now :) |
11:23:52 | * | vlad1777d joined #nim |
11:24:21 | PMunch | Ouch, that's not good |
11:27:25 | lesshaste | how 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:24 | dom96 | andreaferretti: yeah... so any other ideas? :) |
11:29:54 | * | r3d9u11 quit (Remote host closed the connection) |
11:32:18 | couven92 | dom96, we saw that UNIX (or POSIX) has getpass for password, Windows has CredMan Win32 API functions to enter the password |
11:32:31 | couven92 | create a password-terminal package? :O |
11:32:42 | dom96 | Do it :P |
11:32:45 | couven92 | :D |
11:33:35 | * | vlad1777d quit (Ping timeout: 240 seconds) |
11:33:37 | couven92 | Though 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:21 | couven92 | eating 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:12 | dom96 | :o |
11:37:15 | dom96 | But whyyy |
11:37:16 | FromGitter | <alehander42> o.O I didn't know that |
11:37:57 | couven92 | because writing asterisks is a little unsafe, as it shows the length of your password in the cmd! :P |
11:38:25 | dom96 | lol |
11:38:35 | dom96 | Time to submit webkit/gecko bugs |
11:38:40 | couven92 | (and yes every other GUI totally ignores that by printing password dots!) |
11:40:35 | couven92 | dom96, 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:46 | dom96 | Hrm, I wonder if most websites just reject emojis and other unicode characters |
11:44:48 | couven92 | at 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:42 | GitDisc | <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:07 | Araq | well? |
12:14:38 | * | Yardanico_ quit (Quit: Leaving) |
12:14:49 | * | Yardanico joined #nim |
12:17:25 | dom96 | Araq: Let's flip this around. If you were starting Nim from scratch, how would you solve this problem? |
12:17:36 | Araq | before dreaming up rules with symlinks and re-inventing how to resolve versions, can we decide on a name? |
12:18:23 | Araq | dom96: I would require 'import jester / jester' or maybe 'import jester / _' |
12:18:57 | dom96 | A name for what? |
12:19:23 | * | Yardanico quit (Client Quit) |
12:19:50 | Araq | for "import from $nimblepath" |
12:20:01 | Araq | or some other way to solve the problem |
12:20:03 | * | Yardanico_ joined #nim |
12:21:18 | dom96 | 'import pkg/'? |
12:21:30 | dom96 | We already have 'std', right? so it fits |
12:22:59 | FromGitter | <alehander42> @Araq j("\\\"") works, but j"\\\"" fails with " error, is that a known limitation of this syntax |
12:23:34 | FromGitter | <alehander42> `j("\\\"") works, but j"\\\""` (fixing paste) |
12:23:39 | dom96 | alehander42: You escape " with a double "" in blah"" |
12:23:43 | dom96 | (raw string literal syntax) |
12:23:48 | Araq | j"" is a raw string literal, j("") is not |
12:24:20 | Araq | we don't have suffix operators so 'import pkg/' doesn't parse |
12:24:29 | FromGitter | <alehander42> I see, ok |
12:25:07 | Araq | besides, that does not fix the problem since 'import random/random' does not work due to its structure |
12:25:09 | dom96 | Araq: huh? |
12:25:17 | dom96 | We have 'import std/' |
12:25:23 | Araq | we don't. |
12:25:26 | dom96 | so let's have 'import pkg/random' |
12:25:32 | Araq | we have import std / modulename |
12:25:45 | dom96 | that's what I mean... |
12:25:55 | Araq | oh |
12:25:56 | dom96 | What would 'import std/' even mean? |
12:26:01 | FromGitter | <alehander42> do we have import std/x :O |
12:26:23 | Araq | dunno, I thought you were proposing to import every file in 'std' with this syntax |
12:26:29 | Araq | ;-) |
12:26:31 | dom96 | lol why |
12:26:39 | dom96 | That would be 'import std/*' ;) |
12:26:42 | Araq | ok, so 'pkg' is a keyword |
12:26:47 | Araq | ? |
12:26:53 | dom96 | But anyway, I think my solution is good |
12:27:03 | dom96 | depends what you mean by "keyword"? |
12:27:07 | * | Yardanico joined #nim |
12:27:26 | Araq | well it's obviously not a directory, is it? |
12:27:41 | dom96 | it's special-cased |
12:27:54 | dom96 | It's not a keyword in the sense that you can't define a 'pkg' variable |
12:27:59 | dom96 | (Same for 'std' right now, right?) |
12:28:01 | Araq | ok, so special cased, yes |
12:28:09 | * | Yardanico__ joined #nim |
12:28:12 | Araq | (yes, same for 'std') |
12:28:18 | dom96 | Yeah |
12:28:21 | dom96 | Sounds good to me |
12:28:49 | dom96 | How does 'std' work right now? |
12:28:55 | dom96 | How is 'import std/sha1' handled? |
12:28:57 | Araq | compiler voodoo. |
12:29:02 | dom96 | Can I do 'import std/std/sha1'? :P |
12:29:15 | Araq | no. |
12:29:32 | dom96 | why not? |
12:29:33 | Araq | (maybe if there is a bug, but not in principle) |
12:29:40 | dom96 | okay |
12:30:07 | dom96 | So before I go into arguing about "Sha1 shouldn't be in std/" |
12:30:21 | dom96 | Are we happy with `import pkg/random` vs. `import std/random`? |
12:30:51 | Araq | std is like "lookup, if fails, try lib/pure/ etc", but 'std' itself is NOT in the search path |
12:31:11 | Araq | so if some module is physically in std/ then the std/ directory is required |
12:31:22 | dom96 | yes, makes sense |
12:31:44 | dom96 | but what does "etc" mean here? |
12:31:58 | Araq | lib/impure, lib/wrappers |
12:32:04 | * | Ven`` joined #nim |
12:32:11 | Araq | and some others that the stdlib happens to use |
12:32:16 | dom96 | I think you should introduce a '--pkgPath' |
12:32:27 | dom96 | and --stdPath? |
12:32:35 | Araq | I don't want to, we have --libpath and --nimblePath |
12:32:41 | * | Yardanico__ left #nim (#nim) |
12:32:51 | Araq | or maybe it's just called --lib, don't remember, I never use it |
12:33:01 | dom96 | The problem is that Nimble has to pass --path explicitly when building |
12:33:03 | Araq | but it exists. |
12:33:15 | dom96 | so that will then fail if somebody uses `import pkg/random` |
12:33:22 | dom96 | since 'random' will be in the "path" |
12:33:41 | Araq | hmm not sure I'm following |
12:33:57 | Araq | would std / random (enforced) help with that? |
12:34:03 | dom96 | nimble build -> nim c --path:~/.nimble/pkgs/random-0.1.0/ mybin.nim |
12:34:29 | dom96 | The compiler won't know whether that's part of the stdlib or Nimble |
12:34:39 | dom96 | because AFAIK all stdlib modules are defined via --path |
12:35:13 | dom96 | Not sure what --libpath does |
12:35:24 | dom96 | But --nimblePath should then be built on top of this new --pkgPath |
12:35:38 | dom96 | You'll need a separate list in the compiler anyway I think |
12:35:47 | dom96 | so I don't see why creating this distinction will hurt |
12:35:57 | dom96 | it follows from this 'std'/'pkg' feature |
12:36:10 | Araq | I wanted to introduce import $package / foo so that you can do: --find:package=over/here |
12:36:29 | Araq | but you talked me out of $dollar because "too hard to teach" |
12:36:34 | dom96 | yes |
12:36:36 | dom96 | I did |
12:36:54 | dom96 | because it doesn't work well with what he have currently |
12:36:55 | Araq | then --path would not be a stupid list but specialized by package |
12:37:02 | dom96 | *we |
12:37:21 | dom96 | everybody would need to change their imports to use this $dollar thing |
12:37:43 | dom96 | It's an overly-generalised feature, I don't see anyone else using this |
12:37:48 | Araq | true but it's a clear distinction between path imports and package imports |
12:38:05 | Araq | well I don't see why 'std' and 'pkg' should be special |
12:38:19 | dom96 | Yes, but I want the distinction only to be necessary for resolving conflicts |
12:38:37 | dom96 | The current module system is good |
12:38:43 | dom96 | and it works for 99% of cases |
12:38:59 | dom96 | The remaining 1% need this `pkg`/`std` feature to disambiguate |
12:39:57 | FromGitter | <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:50 | dom96 | That implies that 'pkg'/'std' are modules. |
12:40:55 | Araq | from strutils import toLowerAscii from std ? |
12:41:34 | Araq | can't see that one working out well, regardless if 'std' is a real keyword or not |
12:42:05 | Araq | from std / strutils import toLowerAscii # makes more sense IMO |
12:42:26 | dom96 | agreed |
12:42:50 | FromGitter | <alehander42> ok, what happens if you have a directory called 'std' |
12:42:55 | FromGitter | <alehander42> or called 'pkg' |
12:43:07 | Araq | you really shouldn't and that's the end of the story. :-) |
12:43:49 | Araq | unless we come back to my $std proposal :P where we get these lovely dollars for "namespaces" |
12:45:15 | dom96 | actually, that's a valid concern |
12:46:08 | dom96 | There will undoubtedly be users who create 'std' or 'pkg' directories in their project |
12:46:17 | Araq | we can name them 'stdlib' and 'stdpkg' and then people who name their directory 'stdlib' need to be punished |
12:46:31 | dom96 | stdpkg? lol |
12:46:46 | dom96 | or |
12:47:05 | dom96 | we also have 'cwd' |
12:47:06 | dom96 | or 'dir' |
12:47:08 | dom96 | or 'local' |
12:47:17 | dom96 | wait |
12:47:17 | FromGitter | <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:20 | dom96 | Don't we have '.'? |
12:47:27 | dom96 | 'import ./pkg/foo' |
12:47:31 | dom96 | Problem solved? |
12:47:39 | Araq | tim-st: a template cannot do that, but a macro surely can |
12:47:40 | FromGitter | <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:52 | FromGitter | <tim-st> @Araq thanks! |
12:47:57 | FromGitter | <andreaferretti> so it makes sense that nimble packages are searched first |
12:48:05 | dom96 | andreaferretti: we are changing that |
12:48:19 | dom96 | You will be able to explicitly ask for a Nimble package |
12:48:35 | FromGitter | <andreaferretti> I see, I was trying to figure the smallest change that would work |
12:48:50 | Araq | dom96: 'import "./pkg/foo" ' works but I really think people shouldn't use 'pkg' or whatever we end up using |
12:49:04 | FromGitter | <andreaferretti> if nimble packages have the priority, there should be no need to explicitly choose them |
12:49:28 | dom96 | Araq: 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:42 | Araq | ok. |
12:50:14 | * | athenot_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:50:27 | Araq | andreaferretti: problem is that nimble packages creep into my nimbledir and will break things |
12:51:05 | Araq | say for illustration that I install a 'strutils' package which can be imported as 'import strutils' (just an example) |
12:51:33 | Araq | now every Nim program doesn't compile anymore if nimble packages get preferred over the other stuff in my search path |
12:52:22 | Araq | I can patch my Nim code to say 'import std / strutils' everywhere |
12:52:48 | Araq | but I don't want to. :-) |
12:53:01 | FromGitter | <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:28 | Araq | 'random' used to be unique before we added it to the stdlib |
12:53:35 | Araq | same for sha1. |
12:53:44 | Araq | and it will happen again, why wouldn't it? |
12:53:49 | dom96 | yep |
12:53:51 | dom96 | precisely |
12:53:54 | FromGitter | <narimiran> araq: i'll copy my comment from before: |
12:53:58 | Araq | we cannot dream up of strange stdlib module names just to prevent clashes. |
12:54:11 | FromGitter | <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:25 | FromGitter | <narimiran> "and you and your package need to find another name" |
12:54:36 | Araq | we want to be able to grow Nim past 1.0 is released |
12:54:36 | dom96 | Nim won't be in a pre-1.0 phase forever |
12:54:40 | * | radagast_04 quit (Ping timeout: 240 seconds) |
12:54:47 | FromGitter | <narimiran> dom96 - prove that |
12:54:53 | FromGitter | <narimiran> :D |
12:55:30 | Araq | well that's a good joke but nothing more. |
12:55:46 | Araq | even if we never release 1.0 a working solution would be desirable. |
12:55:52 | FromGitter | <narimiran> agreed |
12:56:58 | FromGitter | <narimiran> imho, imports from stdlib should remain as they are, and be as simple as possible |
12:58:13 | FromGitter | <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:53 | FromGitter | <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:24 | Araq | yes and for this to work we need a way to disambiguate |
13:01:25 | * | r3d9u11 joined #nim |
13:01:42 | Araq | which we currently lack for nimble packages that do not use a "namespace" |
13:02:20 | Araq | or not, import "../package-1.1/foo" works I guess |
13:02:36 | FromGitter | <narimiran> first - is there a possibility for two nimble packages to have the same import? |
13:03:05 | Araq | not sure, seems unlikely |
13:03:23 | Araq | but it can clash with anything in your --path |
13:03:29 | FromGitter | <narimiran> thought so. then this makes the problem easier |
13:03:42 | FromGitter | <narimiran> damn |
13:04:09 | FromGitter | <narimiran> `nimble import random`? |
13:04:31 | * | couven92 joined #nim |
13:04:50 | FromGitter | <Vindaar> you could even nimble import -> nimport (only half joking here...) |
13:05:08 | dom96 | Each Nimble package name has to be unique |
13:06:31 | dom96 | I just remembered something though and I wonder how well it will interact with this disambiguation |
13:06:56 | dom96 | It would be nice to scope Nimble packages |
13:07:25 | FromGitter | <andreaferretti> require each pckage author to use a the reverse of a url they own :-P |
13:07:51 | FromGitter | <andreaferretti> import com.apache.common.random :-D |
13:08:02 | dom96 | npm does it like this: require('@myorg/mypackage') |
13:08:32 | dom96 | import dom96/jester ? lol |
13:09:27 | FromGitter | <narimiran> @andreaferretti don't give them the ideas :D :D |
13:09:31 | dom96 | I think it might be too late to enforce this |
13:09:57 | * | SenasOzys quit (Ping timeout: 264 seconds) |
13:10:00 | Araq | dom96: yglukhov argued against it before |
13:10:12 | Araq | too often does the "vendor" change for this to be viable |
13:10:14 | dom96 | oh? What was his argument? |
13:10:51 | GitDisc | <ethanpmorgan> |
13:10:51 | GitDisc | <ethanpmorgan> https://cdn.discordapp.com/attachments/371759389889003532/416582680982061056/20180223_131037.png |
13:10:53 | FromGitter | <narimiran> if you have `uniqueName` package, you can import with either `import uniqueName` or `nimble import uniqueName` for the same effect |
13:11:02 | GitDisc | <ethanpmorgan> The deer is done. My first programming book |
13:11:02 | dom96 | So rename and scope and an alias for the old name |
13:11:19 | yglukhov | hey guys whats up |
13:11:19 | GitDisc | <ethanpmorgan> The deed is done. My first programming book |
13:11:22 | Araq | what does "scope" mean here? |
13:11:28 | dom96 | ethanpmorgan: yay :D |
13:11:36 | FromGitter | <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:50 | dom96 | Araq: The username in "import dom96/jester" |
13:12:02 | Araq | ok so what I called "vendor" |
13:12:16 | dom96 | vendoring is a different package manager concept |
13:12:17 | GitDisc | <ethanpmorgan> College has us doing VB.net I'll let Nim help fix my insanity |
13:12:23 | dom96 | so "scope" is a better name |
13:12:37 | Araq | it really isn't. but "username" is ;-) |
13:12:55 | Araq | "scope" already has a different meaning in a PL context. |
13:12:56 | dom96 | narimiran: no clue what you mean |
13:13:17 | Araq | he is proposing a new syntax, a 'nimble import' statement |
13:13:24 | Araq | crazy talk. ;-) |
13:13:32 | FromGitter | <narimiran> @dom96 that's my proposal for this import confusion |
13:13:59 | dom96 | righttttt |
13:14:26 | Araq | maybe we should allow URL imports and let people deal with the mess |
13:14:46 | FromGitter | <narimiran> what if there is a great package from user `fuckthisshit`? i wouldn't want to see that in my code |
13:15:01 | dom96 | Araq: We're not savages |
13:15:24 | Araq | then we only need a way to do string interpolation like import "$foo" so that $foo can become https://etcetc |
13:15:38 | dom96 | narimiran: why not? Brainfuck is a thing :P |
13:15:50 | dom96 | Hrm... could I create a poop emoji Nimble package? |
13:16:00 | dom96 | I bet I could |
13:16:07 | Araq | yeah, what if the module name is 'fuckthisshit'? |
13:16:14 | FromGitter | <narimiran> tru dat |
13:16:17 | Araq | you fork and rename? there you go. |
13:16:33 | Araq | but real packages have real names, in general. |
13:16:41 | livcd | what if the code contains master/slave and all the SJWs get mad. 1st world problems. |
13:16:49 | Araq | LOL |
13:16:53 | couven92 | naming is hard! |
13:17:34 | couven92 | unfortunenately still one of the great unsolved problems... :P |
13:17:54 | livcd | kill me but i like go get :PPP |
13:18:03 | FromGitter | <narimiran> ok, @Araq, so you think `nimble install` is not a good/simple way to deal with this? |
13:18:08 | dom96 | livcd: :'( |
13:18:29 | Araq | narimiran: you mean 'nimble import'? |
13:19:03 | FromGitter | <narimiran> yeah, sorry |
13:19:08 | dom96 | what would that even do? |
13:19:32 | * | SenasOzys joined #nim |
13:19:52 | Araq | we don't need more keywords and the split between stdlib and nimble packages is questionable design to begin with IMO. |
13:20:06 | FromGitter | <narimiran> @dom96 `nimble import pkgname` would make sure you're importing nimble package, and not the stdlib one |
13:20:29 | Araq | I would like to have a solution that does more than just stdlib vs nimble package |
13:20:47 | Araq | but oh well, probably too late for that |
13:22:20 | livcd | I would prefer simple instead of smart |
13:22:51 | FromGitter | <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:08 | Araq | again, it already happened twice. |
13:23:23 | FromGitter | <narimiran> nim is not in post-1.0 phase yet ;) |
13:23:25 | Araq | and in general stdlib names want to be "standard" |
13:23:37 | dom96 | what it should have been from the beginning is 'std/' prefix for all stdlib packages |
13:23:40 | dom96 | but it's too late forthat |
13:24:12 | FromGitter | <narimiran> @dom96 would that mean `import std/strutils, std/sequtils, std/math`? |
13:24:17 | Araq | http, url, uri, cgi, every protocol name makes a good "stdlib" name |
13:24:30 | dom96 | narimiran: yes |
13:24:38 | Araq | or |
13:24:44 | FromGitter | <narimiran> let me find some vomiting smiley.... |
13:24:50 | Araq | import std / [strutils, sequtils, math] |
13:24:51 | dom96 | although 'import std/[strutils, sequtils, math]` would be possible |
13:25:09 | dom96 | optional 'std' is a good compromise IMO |
13:25:26 | FromGitter | <narimiran> `import std: strutils, sequtils, math` to look more nim-like? |
13:25:35 | dom96 | So let's get it in there and move on |
13:25:43 | Araq | yup. |
13:25:55 | Araq | ok, so we add 'pkg' too and call it a day |
13:25:57 | Araq | ? |
13:26:15 | FromGitter | <krux02> I just joined. |
13:26:20 | FromGitter | <krux02> you want to add pkg to what? |
13:26:33 | dom96 | yes |
13:26:43 | Araq | as the second pseudo directory, krux02 |
13:27:07 | FromGitter | <krux02> the second? |
13:27:15 | dom96 | Araq: But also --pkgPath (and possibly --stdPath) |
13:27:19 | Araq | the first one is 'std' |
13:27:23 | Araq | argh |
13:27:34 | FromGitter | <krux02> I know in linux there are a lot of folders with the suffix `.d` for directory |
13:27:42 | Araq | --pgkPath and --stdPath, why? |
13:27:51 | dom96 | I already explained why :( |
13:28:01 | Araq | yeah I know |
13:28:03 | Araq | but I mean |
13:28:11 | Araq | "can't we do without?" |
13:28:13 | FromGitter | <narimiran> @Araq can you show us the example of the proposed import of stdlib package and nimble package? |
13:28:24 | dom96 | no, we can't. Nimble needs a way to tell the compiler which is which |
13:28:32 | FromGitter | <narimiran> or even better - multiple packages |
13:28:38 | dom96 | unless you have a better idea |
13:28:52 | dom96 | narimiran: import pkg/random vs. import std/random |
13:29:34 | Araq | dom96: how does it even fix the problem? say I have 'import random' in my program. |
13:29:54 | Araq | then nobody knows if it's std/random or pkg/random |
13:30:13 | dom96 | 'import random' will behave as it does now, search through the stdlib paths and then the nimble paths |
13:30:23 | dom96 | This is about 'import pkg/random' |
13:30:29 | FromGitter | <krux02> whell the compiler could complain and say it's not unique |
13:30:41 | dom96 | If Nimble specifies --path:~/.nimble/pkgs/random-0.1.0/ then you'll get an error |
13:30:48 | FromGitter | <narimiran> if there is 'pkg' prefix, then `import random` should be only the stdlib one |
13:30:49 | Araq | why? |
13:31:01 | FromGitter | <narimiran> so there is no confusio |
13:31:20 | dom96 | Araq: Because `import pkg/random` will search through the nimble paths |
13:31:26 | dom96 | And only those |
13:31:38 | FromGitter | <narimiran> imports without prefix = always stdlib package, nothing else |
13:31:48 | Araq | oh I see your point. hm. |
13:31:58 | livcd | I would just force people to pick a different name than awesomepkg: random |
13:32:00 | FromGitter | <andreaferretti> @narimiran that shi has sailed |
13:32:07 | FromGitter | <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:17 | FromGitter | <andreaferretti> there is already a lot of code using import without prefix for nimble stuff |
13:32:18 | FromGitter | <krux02> well, not if you build with nimble |
13:32:22 | FromGitter | <krux02> I see |
13:32:45 | FromGitter | <narimiran> once again - nim is pre-1.0, everybody should expect breaking changes! |
13:33:07 | FromGitter | <andreaferretti> not a breaking change that breaks half of the existing ecosystem without a second thought |
13:33:07 | FromGitter | <narimiran> we all knew what we "signed for" |
13:33:13 | Araq | we don't break every Nim program out there without a deprecation path, that's crazy talk. |
13:33:20 | FromGitter | <narimiran> ok ok :) |
13:33:40 | Araq | btw we also must be able to bootstrap ;-) |
13:34:03 | FromGitter | <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:28 | FromGitter | <krux02> make it ten years or something, but give it a date when something can be removed |
13:34:42 | dom96 | Araq: Only problem with my idea to use --pkgPath is that Nimble will stop working with older Nim compilers |
13:35:11 | Araq | dom96: it can query the compiler's version if we really care that much about it |
13:35:18 | dom96 | true |
13:36:00 | Araq | ok, 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:50 | FromGitter | <andreaferretti> does nimble currently pass the path of the stdlib using --path? |
13:36:54 | dom96 | Araq: no, there is no mapping |
13:37:03 | Araq | but there should. |
13:37:04 | dom96 | Araq: It's just a single path |
13:37:07 | dom96 | Why? |
13:37:20 | dom96 | andreaferretti: no |
13:37:25 | Araq | because it's cleaner. |
13:37:38 | Araq | nimble tells the compiler how to resolve pkg/foo |
13:37:40 | dom96 | Araq: what use is the package name? |
13:37:56 | FromGitter | <andreaferretti> @dom96 then why cannot --path be used where you think to use --pkgPath? |
13:38:10 | dom96 | andreaferretti: because that will become "--stdPath" |
13:38:31 | dom96 | andreaferretti: Nimble needs a way to distinguish |
13:38:35 | FromGitter | <andreaferretti> The compiler already knows where the stdlib lives, right? |
13:38:40 | FromGitter | <andreaferretti> It's not nimble telling |
13:38:41 | FromGitter | <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:51 | dom96 | andreaferretti: yes, but that's defined in Nim's config file... using --path |
13:39:01 | FromGitter | <andreaferretti> uh I see |
13:39:06 | Araq | actually, it's --lib |
13:39:28 | FromGitter | <andreaferretti> great, then there is no need to introduce two new names |
13:39:35 | FromGitter | <andreaferretti> --lib -> --stdPath |
13:39:41 | FromGitter | <andreaferretti> --path -> --pgkPath |
13:39:43 | Araq | which gives the location of system.nim. probably a bad thing to have both |
13:39:48 | dom96 | https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L34 ? |
13:39:52 | dom96 | looks like --path to me |
13:39:52 | FromGitter | <andreaferretti> --lib and --path are good enough |
13:40:02 | Araq | especially since I'm not sure what --lib does... |
13:40:26 | Araq | feature creep. |
13:41:00 | dom96 | why do you want a mapping? |
13:41:30 | Araq | to not further hardcode this nimble vs stdlib distinction |
13:41:45 | Araq | the stdlib should be a package like others |
13:41:57 | Araq | unrealistic at this point, I know, but still. |
13:42:15 | dom96 | pkg and std will be hard coded |
13:42:18 | dom96 | there is no avoiding it |
13:42:47 | dom96 | --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:34 | dom96 | Unless you're thinking --map:pkg:path1 --map:pkg:path2 |
13:43:52 | dom96 | to allow more than just 'pkg' and 'std' |
13:43:53 | Araq | that is what I have in mind. |
13:44:11 | dom96 | that's far more disruptive |
13:44:43 | dom96 | We can make `--path` mean `--pkgPath` (add an alias so that it can be renamed in time) |
13:44:55 | dom96 | and change the Nim config to use --lib for --stdPath |
13:45:12 | dom96 | (and also create an alias for --lib, or just rename it since no outside tools use it) |
13:45:16 | Araq | I don't fully understand the difference between --path and --pkgPath |
13:45:32 | dom96 | --path:foo -> --map:std:foo |
13:45:40 | dom96 | --pkgPath:foo -> --map:pkg:foo |
13:45:56 | FromGitter | <andreaferretti> this would break everything |
13:45:56 | dom96 | (--path = --stdPath in this case) |
13:46:20 | FromGitter | <andreaferretti> there are already projects using path, generally for things not in the stdlib |
13:46:40 | dom96 | But perhaps you're wondering what the difference between --path and --pkgPath is as --path is currently implemented |
13:46:44 | Araq | yeah, my projects use it too |
13:46:55 | Araq | dom96: yes. |
13:46:58 | Araq | that too. |
13:47:21 | dom96 | --path is used by ``import random`` |
13:47:25 | dom96 | to find 'random' |
13:47:41 | Araq | yeah ok |
13:47:50 | Araq | the other thing is more of a rewrite rule |
13:48:08 | dom96 | In our new implementation `import random` will use the list of --stdPath followed by --pkgPath |
13:48:11 | Araq | rewrite pkg/random to bla-1.0/random |
13:48:17 | dom96 | `import std/random` will only use --stdPath |
13:48:22 | dom96 | `import pkg/random` will only use --pkgPath |
13:48:33 | * | athenot joined #nim |
13:48:41 | dom96 | no |
13:48:49 | dom96 | You don't need to worry about that |
13:49:00 | dom96 | That is taken care of by --nimblePath |
13:50:23 | Araq | unless overriden by --pkgPath, yes |
13:50:44 | dom96 | --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:05 | dom96 | --pkgPath doesn't override anything |
13:51:12 | dom96 | it just adds a new path to the list of paths |
13:51:18 | dom96 | the same thing that --nimblePath does |
13:51:39 | Araq | you lost me. |
13:51:56 | Araq | so you mean |
13:52:07 | Araq | --pkgPath does work with --noNimblePath? |
13:52:17 | Araq | to resolve the issue? |
13:52:38 | dom96 | I think so. Not 100% sure what you mean. |
13:52:47 | Araq | ok |
13:52:49 | dom96 | --noNimblePath instructs the compiler to ignore --nimblePath |
13:53:14 | dom96 | (needed because the Nim config file contains these --nimblePath flags) |
13:53:47 | dom96 | Is everything clear? |
13:53:53 | Araq | yes |
13:54:02 | dom96 | great |
13:54:06 | Araq | I don't like it, but now it is clear |
13:54:40 | dom96 | why not? |
13:57:06 | Araq | because it's too obviously a patch. |
13:57:28 | FromGitter | <andreaferretti> what about |
13:57:44 | FromGitter | <andreaferretti> instruct the compiler to look into --path for import pkg/foo |
13:57:57 | FromGitter | <andreaferretti> change the compiler to use --lib instead ofp--path |
13:58:09 | FromGitter | <andreaferretti> that's it |
13:58:25 | FromGitter | <andreaferretti> --path stays exactly as it is today |
13:58:38 | FromGitter | <andreaferretti> nimble stays exactly as it is today |
13:58:57 | dom96 | Araq: Not if it's named --pkgPath and --stdPath :) |
13:59:04 | FromGitter | <andreaferretti> the only thing to change is the logic for the imports in the compiler |
13:59:04 | FromGitter | <andreaferretti> to prefer --lib over --path |
13:59:20 | dom96 | andreaferretti: that's exactly what I suggested above... |
13:59:48 | FromGitter | <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:49 | FromGitter | <tim-st> macro echoX*(): typed = result = "echo x".parseStmt() ⏎ var x = 1 ⏎ echoX() |
14:02:19 | Araq | tim-st: that's wrong. |
14:02:31 | Araq | it should use 'quote do' or template+getAst |
14:02:36 | Araq | or the API construction. |
14:03:02 | Araq | string based AST manipulations are a last resort when everything else fails |
14:03:37 | FromGitter | <tim-st> I assumed this, but it's very easy to use^^ |
14:04:19 | Araq | it's only easy when you don't do anything whatsoever with the string |
14:04:58 | FromGitter | <tim-st> For my case thing that's working |
14:05:11 | Araq | dom96: I think andreaferretti has the right idea here |
14:05:21 | Araq | tim-st: for your case a 'template' would do too. |
14:05:42 | FromGitter | <tim-st> ok, will have a look, thanks |
14:06:43 | Araq | the point is "if 'pkg' is a special case, we can make --path work with it too" |
14:07:13 | Araq | so --path:foo would effect 'std/foo' |
14:07:26 | Araq | er no |
14:07:31 | Araq | I mean 'pkg/foo' |
14:08:51 | dom96 | I'm pretty sure that's precisely what I suggested above. |
14:09:00 | dom96 | --path means --pkgPath |
14:09:07 | dom96 | --lib means --stdPath |
14:09:23 | Araq | well my proposal leaves out the --lib part :P |
14:09:48 | dom96 | so how do you specify stdlib paths to Nim? |
14:10:08 | Araq | you don't. Nim knows where the stdlib is |
14:10:12 | Araq | well |
14:10:25 | Araq | depending on how you look at it, it stays the same. the config sets --lib |
14:10:35 | Araq | but Nimble doesn't. |
14:10:49 | Araq | but I guess this is what you meant |
14:11:00 | Araq | and you only requested the rename for consistency. |
14:11:33 | Araq | --path is ambiguous then, influencing where to find nimble packages as well as being the general search path |
14:11:36 | dom96 | yep |
14:12:14 | dom96 | I don't really see a reason to argue over this |
14:12:21 | dom96 | This is just a couple of extra flags and sequences in the compiler |
14:12:36 | Araq | it's already complex |
14:12:39 | Araq | and had bugs. |
14:13:00 | Araq | and it's misdesigned, I don't like --path nor --nimblePath |
14:13:16 | dom96 | I love it |
14:13:31 | Araq | so asking me to add --pkgPath or changing how --path works |
14:14:01 | Araq | does not make me happy. |
14:15:12 | Araq | I like my import $variable / [stuff] idea. you specify what $variable resolves to elsewhere. problem solved. |
14:16:13 | Araq | and both --nimblePath and --path become unnecessary. |
14:17:06 | dom96 | Please let's just get this pkg/std distinction |
14:19:06 | Araq | that's more work to implement and less flexible :-( |
14:19:46 | Araq | it's also as hard to learn as $variable, IMO. |
14:20:21 | dom96 | $variable is too flexible |
14:20:33 | dom96 | there is no need for this to be in the user's face |
14:20:52 | dom96 | I don't understand how that can possibly be less work |
14:21:15 | Araq | I wrote the code for it and disabled it recently. |
14:21:39 | Araq | so ok, maybe that's unfair. |
14:21:51 | Araq | anyway, I like it much more. |
14:22:26 | dom96 | and how do you define what $variable means? |
14:22:34 | Araq | if Nimble supports / enforces user names one day, Nim doesn't have to change, it was $jester all along |
14:23:25 | dom96 | so your solution is to break all existing package imports? |
14:23:30 | Araq | via the config or command line, --var:jester=$nimble/jester |
14:23:56 | Araq | no, I don't break anything, I only add a feature |
14:23:57 | dom96 | so I install jester using Nimble |
14:24:09 | dom96 | I can't use the global installation anymore unless I specify --var:jester=... |
14:24:44 | dom96 | I also personally dislike this `$` thing |
14:24:51 | Araq | yes. |
14:25:59 | dom96 | So you're breaking an established workflow |
14:26:48 | dom96 | This is a much more disruptive change and I don't envision many use cases for its flexibility |
14:27:23 | Araq | this 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:55 | Araq | so instead I want $nimble/jester or even short just 'jester' |
14:28:01 | Araq | *shorter |
14:28:20 | Araq | but it's too ambiguous so I propose $jester |
14:29:23 | Araq | which cannot be confused with a real path/filename |
14:29:46 | dom96 | if you want we can ask the community what they think |
14:32:32 | Araq | well we're having this discussion in #nim |
14:32:44 | Araq | we had an RFC already |
14:32:50 | Araq | with plenty of opinions |
14:32:56 | Araq | and no real solution afaict |
14:33:29 | Araq | I 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:51 | FromGitter | <data-man> @Araq: Can I to use --var:std=mySuperCoolStd? |
14:35:08 | Araq | data-man: in my proposal, yes. |
14:35:18 | dom96 | If you implement this then that will be the end of it |
14:35:35 | dom96 | I will double check your commit to make sure you've done it right :P |
14:35:45 | Araq | that would be ok if I was happy with --path and --nimblePath, but I'm not. |
14:36:06 | Araq | and Nimble is getting "multiple packages per git repo" |
14:36:17 | Araq | and maybe later "username support" in some form |
14:36:32 | FromGitter | <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:34 | Araq | so I don't think you can promise me it won't grow again. |
14:36:43 | FromGitter | <alehander42> does anybody remember such a bug |
14:37:05 | Araq | alehander42: nope. report it please |
14:37:24 | dom96 | Araq: multiple packages per git repo won't be a problem |
14:37:53 | dom96 | they'll just be installed separately |
14:38:04 | dom96 | usernames may never happen |
14:38:14 | dom96 | by the time they do 1.0 will be out |
14:39:49 | FromGitter | <data-man> I like --var: |
14:41:08 | dom96 | data-man: why? |
14:41:42 | FromGitter | <data-man> E.g. for NewStd with new runtime. |
14:45:07 | Araq | dom96: what if we use --var without the $ as a general mechanism to override --path? |
14:45:40 | Araq | then Nimble can use --var:pkg/foo=path/foo-1.0/foo |
14:46:17 | FromGitter | <andreaferretti> wouldn't this break existing imports anyway? |
14:46:40 | FromGitter | <andreaferretti> or do you plan for this to also support just import foo when it is not ambiguous |
14:47:28 | dom96 | Araq: That's better, but --nimblePath will also need to introduce the same mappings |
14:48:17 | dom96 | I fear it's too much power though |
14:48:45 | Araq | username support is really important though and it's covered by it |
14:49:07 | Araq | just saying "nimble will never support usernames" doesn't seem wise. |
14:49:25 | dom96 | I can achieve the same thing by getting Nimble to place the packages inside a username/ directory... |
14:50:10 | FromGitter | <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:49 | FromGitter | <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:14 | FromGitter | <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:42 | Araq | data-man: that's already possible via a Nimscript config |
14:53:00 | Araq | krux02: what caused this change of mind? |
14:54:22 | FromGitter | <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:07 | Araq | dom96: what do you mean? "--nimblePath will also need to introduce the same mappings"? |
14:55:25 | Araq | krux02: agreed. |
14:55:38 | FromGitter | <krux02> Well I think it's important to be consistent and stick to standards. Certain things are just fighting agains windmills. |
14:55:43 | dom96 | Araq: I mean it will also need to implicitly specify --var:pkg/foo=... for each package |
14:56:01 | dom96 | otherwise I won't be able to write 'import pkg/random' and compile via Nim |
14:56:36 | Araq | that's conceptually what --nimblePath does, it's just that the implementation is different? |
14:56:38 | FromGitter | <krux02> It's like the guys who wants decimal floating point numbers because he things the float type is bad. |
14:56:55 | Araq | I prefer fractions fwiw |
14:56:57 | FromGitter | <krux02> Yes float is not perfect, but everything is float. Arguing against it is pointless. |
14:57:15 | Araq | and saturated arithmetic :-) |
14:57:47 | FromGitter | <krux02> And now I called `mod` from c++ glm `modulo` in nim-glm. |
14:57:54 | dom96 | Araq: I'm just mentioning that you will still need --nimblePath |
14:58:04 | dom96 | and that it will need to work with this new --var thing |
14:58:14 | Araq | yes, and add 'pkg' as a special name |
14:58:14 | dom96 | I still prefer --stdPath/--pkgPath |
14:58:15 | FromGitter | <krux02> that modulo function has the behavior I want, |
15:01:25 | Araq | dom96: ok, but I am happy with the compromise. |
15:01:41 | FromGitter | <krux02> I solved the conflict by just choosing a different name. |
15:02:25 | dom96 | Araq: I'm not :/ |
15:02:25 | FromGitter | <krux02> Araq: should I make a pull request with the change to `mod` on float behavior? |
15:02:56 | Araq | krux02 was it wrong? |
15:03:05 | Araq | iirc is uses 'fmod' already |
15:03:10 | Araq | *it |
15:03:36 | FromGitter | <krux02> when it does use fmod, then it is good. |
15:03:51 | dom96 | I feel like we already agreed on --stdPath/--pkgPath |
15:04:01 | dom96 | and you keep pushing this --var stuff |
15:04:03 | FromGitter | <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:35 | FromGitter | <data-man> @krux02: Maybe this library will be useful for you http://www.jhauser.us/arithmetic/SoftFloat.html ⏎ zig language used it. |
15:05:26 | Araq | dom96: "I fear it's too much power though" it not a convincing argument for Nim |
15:06:17 | Araq | and all that --pkgPath does is to hardcode this pkg/ prefix |
15:06:21 | dom96 | the fact is that it won't be obvious where this strange random special cased paths are coming from |
15:06:38 | dom96 | 'pkg' and 'std' is already bad enough |
15:06:49 | dom96 | and you want to encourage people to add their own weird names |
15:07:00 | dom96 | with nothing to distinguish them from normal paths |
15:07:02 | dom96 | it's a bad idea |
15:07:30 | Araq | but $foo is ugly, you can't have it both ways |
15:08:08 | dom96 | I don't want it at all |
15:08:49 | Araq | you 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:05 | Araq | without any configuration change |
15:09:05 | * | Ven`` quit (Ping timeout: 240 seconds) |
15:09:19 | FromGitter | <andreaferretti> is it a niche case? |
15:09:28 | Araq | I always have a configuration file anyway. |
15:09:30 | FromGitter | <andreaferretti> I think most nim projects are written this way |
15:09:33 | dom96 | that's literally what everyone does |
15:10:05 | Araq | well I don't. |
15:10:29 | dom96 | You mostly work on a project that doesn't use Nimble |
15:10:34 | FromGitter | <krux02> Araq: nope mod does not use fmod: http://ix.io/Oft/nim |
15:10:54 | * | Jesin joined #nim |
15:11:21 | Araq | I work on quite some projects. |
15:11:31 | Araq | none that lacks a configuration file. |
15:11:55 | * | Ven`` joined #nim |
15:12:05 | * | pwntus_ is now known as pwntus |
15:12:06 | FromGitter | <andreaferretti> by a configuration file do you also mean a nimble file |
15:12:07 | FromGitter | <andreaferretti> ? |
15:12:18 | * | pwntus quit (Changing host) |
15:12:18 | * | pwntus joined #nim |
15:12:21 | FromGitter | <andreaferretti> because all my projects have nimble files, none of them has a .cfg file |
15:12:27 | Araq | a .nims or a .nim.cfg file |
15:12:41 | FromGitter | <andreaferretti> i don't have any of those |
15:12:50 | FromGitter | <andreaferretti> i have a nimscript file called foo.nimble |
15:12:52 | Araq | ok but you do have a .nimble file, so there :P |
15:12:58 | FromGitter | <andreaferretti> ah ok |
15:13:00 | FromGitter | <andreaferretti> that's good |
15:15:14 | dom96 | Araq: ugh, why are you now arguing for the removal of --nimblePath? |
15:15:28 | Araq | I am not |
15:15:32 | dom96 | You are |
15:15:56 | Araq | no, I want something like --var instead of --pkgPath because it's more flexible |
15:16:15 | dom96 | I don't understand your latest argument then |
15:16:27 | dom96 | But I'm still unconvinced |
15:16:49 | dom96 | --pkgPath/--stdPath is the more strict implementation |
15:16:56 | dom96 | if we want we can always make it more flexible in the future |
15:17:02 | dom96 | we can't go the other way around |
15:17:42 | Araq | well I disagree. all we can do with the inflexible solution is to add more features |
15:18:00 | Araq | I want one "too powerful" feature and be done with it |
15:18:30 | Araq | and that is exactly what did happen in the past. |
15:18:35 | Araq | we had --path |
15:18:35 | dom96 | That's my point, you want to create this flexible feature because of some imaginary problem in the future |
15:18:40 | Araq | then we needed --nimblePath |
15:18:45 | Araq | then --noNimblePath |
15:18:49 | Araq | and now --pkgPath |
15:19:09 | Araq | come on, at least my solution makes the old shit redundant in theory |
15:19:20 | dom96 | it doesn't |
15:20:08 | dom96 | by 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:34 | dom96 | the idea is to give tools the necesssary hooks to make it easy on the user |
15:20:51 | dom96 | not to give the user more tools to make things less obvious |
15:21:21 | Araq | the original problem was that I am unable to say import pkg / random |
15:21:32 | Araq | I fail to see how a config file change deals with that |
15:22:14 | Araq | but ok, if I use the fact that --path is an ordered search |
15:22:22 | Araq | then it might work out indeed. |
15:22:28 | Araq | with 'import random' |
15:22:32 | dom96 | Well, I was referring to your "old shit" comment |
15:22:40 | dom96 | which I interpreted as referring to --nimblePath |
15:22:56 | Araq | no, it also refers to --path |
15:24:29 | Araq | maybe 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:44 | Araq | I fail to see how an explicit mapping makes things worse |
15:27:07 | dom96 | because --path is already established |
15:27:43 | Araq | established but requires --pkgPath. --var is a single feature that covers both. |
15:32:21 | Araq | but 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:56 | dom96 | no, we will need a way to disambiguate between packages |
15:33:04 | dom96 | I have always wanted this |
15:33:10 | dom96 | I thought you were going to implement it this way |
15:33:11 | Araq | and in the future "no namespace nimble packages" are inspected to use sane names |
15:33:18 | dom96 | but you implemented this weird $thing, then rolled it back |
15:33:31 | dom96 | added 'std', called it a day and now you're complaining that you have to implement another thing |
15:33:49 | Araq | well the person who does the work is allowed to complain about the work |
15:33:57 | dom96 | true |
15:34:08 | dom96 | And fair enough |
15:35:02 | FromGitter | <GULPF> about the mod/div discussion - I already have a PR for changing `mod` for floats to use fmod |
15:35:08 | Araq | let's face it. 'import random' for a nimble package never was a good idea |
15:35:10 | FromGitter | <GULPF> https://github.com/nim-lang/Nim/pull/7118 |
15:35:38 | dom96 | So does that mean you'll remove 'std'? |
15:35:48 | Araq | when the established meaning of 'import foo' was local import or stdlib import. |
15:36:00 | Araq | (already ambiguous btw) |
15:36:05 | FromGitter | <krux02> Araq: how do I set a fucntion to just emit some code for the target language? |
15:36:30 | dom96 | import pkg/random, std/random, ./random # is the perfect tri-fecta IMO |
15:36:32 | FromGitter | <krux02> @gulpf: ah yes sorry for that |
15:37:53 | dom96 | We already have 'std' |
15:38:02 | dom96 | and we should have had 'pkg' |
15:38:35 | dom96 | And there should have been a way to tell the compiler "This is a 'std' path" and "this is a non-std path" |
15:38:44 | Araq | import dir/random # kaboom |
15:38:56 | dom96 | ? |
15:38:58 | Araq | 'std' and 'pkg' are introduced as pseudo directories |
15:39:11 | Araq | it's not a perfect tri-fecta |
15:39:21 | Araq | it leaves out an important case. |
15:39:29 | dom96 | which is? |
15:39:38 | Araq | import someOtherSubDir / random |
15:39:55 | dom96 | wut |
15:40:00 | dom96 | why wouldn't that work? |
15:40:19 | Araq | it would but it proves it's not all that natural |
15:40:46 | dom96 | well, yeah... 'std' and 'pkg' are special-cases |
15:40:48 | dom96 | '.' isn't |
15:40:52 | Araq | I like the "stlib is just another package" much more conceptually. |
15:41:19 | Araq | and then 'std' and 'pkg' is a weird beast. |
15:41:24 | dom96 | okay, I was happy with that |
15:41:28 | dom96 | and then you said "no" in that issue |
15:41:57 | dom96 | But that would still leave us hanging on the 'pkg' disambiguation front |
15:42:39 | dom96 | Hrm |
15:42:41 | Araq | the pkg disambiguation is solved by --var |
15:42:55 | Araq | --var:jester=dom96/jester |
15:42:56 | Araq | vs |
15:43:00 | Araq | --var:jester=araq/jester |
15:44:09 | dom96 | that's a very obtuse way to solve it |
15:44:15 | Araq | or --var:jester=$nimble/araq/jester |
15:44:35 | Araq | depending on how Nimble's solution looks like. |
15:45:34 | Araq | krux02: proc foo() = {.emit: """code here""".} |
15:45:47 | Araq | but I think I misunderstand your question, krux02 |
15:47:58 | dom96 | I'd prefer to disambiguate in the code rather than via some flag |
15:48:15 | Araq | but then you're back at the original problem |
15:48:20 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:48:20 | Araq | violating DRY. |
15:48:42 | Araq | (which might be acceptable) |
15:48:58 | Araq | there is not a single point where you import dom/jester |
15:49:02 | dom96 | also, what if I want to import std/random in one module, but pkg/random in another? |
15:49:41 | * | athenot joined #nim |
15:50:00 | Araq | you 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:03 | dom96 | In fact |
15:51:05 | dom96 | this cannot work |
15:51:11 | dom96 | I'll tell you why |
15:51:32 | dom96 | What if Jester (or some other package) wants 'pkg/random' but my program wants std/random? |
15:51:38 | dom96 | That is sure to happen |
15:51:49 | dom96 | library packages cannot have configuration files |
15:52:00 | Araq | then it's not pkg/random, but random/random |
15:52:11 | Araq | that Jester imports |
15:52:20 | dom96 | ? |
15:52:34 | dom96 | What does 'random/random' mean? |
15:52:45 | Araq | well as I said |
15:52:57 | Araq | import random to mean "import nimble's random" |
15:53:02 | Araq | was a bad idea to begin with. |
15:53:33 | Araq | and no patch really works for it. |
15:54:08 | dom96 | I feel like you're missing the point |
15:54:14 | dom96 | This disambiguation needs to happen in the code |
15:54:21 | dom96 | Otherwise libraries cannot disambiguate |
15:54:52 | dom96 | You can't have `import random` mean two different things in two different modules |
15:55:05 | Araq | never argued otherwise |
15:55:12 | Araq | I am aware of this point. |
15:55:54 | Araq | but the Nimble package lists its dependencies |
15:55:57 | * | floppydh quit (Quit: WeeChat 2.0.1) |
15:55:58 | FromGitter | <krux02> Araq: thanks, it is solved. I think I was looking for importcpp "# % #". Gulpf already did that for `mod`. |
15:56:26 | Araq | and so 'import pkg / random' would usually work since the Nimble file contains the dependency to the random package |
15:56:50 | Araq | and the random package is unique, nimble enforces it. |
15:57:00 | FromGitter | <krux02> Gulpf: can you add an entry to the changelog.md in your pull request? |
15:57:18 | dom96 | You keep forgetting that some users compile via nim |
15:57:32 | dom96 | and that Nimble doesn't get rid of the stdlib 'random' from the path |
15:57:37 | Araq | no, I am not. |
15:57:55 | Araq | import pkg / random fails if there is no random nimble package. |
15:58:17 | Araq | well |
15:58:22 | * | solitudesf joined #nim |
15:58:25 | Araq | what are you arguing about? |
15:58:28 | Araq | import random |
15:58:29 | Araq | or |
15:58:36 | Araq | import pkg / random ? |
15:59:08 | dom96 | You seem to be proposing that users will disambiguate by writing `import random` and --var:random=~/.nimble/... |
15:59:30 | dom96 | right? |
15:59:48 | dom96 | or are we back to the 'pkg'/'std' implemented via --var idea? |
15:59:53 | Araq | kind of, but no, I mean |
16:00:11 | Araq | yes, that would work but only as a workaround and not in a nimble package |
16:00:39 | Araq | usually you would resolve a package name, not a module name |
16:00:47 | Araq | via --var |
16:01:09 | dom96 | You'd need this 'pkg'/'std' to be convention |
16:01:19 | dom96 | so flexibility offered by --var is pointless |
16:01:30 | Araq | you can use it to make 'import random' mean 'import .nimble/.../random.nim' |
16:01:42 | dom96 | but why would I? |
16:01:48 | Araq | but it's a bad idea because it should mean "import from stdlib" |
16:01:54 | dom96 | yes |
16:01:56 | dom96 | exactly |
16:02:01 | Araq | why would you? to make code compile quickly. |
16:02:13 | Araq | when you can't be bothered to fix it properly :P |
16:02:27 | Araq | (maybe random was recently added to the stdlib) |
16:02:37 | dom96 | so you change it to 'pkg/random' |
16:02:42 | dom96 | it's not hard to search and replace |
16:02:46 | Araq | the flexibility offered |
16:02:49 | dom96 | and it's the correct fix |
16:02:56 | Araq | is mostly for username support. |
16:03:13 | Araq | IMO. |
16:03:29 | dom96 | Like I said, it's not necessary |
16:03:38 | dom96 | username support can be handled by Nimble |
16:04:11 | dom96 | and we don't know if we truly want it yet |
16:04:29 | PMunch | Username support? |
16:04:50 | dom96 | scoped packages |
16:05:15 | Araq | ok, how about this. we keep 'std' because it allows to say |
16:05:30 | Araq | "import from stdlib, not my local random.nim file" |
16:05:41 | Araq | and leave the rest as it is now? |
16:05:46 | * | Ven`` quit (Read error: No route to host) |
16:05:50 | Araq | and fix the random nimble package |
16:05:55 | dom96 | No |
16:05:58 | * | Ven`` joined #nim |
16:06:02 | Araq | what problems would it cause? |
16:06:04 | dom96 | You've already suggested this and I said 'no' |
16:06:16 | dom96 | You yourself said that we will run into this problem in the future |
16:06:35 | Araq | hmm |
16:06:45 | Araq | well |
16:06:48 | PMunch | Mabye put up an RFC on GitHub? You've been discussing this all day :P |
16:06:49 | Araq | no. |
16:07:07 | dom96 | lol |
16:07:15 | dom96 | and RFC will take months |
16:07:15 | Araq | we won't run into this problem if Nimble gets stricter about "packages without namespace" |
16:07:29 | Araq | to which you never really replied. |
16:07:39 | dom96 | But I don't want to write `import jester/jester` :P |
16:07:39 | FromGitter | <krux02> the easier it is to just use someone's code. The better it is. |
16:08:29 | Araq | yeah, ok. I'm not gonna add more features just because 'import jester / jester' looks a bit ugly |
16:08:48 | Araq | especially since the features are not wanted anyway. |
16:09:14 | Araq | IMO import jester / _ could be added to deal with that |
16:09:25 | Araq | but you don't like that either anyway, so why bother. |
16:09:29 | dom96 | lol |
16:09:38 | dom96 | another feature to make it slightly better but still ugly |
16:09:54 | dom96 | when a package vs stdlib path distinction makes sense anyway |
16:10:09 | dom96 | I am still wondering how 'std' works currently |
16:10:10 | FromGitter | <krux02> dom96 whas do you really want or need. |
16:10:24 | FromGitter | <krux02> you two are arguing for quite a while now and it doesn't seem to settle. |
16:10:27 | dom96 | How does it know what is the stdlib and what isn't? |
16:10:32 | FromGitter | <krux02> sometimes it better to just sleep about it. |
16:10:49 | FromGitter | <krux02> Like I did and I changed my mind about the `mod` operator |
16:11:08 | PMunch | How about if nothing matches "jester" then "jester/jester" is attempted? |
16:11:12 | FromGitter | <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:44 | PMunch | Or to put it another way, if it's not found in the stdlib then look for a namespaced version in nimble |
16:12:19 | Araq | then jester still needs to be patched to allow import jester/jester |
16:12:21 | * | couven92 quit (Ping timeout: 264 seconds) |
16:12:23 | Araq | and so does random. |
16:12:31 | PMunch | Why? |
16:12:39 | PMunch | Both jester/jester and jester would work |
16:12:39 | dom96 | Araq: How does 'std' distinguish stdlib paths and other paths? |
16:12:56 | Araq | because 'import jester' is a shortcut for 'import jester / jester' the long winded version needs to work too |
16:13:11 | Araq | and the short version of 'import random' is what got us into this trouble in the first place. |
16:13:19 | PMunch | Araq, not really |
16:13:23 | Araq | I can say 'import random/random' |
16:13:33 | Araq | yes, really. |
16:13:53 | PMunch | Oh shit, I've literally got to run |
16:13:56 | * | PMunch quit (Quit: Leaving) |
16:14:00 | dom96 | PMunch: I would need to modify the jester repo and move --- |
16:14:01 | dom96 | okay then |
16:14:12 | FromGitter | <krux02> I don't really understand the problem |
16:14:34 | dom96 | krux02: there is no way for me to import the 'random' nimble package |
16:14:42 | Araq | dom96, https://github.com/nim-lang/Nim/blob/devel/compiler/modulepaths.nim#L150 |
16:15:24 | dom96 | Araq: hm |
16:15:32 | FromGitter | <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:50 | Araq | nimble enforces a unique package name but then might not use it as the namespace |
16:16:15 | Araq | it's like nimble is fine with the 80% solution |
16:16:29 | dom96 | that's not really fair, 'import random' is enforcing the namespace |
16:17:00 | dom96 | the problem is that the stdlib is in the "global" namespace |
16:17:41 | Araq | yes but the stdlib came first and so took the most convenient syntax possible |
16:17:56 | Araq | and actually it wasn't a namespace either |
16:17:59 | dom96 | yes, and I can't fault you for that |
16:18:06 | Araq | it's what --path allows |
16:18:37 | * | yglukhov quit (Remote host closed the connection) |
16:19:01 | dom96 | This is such a simple change |
16:19:09 | dom96 | from what I can tell |
16:19:15 | dom96 | based on the code you've shown me |
16:19:32 | dom96 | we can reuse --path for packages |
16:19:54 | dom96 | and add --stdPath, change the config file, change the modulepaths code slightly, add another if for 'pkg', done. |
16:20:25 | FromGitter | <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:53 | dom96 | krux02: Have you read the Nimble readme? Most of that is documented |
16:21:11 | FromGitter | <krux02> well I did, but it was quite a while ago. |
16:23:51 | * | fvs joined #nim |
16:26:54 | Araq | what if the Nim compiler read the .nimble file properly. would it make things simpler? |
16:27:16 | Araq | then nimble doesn't have to teach it how to resolve pkg / foo |
16:27:35 | FromGitter | <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:01 | Araq | krux02: well it's a package manager. |
16:28:06 | Araq | what else is there to say about it? |
16:28:12 | dom96 | Araq: No |
16:28:19 | Araq | it's like a wife. can't live with one, can't live without one. |
16:28:19 | FromGitter | <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:50 | dom96 | krux02: sure, that's a good question. |
16:29:22 | FromGitter | <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:22 | FromGitter | <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:20 | FromGitter | <krux02> Simply answer the most important question: "Why do I need to care about nimble" |
16:34:50 | * | MJCaley joined #nim |
16:35:32 | Araq | IMO a real documentation page would be more important, I'm fed up with gitub pages |
16:35:49 | Araq | but whatever ... now what do we do with 'pkg'? nothing? |
16:36:18 | FromGitter | <krux02> I am OK with github pages. The content is what I care about. |
16:36:21 | * | Jesin quit (Quit: Leaving) |
16:36:39 | dom96 | I guess we should sleep on it |
16:36:49 | dom96 | I'm tired of discussing this |
16:37:25 | FromGitter | <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:48 | FromGitter | <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:18 | FromGitter | <krux02> @Vindaar I have no idea what you are talking about. |
17:09:05 | FromGitter | <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:15 | FromGitter | <Vindaar> Here: https://gist.github.com/Vindaar/f5cb17a6c47f6d4cdf3a4995ce2bf3ae |
17:25:18 | shodan45 | it's the anti-Nim! https://hackaday.com/2018/02/22/quickbasic-lives-on-with-qb64/ |
17:28:33 | Araq | Vindaar: candidate for terminal.nim? |
17:28:41 | Araq | seems 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:28 | FromGitter | <Vindaar> Yeah, that was the intention. Should I make a PR? |
18:02:36 | * | Zevv joined #nim |
18:03:19 | Zevv | Hi, is there a reason that the nim source files do not have a newline at the end? |
18:03:42 | Zevv | This 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:43 | Araq | Zevv, usually they do |
18:11:57 | Zevv | yeah, once more I'm complaining too early without investigating properly |
18:12:04 | Zevv | that's because you guys are too helpful |
18:12:11 | Zevv | it's easier to ask then to figure it out myself :) |
18:14:00 | * | SenasOzys joined #nim |
18:14:53 | Zevv | my vim messes things up |
18:14:54 | Zevv | :set noendofline |
18:14:57 | Zevv | that's new to me |
18:16:43 | Zevv | sorry 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:09 | shashlick | what'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:51 | dom96 | shashlick: you mean share files? |
18:45:02 | * | dashed_ is now known as dashed |
18:48:10 | shashlick | yep, share a test build of an app |
18:53:05 | dom96 | Maybe this? https://send.firefox.com/ |
19:06:54 | shashlick | nice |
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:34 | Calinou | that one's pretty nice, but files don't last long |
20:19:39 | Calinou | they last 14 days on https://transfer.sh/ |
20:19:45 | Calinou | (plus, it has a CLI available) |
20:20:07 | Calinou | shashlick: ^ |
20:23:51 | * | yglukhov joined #nim |
20:30:11 | * | dddddd quit (Ping timeout: 276 seconds) |
20:34:19 | dom96 | so I have a git repo URL such as https://github.com/nimble-test/multi.git |
20:34:29 | dom96 | Is there a natural way to specify a subdirectory within that git repo inside this URL? |
20:36:12 | shashlick | Calinou: that's nice |
20:37:06 | * | Vladar quit (Quit: Leaving) |
20:38:02 | Calinou | dom96: you can't clone a subdirectory directly |
20:38:16 | dom96 | yes, I know |
20:38:19 | Calinou | Git submodules allow referencing a Git repository commit inside another repository, and cloning it when passing --recursive |
20:38:26 | Calinou | (or `git submodule --update init`) |
20:38:36 | dom96 | but is there a URL convention that would allow me to specify the subdirectory naturally? |
20:38:45 | dom96 | GitHub kind of screws this up for HTTPS urls |
20:38:46 | dom96 | hrm |
20:38:52 | Calinou | not that I know of |
20:40:44 | * | dddddd joined #nim |
20:44:30 | dom96 | https://github.com/nimble-test/multi.git/alpha |
20:44:48 | dom96 | Rule: look for *.git and use the rest as the subdirectory, too hackish? |
20:45:35 | Araq | Nimble already has two URLs in its JSON description |
20:45:43 | Araq | "url" and "web" |
20:45:51 | dom96 | yeah, so I could add another field called "subdir" as well |
20:45:55 | Araq | make "url" the URL and "web" the starting point? |
20:46:12 | Araq | but then why does the "root" matter? |
20:46:26 | dom96 | what? |
20:46:33 | Araq | can't I have |
20:46:39 | Araq | https://github.com/nimble-test/multi.git/alpha |
20:46:40 | Araq | and |
20:46:43 | Araq | https://github.com/nimble-test/multi.git/beta |
20:46:47 | Araq | as 2 Nimble packages? |
20:46:54 | dom96 | yes |
20:46:56 | dom96 | that's the idea |
20:47:11 | Araq | so ... you don't have to implement anything? |
20:47:20 | dom96 | yes I do |
20:47:25 | Araq | and what? |
20:47:26 | dom96 | You can't just ask git to clone that |
20:47:57 | Araq | ah ok |
20:48:05 | Araq | so yeah, do it as you described |
20:48:24 | dom96 | it's hacky though |
20:48:31 | dom96 | https://github.com/nimble-test/multi/alpha # won't work |
20:48:31 | Araq | why? |
20:48:44 | Araq | that's ok |
20:49:10 | Araq | I think it's more hacky if I have to look up what the root is just to be sure |
20:49:35 | Araq | and don't make Nimble ask about the root, it's already chatty and wants to know too much things |
20:49:43 | dom96 | I think a lot of people would argue for adding a separate field to the JSON heh |
20:49:47 | Araq | *too many things |
20:50:00 | Araq | the JSON is not the problem |
20:50:04 | dom96 | But I prefer this solution too |
20:50:12 | dom96 | Because I can easily install on the command line |
20:50:16 | Araq | the problem is that you then need to ask the programmer about it eventually. |
20:50:34 | dom96 | I don't think that's a problem |
20:50:40 | dom96 | You won't ever need to ask the programmer that |
20:50:54 | Araq | how could you avoid it? |
20:51:07 | Araq | if the URL is allowed to be ambiguous? |
20:51:07 | dom96 | I know that yglukhov would prefer requires("https://github.com/nimble-test/multi", subdir="alpha") |
20:51:25 | Araq | that is not a solution. |
20:51:32 | yglukhov | ? |
20:51:33 | Araq | that is the REAL hack. |
20:52:04 | dom96 | yglukhov: we're discussing how to handle nimble packages that are not at the root of a git repo |
20:52:33 | Araq | so ... how is the poor user of a package supposed to know about |
20:52:40 | Araq | requires("https://github.com/nimble-test/multi", subdir="alpha") ? |
20:53:16 | dom96 | well, this only applies to packages not in the registry |
20:53:29 | yglukhov | ok, that sounds like something i would prefer. =) even though i can't see a single reason to do that. |
20:53:30 | dom96 | You'd need to know the url needs to have '/alpha' appended |
20:53:56 | dom96 | But I do too prefer https://github.com/nimble-test/multi/alpha |
20:54:04 | Araq | a URL is full of cruft already, the '.git' won't kill anybody |
20:54:23 | dom96 | *https://github.com/nimble-test/multi.git/alpha |
20:54:36 | yglukhov | dom96: how do you know which part of url is git url or subpath |
20:54:49 | dom96 | Everything after *.git/ is subpath |
20:55:00 | Araq | yeah, please go with that |
20:55:06 | dom96 | hrm |
20:55:10 | dom96 | but what about hg |
20:55:19 | Araq | hg is dead. |
20:55:19 | yglukhov | what if the package is served by git url which does not end in .git? |
20:55:30 | Araq | then make it end in .git. |
20:55:45 | yglukhov | =) |
20:55:48 | Araq | or maybe just require the dot in there |
20:55:54 | Araq | foo.bar/path/here |
20:56:19 | yglukhov | whats the point in a subpath package anyway? |
20:56:25 | yglukhov | =) |
20:56:28 | dom96 | monorepos |
20:56:43 | yglukhov | like it should mean anything to me? |
20:56:45 | Araq | you don't have to have 5 github entries |
20:57:01 | dom96 | Everything in a single massive repo |
20:57:03 | Araq | for a single larger package that consists of 5 different but related parts |
20:57:38 | yglukhov | why are those separate packages then? and not a single package? |
20:58:20 | dom96 | https://github.com/zserge/webview/pull/111#issuecomment-367561320 |
20:58:29 | * | rokups quit (Quit: Connection closed for inactivity) |
20:59:09 | dom96 | (scroll up) |
21:01:22 | dom96 | Maybe I should use // as a delimiter |
21:01:30 | dom96 | https://github.com/nimble-test/multi//alpha |
21:01:48 | yglukhov | dom96: is it "requires" syntax you're talking about? |
21:02:05 | yglukhov | and nimble install syntax? |
21:02:07 | Araq | so ... because github ignores the '//'? |
21:02:12 | dom96 | yes |
21:02:16 | Araq | and it's generally ignored in URLs? |
21:02:37 | dom96 | Araq: Yeah, because in URLs it's generally ignored |
21:02:43 | Araq | I prefer the dot |
21:02:46 | * | el_tejon joined #nim |
21:03:13 | dom96 | I'd use : but that is already used by git/hg |
21:03:26 | dom96 | [email protected]:nimble-test/multi.git |
21:03:43 | Araq | well if you remove the special syntax in Nimble before you make the request |
21:03:49 | dom96 | oh, it's only used by git: ssh://[email protected]/BitPuffin/linagl |
21:04:09 | dom96 | yeah, I will of course remove it |
21:04:20 | Araq | then you can use whatever you want to. |
21:04:55 | dom96 | https://github.com/nimble-test/multi/(/alpha) |
21:04:56 | dom96 | :P |
21:05:17 | Araq | #/ perhaps |
21:05:40 | dom96 | ahh yes |
21:05:43 | Araq | not sure if that can cause conflicts or not but #/ is for SPAs, right? |
21:05:55 | dom96 | or... |
21:05:59 | dom96 | ?subdir=/alpha |
21:06:14 | Araq | can URLs have comments? :P |
21:06:40 | * | arthurz joined #nim |
21:06:40 | dom96 | I think query key/values work perfectly here |
21:06:47 | dom96 | and give us the basis for other parameters |
21:08:10 | dom96 | wow, that confuses git |
21:09:05 | dom96 | hg actually detects it and gives a nice error |
21:09:13 | dom96 | abort: unsupported URL component: "subdir=/alpha" |
21:09:52 | dom96 | git tries to clone into multi?subdir=/alpha |
21:10:10 | dom96 | oh well, that does actually make sense |
21:10:26 | dom96 | So anyway, any objections? |
21:16:15 | yglukhov | not 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:42 | dom96 | What would you propose? |
21:38:46 | yglukhov | dom96: you have already said for myself =) |
21:39:37 | yglukhov | requires("https://github.com/nimble-test/multi", subdir="alpha") |
21:40:58 | yglukhov | another option is to forbid multi-package repos |
21:41:13 | * | Trustable quit (Remote host closed the connection) |
21:42:37 | yglukhov | tbh i still fail to understand the reason behind it. creating a git repo is not much harder than a new nimble file |
21:46:26 | yglukhov | but 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:43 | Araq | I 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:40 | dom96 | Thought that would be easier to implement |
22:46:44 | FromGitter | <Vindaar> Well, here we go, opened a PR for getPassword: https://github.com/nim-lang/Nim/pull/7254 |
22:46:51 | FromGitter | <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:36 | dom96 | Nothing to be scared of :) |
22:51:41 | dom96 | Thanks 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:08 | FromGitter | <Vindaar> Haha, no worries. :D I'm off to bed now. good night! |
22:57:15 | dom96 | 'night! |
22:57:23 | dom96 | So I think it's about time I release a new Nimble version |
22:58:06 | FromGitter | <zacharycarter> :shipit: |
23:19:23 | dom96 | https://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:46 | GitDisc | <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:36 | GitDisc | <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 |