00:06:23 | * | brson joined #nim |
00:17:05 | a5i | When was Nim added to coding ground? |
00:22:20 | onionhammer | reactormonk resolve locally, sub-package lists |
00:23:05 | * | brson quit (Quit: leaving) |
00:39:09 | renesac | oh, nimble have tags |
00:39:19 | renesac | I never noticed it |
00:39:27 | renesac | *has tags |
00:46:24 | * | mpthrapp joined #nim |
00:50:36 | * | mpthrapp quit (Ping timeout: 240 seconds) |
01:09:24 | reactormonk | onionhammer, resolve locally? sub-package lists? |
01:09:32 | reactormonk | what do you mean by either of those? |
01:12:32 | * | rational quit (Quit: Lost terminal) |
01:17:30 | onionhammer | reactormonk; I mean when u do nimble install *packagename* it would install it into the folder you're currently in (in .nimble/ or something), unless you install globally (ala npm) |
01:17:55 | onionhammer | reactormonk sublists meaning the packagelist can reference other json lists of packages |
01:17:58 | reactormonk | onionhammer, so you want to have per-project packages? |
01:18:19 | dom96 | onionhammer: Why do you want this? |
01:18:20 | onionhammer | right |
01:18:37 | reactormonk | can you have multiple versions of a single nimble package installed? |
01:18:44 | dom96 | yes |
01:19:01 | onionhammer | because then you can say "I'm releasing project X, a utility that does X, and depends on Y 1.2.4", but Y 1.2.4 doesnt need to be installed globally for u to build it |
01:19:07 | reactormonk | Can you specify an explicit version dependency? |
01:19:11 | * | endragor joined #nim |
01:19:13 | onionhammer | in case you have Y 2.0 installed also |
01:20:04 | dom96 | onionhammer: you can have both installed globally |
01:20:35 | onionhammer | how do you reference it in code? |
01:20:51 | onionhammer | also when you uninstall X when you're done playing with it, why do I want the old version of Y around? |
01:21:23 | dom96 | you don't reference it in code, you reference it in your .nimble file and then build via nimble build |
01:22:06 | reactormonk | onionhammer, uninstalling isn't too relevant, nimble packages are kinda small. A nimble purge or nimble clean would be nice |
01:22:15 | dom96 | nimble can uninstall that automatically |
01:22:16 | * | saml_ joined #nim |
01:22:18 | onionhammer | how big/small they are is arbitrary |
01:22:28 | reactormonk | onionhammer, so I don't see the need for per-project packages |
01:22:38 | dom96 | it's got enough information to know that no package uses it |
01:22:52 | onionhammer | dom96 interesting |
01:23:06 | dom96 | question is why would I want to install Jester 5 times if I have 5 projects which depend on it? |
01:23:12 | onionhammer | probabloy |
01:23:29 | onionhammer | if you dont want to update all your old projects every time you update jester |
01:23:40 | reactormonk | you don't need it |
01:23:58 | onionhammer | not everybody sets up nimble builds reactormonk |
01:24:17 | reactormonk | onionhammer, are you talking about development or deployment here? |
01:24:21 | onionhammer | both |
01:25:02 | reactormonk | for depolyment it's irrelevant, because you will have a nimble build |
01:25:09 | onionhammer | you will? |
01:25:21 | dom96 | for development you should be building with the latest package anyway |
01:25:29 | onionhammer | dom96 for your NEW project |
01:25:30 | reactormonk | how else will you resolve the .nimble file? |
01:25:35 | onionhammer | yes |
01:25:49 | onionhammer | dom96 but not for your 5 other projects in your ~/projects directory that you arent working on |
01:26:00 | onionhammer | but you might have to do bug fixes for and redeploy |
01:26:52 | dom96 | what other package managers do you know of that allow packages to be installed locally like this? |
01:27:29 | reactormonk | dom96, ruby has the bundler which messes with rubygems to achieve something similar |
01:27:34 | onionhammer | npm |
01:27:46 | onionhammer | nuget |
01:27:56 | def- | dom96: cabal sandboxes do it for Haskell because of cabal hell |
01:28:36 | onionhammer | probably more |
01:28:46 | reactormonk | onionhammer, and what advantages would per-project packaging give you? nimble already does per-project resolution |
01:29:53 | dom96 | I think it would easier to implement 'nimble c file' |
01:30:21 | dom96 | which will build whatever file you want in your project dir with the correct dependencies |
01:31:34 | reactormonk | dom96, how exactly does nimble work? I figured it would just add a few more files to your import search path |
01:31:43 | reactormonk | s/files/folders/ |
01:32:25 | dom96 | The docs describe how it works pretty well I think :P |
01:32:55 | onionhammer | it'd also be cool if nimble never actually crashed :) |
01:33:07 | onionhammer | but instead handled errors and told users what happened |
01:33:33 | dom96 | hrm? When does it crash? |
01:33:57 | dom96 | If you're finding crashes and not reporting them then it's not my fault they happen :P |
01:34:46 | onionhammer | lol |
01:35:12 | onionhammer | i ran a nimble update recently and it crashed, this was while github was being ddosd |
01:38:58 | dom96 | Yeah, and you should have sent me a gist of the error. |
01:40:20 | onionhammer | sorry, next time |
01:40:28 | onionhammer | anyway, i gtg |
01:40:30 | onionhammer | afk |
01:40:58 | dom96 | me too, good night |
01:45:33 | * | endragor quit (Remote host closed the connection) |
01:47:46 | * | Demos joined #nim |
01:49:00 | * | mpthrapp joined #nim |
01:53:52 | * | mpthrapp quit (Ping timeout: 272 seconds) |
02:00:23 | Joe-T | with like npm, you still get the option to install globally, with the -g flag |
02:01:29 | * | BitPuffin quit (Ping timeout: 245 seconds) |
02:04:08 | * | untitaker quit (Ping timeout: 256 seconds) |
02:04:53 | reactormonk | Joe-T, yup, nimble can only install globally |
02:09:18 | * | untitaker joined #nim |
02:11:24 | Joe-T | not sure what a good way of specifying which packages to install globally would be, when running one command that installs all packages listed in a file though |
02:12:16 | Joe-T | unless only ones with versions mentioned are made local or something |
02:15:19 | * | endragor joined #nim |
02:15:28 | reactormonk | Joe-T, all of them are global, nimble just puts the ones you want into your nim path |
02:16:07 | Joe-T | yeah I'm just thinking what it would be like if it did support local |
02:19:34 | * | endragor quit (Remote host closed the connection) |
02:21:04 | * | endragor joined #nim |
02:26:02 | * | endragor quit (Ping timeout: 276 seconds) |
02:32:28 | * | brson joined #nim |
02:32:39 | * | brson quit (Client Quit) |
02:35:02 | * | jholland quit (Quit: Connection closed for inactivity) |
02:45:27 | * | brson joined #nim |
02:45:51 | * | endragor joined #nim |
02:54:08 | * | nande quit (Remote host closed the connection) |
03:01:41 | saml_ | how can I get current time? |
03:02:21 | * | nande joined #nim |
03:03:29 | * | nande quit (Remote host closed the connection) |
03:09:06 | * | flaviu quit (Read error: Connection reset by peer) |
03:09:19 | * | flaviu joined #nim |
03:09:29 | * | nande joined #nim |
03:11:24 | * | brson quit (Quit: leaving) |
03:17:55 | saml_ | lib/pure/times.nim(465, 8) Error: cannot 'importc' variable at compile time |
03:19:37 | saml_ | https://github.com/Araq/Nim/blob/devel/lib/pure/times.nim#L45-L50 what's going on? |
03:31:42 | * | darkf joined #nim |
03:34:46 | * | Demos quit (Quit: leaving) |
04:05:37 | * | saml_ quit (Quit: Leaving) |
04:43:14 | * | a5i quit (Quit: Connection closed for inactivity) |
05:01:40 | * | dtscode is now known as mewtwo |
05:02:41 | * | wb joined #nim |
05:12:02 | * | katis_ joined #nim |
05:47:59 | reactormonk | saml, you're using it a template? |
05:48:18 | reactormonk | or in nim i? |
05:48:49 | reactormonk | both run in the nim vm, and the vm doesn't support FFI, so you can't importc. |
06:33:13 | * | mewtwo is now known as dtscode |
06:52:50 | * | Ven joined #nim |
07:08:13 | * | endragor quit (Ping timeout: 252 seconds) |
07:08:18 | * | endragor_ joined #nim |
07:12:21 | * | ChrisMAN quit (Ping timeout: 248 seconds) |
07:12:41 | * | lyro quit (Quit: WeeChat 0.4.3) |
07:20:38 | * | endragor_ quit (Remote host closed the connection) |
07:27:10 | * | repax joined #nim |
07:30:18 | * | HakanD joined #nim |
07:33:11 | * | darkf_ joined #nim |
07:33:30 | * | BlaXpirit joined #nim |
07:34:35 | * | netroby left #nim ("Leaving") |
07:35:07 | * | nande quit (Remote host closed the connection) |
07:36:13 | * | darkf quit (Ping timeout: 245 seconds) |
07:47:56 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:48:44 | * | Trustable joined #nim |
07:49:18 | * | Trustable quit (Remote host closed the connection) |
07:50:02 | * | Trustable joined #nim |
07:50:23 | * | HakanD quit (Ping timeout: 245 seconds) |
07:50:53 | * | HakanD joined #nim |
07:52:46 | * | darkf_ is now known as darkf |
07:59:48 | * | dtscode is now known as mewtwo |
08:00:16 | * | mewtwo is now known as dtscode |
08:03:33 | * | gsingh93 quit (Ping timeout: 256 seconds) |
08:07:48 | * | Ven joined #nim |
08:21:16 | * | endragor joined #nim |
08:23:25 | * | HakanD quit (Quit: Be back later ...) |
08:33:02 | * | endragor_ joined #nim |
08:34:47 | * | endragor_ quit (Remote host closed the connection) |
08:37:03 | * | repax quit (Quit: repax) |
08:37:18 | * | endragor quit (Ping timeout: 272 seconds) |
08:37:24 | * | endragor_ joined #nim |
08:45:57 | * | HakanD joined #nim |
08:46:28 | * | endragor_ quit (Remote host closed the connection) |
08:47:52 | * | pafmaf joined #nim |
08:48:43 | * | endragor joined #nim |
08:54:34 | * | Pisuke joined #nim |
08:58:33 | * | milosn quit (Ping timeout: 250 seconds) |
09:03:25 | * | TEttinger quit (Read error: Connection reset by peer) |
09:03:44 | * | TEttinger joined #nim |
09:05:07 | * | HakanD_ joined #nim |
09:08:53 | * | HakanD quit (Ping timeout: 246 seconds) |
09:11:48 | * | endragor quit (Remote host closed the connection) |
09:12:15 | * | endragor joined #nim |
09:21:40 | * | pafmaf quit (Quit: This computer has gone to sleep) |
09:21:53 | * | endragor quit (Remote host closed the connection) |
09:24:00 | * | endragor joined #nim |
09:24:12 | * | BlaXpirit quit (Remote host closed the connection) |
09:26:21 | * | BlaXpirit joined #nim |
09:27:42 | * | endragor quit (Remote host closed the connection) |
09:27:44 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:31:42 | * | endragor joined #nim |
09:36:08 | * | endragor quit (Ping timeout: 252 seconds) |
09:38:14 | * | endragor joined #nim |
09:40:02 | * | endragor quit (Remote host closed the connection) |
09:40:24 | * | endragor joined #nim |
09:50:32 | * | endragor quit (Remote host closed the connection) |
09:51:39 | * | endragor joined #nim |
09:54:31 | * | endragor quit (Remote host closed the connection) |
09:59:16 | * | endragor joined #nim |
10:01:56 | * | endragor quit (Read error: Connection reset by peer) |
10:02:02 | * | endragor_ joined #nim |
10:05:39 | * | Matthias247 joined #nim |
10:05:59 | * | endragor joined #nim |
10:06:16 | * | endragor_ quit (Ping timeout: 255 seconds) |
10:12:44 | * | milosn joined #nim |
10:15:18 | * | Pisuke quit (Read error: Connection reset by peer) |
10:16:10 | * | Pisuke joined #nim |
10:18:23 | * | pafmaf joined #nim |
10:19:20 | * | wb quit (Ping timeout: 250 seconds) |
10:27:32 | * | a5i joined #nim |
10:31:47 | * | mpthrapp joined #nim |
10:36:29 | * | mpthrapp quit (Ping timeout: 252 seconds) |
10:41:07 | * | pafmaf quit (Quit: This computer has gone to sleep) |
10:42:20 | * | milosn quit (Ping timeout: 246 seconds) |
10:43:27 | * | Ven joined #nim |
11:00:20 | * | milosn joined #nim |
11:04:19 | * | untitaker quit (Ping timeout: 256 seconds) |
11:07:39 | * | jefus_ joined #nim |
11:09:57 | * | untitaker joined #nim |
11:11:31 | * | jefus__ quit (Ping timeout: 265 seconds) |
11:21:04 | * | milosn quit (Ping timeout: 245 seconds) |
11:22:12 | * | pafmaf joined #nim |
11:22:40 | * | BlaXpirit quit (Quit: Quit Konversation) |
11:33:25 | * | pafmaf__ joined #nim |
11:34:01 | * | HakanD_ quit (Quit: Be back later ...) |
11:36:25 | * | pafmaf quit (Ping timeout: 264 seconds) |
11:40:40 | * | HakanD_ joined #nim |
11:47:47 | * | milosn joined #nim |
11:56:39 | * | Pisuke quit (Max SendQ exceeded) |
11:57:30 | * | pafmaf__ quit (Quit: This computer has gone to sleep) |
11:57:49 | * | Pisuke joined #nim |
12:01:29 | * | pafmaf_ joined #nim |
12:03:04 | * | wb joined #nim |
12:07:46 | * | pafmaf_ quit (Quit: This computer has gone to sleep) |
12:16:27 | * | HakanD_ quit (Quit: Be back later ...) |
12:16:56 | * | pafmaf_ joined #nim |
12:20:49 | * | Kingsquee quit (Quit: Konversation terminated!) |
12:21:14 | * | BitPuffin joined #nim |
12:23:24 | * | novist quit (Ping timeout: 272 seconds) |
12:33:14 | * | a5i quit (Quit: Connection closed for inactivity) |
12:42:17 | * | pafmaf_ quit (Quit: This computer has gone to sleep) |
12:43:37 | * | milosn quit (Ping timeout: 264 seconds) |
12:46:09 | * | federico3 charges again at async |
12:51:01 | * | a5i joined #nim |
12:53:49 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:55:29 | * | milosn joined #nim |
12:57:47 | * | mpthrapp joined #nim |
13:00:35 | * | Ven joined #nim |
13:04:13 | * | repax joined #nim |
13:07:27 | * | milosn quit (Read error: Connection reset by peer) |
13:11:46 | arnetheduck | Araq, well, I only added the deprecation warnings after the review comments :/ I'll follow up with some cleanup anyway |
13:12:01 | def- | arnetheduck: I'm just cleaning it up |
13:12:07 | def- | arnetheduck: nearly done |
13:12:19 | arnetheduck | a question first, the funny \n handling is considered a feature, right? |
13:13:08 | arnetheduck | def-, ah, ok, cool, then I'll stay away until you're done.. these kind of refactorings tend to lead to conflicts unless they're done promptly |
13:13:16 | * | milosn joined #nim |
13:13:26 | arnetheduck | shout if you need me to finish it off... |
13:16:07 | arnetheduck | (ie the fact that \n is sometimes \r\n and sometimes just \n) |
13:16:43 | arnetheduck | and that the compiler tries to output correct line endings for the platform? |
13:18:47 | def- | arnetheduck: Is this ok? https://github.com/Araq/Nim/pull/2483/files?w=1 |
13:19:04 | repax | i.e. an extra \r is included for windows targets? That's the only platform nowadays that I can think of that uses \r |
13:19:38 | repax | And even so, console apps are rather uncommon on windows |
13:20:57 | repax | Perhaps this goes beyond console apps? |
13:22:00 | def- | arnetheduck: any reason we're not just using the standard lib ropes instead? |
13:22:52 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:23:27 | * | Matthias247 joined #nim |
13:26:25 | arnetheduck | \n - compiler ropes have a hack where the format string interprets $n as target-platform-local eol sequence |
13:27:04 | arnetheduck | so until that's removed (and a few other small details, we can't use library ropes, unless library ropes are changed to use the same parsing |
13:27:21 | arnetheduck | but then their parsing will be different from ordinary string %... |
13:27:43 | def- | ok |
13:28:13 | arnetheduck | so my commit was a first step to use the library ropes.. once (if) the other things are sorted, sure the compiler ropes should simply be removed, and things should "just work" |
13:36:39 | arnetheduck | repax, notepad on windows apparently still doesn't take unix newlines |
13:40:42 | repax | I suppose notepad is a valid use case. I can't say how important, though. |
13:42:41 | arnetheduck | dunno, but it feels like life would be more simple if \n was always \n, and if that's an issue, if the compiler didn't bother to try to output the correct line ending for the generated c files, since c compilers don't care, in general |
13:43:16 | fowl | does visual studio mind it? |
13:43:44 | * | pafmaf joined #nim |
13:44:25 | arnetheduck | no.. some older visual studios had a really annoying bug where pasting into a unix line ending file would have you end up mixed.. this was a few years ago so one can hope they fixed it |
13:46:02 | arnetheduck | def-, your pull req looks fine.. you missed the false case of the ~ template, but that doesn't really matter |
13:56:06 | * | milosn quit (Ping timeout: 244 seconds) |
13:59:04 | saml | import times; const t = epochTime() this doesn't compile |
13:59:19 | saml | reactormonk, https://gist.github.com/saml/3d576990b19501d5f08a this doesn't compile |
13:59:24 | renesac | saml: C FFI don't works at compile time |
13:59:56 | renesac | why do you want to get the time at compile time? |
14:01:00 | renesac | maybe you meant a "let startTime = epochTime()"? |
14:02:35 | * | flaviu quit (Remote host closed the connection) |
14:03:52 | * | pafmaf quit (Quit: This computer has gone to sleep) |
14:04:40 | * | flaviu joined #nim |
14:07:57 | repax | Perhaps you can convert the CompileDate and CompileTime constants. But you don't get the same precision, I think. |
14:10:10 | * | endragor_ joined #nim |
14:13:18 | * | endragor quit (Ping timeout: 245 seconds) |
14:13:41 | * | endragor_ quit (Read error: Connection reset by peer) |
14:13:54 | * | endragor joined #nim |
14:17:42 | saml | renesac, ah. i see |
14:18:39 | saml | http://nim-lang.org/tut1.html#the-let-statement i see it now |
14:24:56 | * | brson joined #nim |
14:33:25 | * | TEttinger quit (Ping timeout: 248 seconds) |
14:36:52 | * | pcarlesi joined #nim |
14:36:52 | * | pcarlesi is now known as nortiero |
14:37:46 | * | nortiero left #nim (#nim) |
14:45:22 | * | egrep is now known as egrepnix |
14:46:04 | * | egrepnix is now known as egrep |
14:46:07 | Araq | arnetheduck: a few years ago *most* C compilers on windows wouldn't eat LF |
14:46:17 | Araq | and required CR-LF |
14:46:33 | Araq | that's the reason for $n |
14:55:34 | arnetheduck | Araq, yeah, it does look like history rearing its ugly head (though it does sound odd with a c compiler that doesn't like lf).. more interesting is, is it still needed? |
14:56:20 | arnetheduck | also, is the \n handling in the language a feature for the future? |
14:56:38 | Araq | yeah |
14:56:50 | Araq | I like it and nobody convinced me it's a bad idea |
14:57:10 | Araq | what's the point of \n if it's only an alias for \L ? |
15:01:02 | * | endragor quit (Remote host closed the connection) |
15:04:18 | arnetheduck | what's the point of having \L at all, and a non-standard \n? that's not how it works in c/c++/python/haskell/ruby/etc at least, so I'd say most people expect it to work a certain way |
15:04:25 | federico3 | looks like I can't divide two TimeIntervals or cast them to floats |
15:05:47 | arnetheduck | specially for c interop, where it's so easy to import c functions, having \n work differently feels like a pretty big gotcha |
15:06:35 | flaviu | arnetheduck: Don't use windows and you won't have any problems with that :P |
15:08:16 | * | mwbrown joined #nim |
15:10:32 | arnetheduck | I don't, except for gaming :) but it sure looks odd.. the other way around would be less surprising.. like a special escape for platform-local newline, and keep \n with its original, pretty much universally agreed upon meaning |
15:12:30 | flaviu | arnetheduck: I agree that that'd be better |
15:12:49 | renesac | https://www.python.org/dev/peps/pep-0278/ <-- python i/o |
15:16:35 | Araq | well yes, Nim's \n works better :P |
15:16:35 | renesac | you have os.linesep to discover that returns the current line ending convention |
15:16:43 | * | milosn joined #nim |
15:17:00 | Araq | that's the price of improving things, the old stuff is different |
15:17:30 | Araq | as a result we have no binary vs text mode nonsense in our IO lib |
15:18:40 | Araq | \n # like in C but don't use that, use \N instead which works properly with Nim's IO ?! that's not simpler for anybody in practice, that's *harder* to work with |
15:19:24 | Araq | every newbie will use just \n and not read the docs |
15:19:57 | flaviu | But it doesn't matter if they use \n. |
15:20:07 | flaviu | Every text editor but notepad supports \n |
15:20:41 | Araq | it matters for other software too, not only notepad |
15:23:35 | arnetheduck | it does? |
15:23:52 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:25:52 | Araq | even if not, it doesn't matter. what's *your* argument again? that it's a "gotcha" for C interop that nobody ever encountered? |
15:26:06 | Araq | how is that a "gotcha"? |
15:26:27 | * | egrep is now known as coreutil |
15:26:36 | * | coreutil quit (Changing host) |
15:26:36 | * | coreutil joined #nim |
15:28:22 | renesac | I will side with araq, though it needs to be documented better |
15:29:19 | * | coreutil quit (Quit: Error -38: Black hole has swalled this client.) |
15:30:16 | * | egrep joined #nim |
15:31:32 | repax | Generating two different files depending on platform might cause confusion for tools doing comparisons, checksums etc |
15:34:17 | repax | Might there be a burden in maintaining two sets of implementations for ropes etc? |
15:36:25 | arnetheduck | well, it's a gotcha that \n can be more than one char for anyone who's ever seen a different programming language :) it's a little bit like \ vs / in paths.. or utf8 vs everything else.. in the end it tends to be easier to have one way of representing a trivial concept ("let's start a new line" in this case), and if any conversion is needed for reasons of antiquity, do the conversion as late as possible so that the logic dealing with it can be made |
15:36:25 | arnetheduck | more simple... |
15:36:27 | renesac | oh, python 3 changed to be more what nim does |
15:36:56 | renesac | https://docs.python.org/release/3.2/library/functions.html#open <-- see the newline parameter |
15:40:11 | * | darkf quit (Quit: Leaving) |
15:41:37 | arnetheduck | renesac, how is it more nim-like? python does what I just described (by default), converts early / late, and lets \n be single-char as far as possible, in code ("\nx"[1] == "x" is guaranteed) |
15:42:18 | renesac | hum, indeed |
15:43:55 | renesac | yeah, that last snipped ought to work, and will, but only in unix... |
15:44:15 | renesac | (or better, only in not windows) |
15:46:59 | arnetheduck | except nim, that snipped will work cross platform in most major languages, I'd say.. but anyway, before this goes too far, I readily admit that I don't have the larger picture here for Nim specifically. it struck me as odd, but Nim also seems to be a language in evolution, so above all, I wanted to know if this was slated for removal, or if it was considered a "good thing" |
15:49:05 | arnetheduck | in the context of the compiler, and the ropes lib, if ropes are to be a substitution for strings, with %/$ working mostly the same (so that one can switch between ropes and strings effortlessly), the special handling of $n/$N would have to go, and that would mean dropping target newline flavour support |
15:51:08 | * | banister joined #nim |
15:52:22 | * | Ven joined #nim |
15:54:27 | * | ChrisMAN joined #nim |
15:55:07 | arnetheduck | and if nim worked like most other langs I know, I'd be putting single-char \n everywhere, and if I needed that to be converted for some antique tool that doesn't cope with different newlines (in a today's webby heterogeneous world), I'd do that somewhere separate so that it could be isolated for that particular use case (like in the depths of the io lib) |
15:59:04 | * | endragor joined #nim |
16:02:39 | Araq | bash doesn't execute scripts which have CR-LF. interop is a problem everywhere, not just windows |
16:03:41 | Araq | arnetheduck: when I use some other IO lib, I use binary mode and do the newline ending on my own because this way a program on windows can deal with CR, CR-LF, LF out of the box. So Nim just uses my best practice really. |
16:04:38 | Araq | and I don't want some crazy transformations "in the depths of the IO lib" because that's slow and unnecessary |
16:05:50 | Araq | also HTTP uses CR-LF, not LF. you're also completely missing the point of $n. The point is generate CR-LF on *linux* for *windows*. No IO abstraction can do that. |
16:07:22 | renesac | Open(file, newline="\r\n") |
16:07:33 | flaviu | ^ |
16:07:50 | Araq | renesac: that assumes I know the file's newline ending a priori |
16:08:15 | Araq | in other words: it completely misses the point. |
16:08:18 | flaviu | When it comes to IO, performance isn't really an excuse. Even SSDs will be much slower than the CPU. |
16:09:11 | renesac | then Open(file, newline=""), like binary mode |
16:09:16 | Araq | flaviu: performance is one of the few objective things in computing and as such is always a valid excuse. |
16:09:41 | renesac | then you can discover your fille newline ending |
16:10:06 | Araq | renesac: I don't need to "discover" it. handling all three variants at the same time is trivial. |
16:10:21 | renesac | then Open(file), in python 3 |
16:10:35 | Araq | so python 3 does it like Nim :P |
16:10:43 | * | milosn quit (Quit: Lost terminal) |
16:10:49 | renesac | does like arnetheduck said |
16:11:03 | renesac | convert to the plataform line ending and back on the io level |
16:11:03 | * | HakanD joined #nim |
16:11:11 | * | milosn joined #nim |
16:11:17 | flaviu | Araq: See https://docs.python.org/release/3.2/library/functions.html#open and the default parameters |
16:11:34 | renesac | I don't think a simple search and replace is that costly for an io layer |
16:11:49 | renesac | and you can aways use the binary mode if performance is important |
16:12:07 | Araq | renesac: yep. exactly. I always use binary mode. because text mode is stupid as fuck. |
16:12:24 | renesac | text mode is convenient |
16:12:36 | renesac | for most processing |
16:14:51 | arnetheduck | Araq, actually, that's exactly what the python io abstraction does.. in code you use a single newline char, and then, when writing to file, the io module let's you choose how to translate it, so when generating windows files on linux, you give it a special param) |
16:15:50 | * | gsingh93 joined #nim |
16:15:52 | Araq | arnetheduck: ok, fair enough |
16:16:24 | * | elbow_jason quit (Remote host closed the connection) |
16:16:37 | Araq | I still like my way better. my open doesn't require 17 different modes of opening a file |
16:17:03 | Araq | but "simplicity" is only a valid reason when everybody-else-except-Araq is doing it |
16:18:33 | flaviu | Araq: We can't complain about the things we like in Nim :) |
16:22:34 | arnetheduck | anyway, we've established the meaning of $n - the question remains, is it still useful? is there any (supported/used) compiler/ out there which in 2015 doesn't support different newlines, that Nim wants to support? |
16:23:27 | * | pafmaf joined #nim |
16:24:50 | arnetheduck | else, it seems like a good candidate for removal.. then, ~ can be implemented using the usual rope function instead of %.. having ~r translate to r % [] is slow for the common case, and sucks because stuff like ~somestring is unsafe, because somestring might have $'s in it if it comes from an unvalidated source |
16:24:50 | renesac | Error: \n not allowed in character literal <-- at least it warns me |
16:25:48 | arnetheduck | (for example, in the compiler on can't use ~sym.name.s to get a rope) |
16:28:02 | * | pafmaf__ joined #nim |
16:28:10 | * | gokr joined #nim |
16:28:24 | renesac | but yeah, I don't like the plataform specific newline stuff contaminating all string manipulation logic by default... |
16:30:06 | renesac | but I agree that if everybod-else-did-it I would probably not complain about this |
16:31:02 | * | pafmaf quit (Ping timeout: 264 seconds) |
16:31:37 | * | elbow joined #nim |
16:32:25 | * | elbow is now known as elbow_jason |
16:34:30 | endragor | there is no standard TreeSet implementation in Nim, right? |
16:34:44 | fowl | renesac, '\L' is allowed |
16:35:10 | fowl | .eval echo "\n" == "\L" |
16:35:13 | Mimbus | fowl: true |
16:38:07 | arnetheduck | and, back a few lines, the "gotcha" is that nim is different from everyone else - \n has a well-established meaning and in nim it's different, so one has to be careful, and will do copypaste mistakes.. hence the gotcha |
16:41:22 | * | HakanD_ joined #nim |
16:41:22 | * | HakanD quit (Read error: Connection reset by peer) |
16:41:33 | Araq | I'm not careful with \n in Nim and it works for me. |
16:42:12 | * | pregressive joined #nim |
16:42:19 | Araq | it's however a nice topic for our weekly FUD campaign in #nim |
16:43:09 | fowl | Araq, when i started using windows more all grammars i wrote with glossolalia failed because i checked '\L' as newline instead of "\L\r" ._. |
16:48:03 | * | jholland joined #nim |
16:50:09 | renesac | while we are talking about FUD, is there a possibility to make "proc shl[T](a: var T, b: T) = a = a shl b" ? |
16:50:22 | renesac | I know the compiler won't alow me do define it |
16:50:53 | renesac | is a reason why it can't be maede available? |
16:51:16 | renesac | this together with the command syntax alleviates my critcism on the lack of "<<" like operators in nim |
16:51:24 | renesac | *would alleviate |
16:53:08 | fowl | so you can do cout << ... << ...? |
16:53:21 | renesac | note the definition of my proc |
16:53:32 | renesac | so I can do "h <<= 33" |
16:53:35 | fowl | yea i dont get it |
16:53:44 | fowl | why dont you define `<<=` then |
16:53:46 | renesac | instead of "h = h << 33" |
16:53:58 | * | pafmaf__ quit (Quit: This computer has gone to sleep) |
16:53:58 | renesac | because it won't be an assigment operator |
16:54:04 | renesac | it would be a comparison operator |
16:54:05 | renesac | IIRC |
16:54:16 | flaviu | .eval template shl_eq(x, y: expr): stmt = x = x shl y |
16:54:18 | Mimbus | flaviu: <no output> |
16:54:20 | renesac | or an arrow like operator |
16:54:23 | flaviu | That should work. |
16:54:26 | flaviu | I think. |
16:54:55 | fowl | renesac, ends in = it has precedence of assignment operators |
16:55:25 | renesac | starts in < |
16:55:29 | renesac | is a comparison operator |
16:55:30 | fowl | anyways |
16:55:32 | fowl | it works |
16:56:40 | fowl | proc `<<=` (a:var int; b:int) = a = a shl b; var a = 1; a <<= 1; assert a == 2 |
16:56:44 | fowl | .eval proc `<<=` (a:var int; b:int) = a = a shl b; var a = 1; a <<= 1; assert a == 2 |
16:56:45 | Mimbus | fowl: eval.nim(4, 1) Error: ')' expected |
16:56:50 | renesac | If the operator ends with = and its first character is none of <, >, !, =, ~, ?, it is an assignment operator which has the lowest precedence. |
16:56:50 | renesac | |
16:56:50 | renesac | Otherwise precedence is determined by the first character. |
16:57:32 | renesac | I know that because I've tried to override that |
16:57:41 | renesac | and I was able for a time with templates, but then it broke again |
16:57:59 | renesac | using expr, not int or any thing type checked |
16:58:18 | fowl | .eval import macros;dumplisp: 1 <<= 2 += 4 |
16:58:20 | Mimbus | fowl: StmtList(Infix(Ident(!"+="), Infix(Ident(!"<<="), IntLit(1), IntLit(2)), IntLit(4))) |
16:59:01 | renesac | haven't tried macros |
17:00:08 | Araq | renesac: use shiftLeft instead of shl? |
17:00:34 | renesac | Araq: much less convenient |
17:00:34 | * | HakanD_ quit (Read error: Connection reset by peer) |
17:00:36 | Araq | or shiftL or whatever |
17:00:59 | renesac | there is a reason why we don't write "x.addequals(2)" |
17:01:06 | renesac | and preffer "x += 2" |
17:01:42 | renesac | or equivalenly "x = x add 4" |
17:02:32 | Araq | so use |<<= :P |
17:02:54 | renesac | Araq: I was asking if there was a reason not to offer this for keyword operators |
17:03:13 | renesac | as it seems an invalid syntax right now |
17:03:19 | renesac | that could be useful |
17:03:44 | Araq | well nobody requested it yet |
17:03:56 | Araq | need to look into the grammar |
17:04:11 | renesac | ok, it can be for after 1.0 I think |
17:05:09 | renesac | as I won't convince you to dump those clunky keyword operators in favour of C/python style ones anyway |
17:05:10 | renesac | ;) |
17:06:19 | renesac | as you don't use them often |
17:07:27 | renesac | for me the same argument to have "+" instead of "add" or "plus" would be valid for having "<<" instead of "shl" |
17:08:00 | renesac | *same arguments |
17:08:07 | Araq | again the argument is simplicity of operator parsing rules. << is obviously a comparison operator. |
17:09:01 | Araq | it even means "much less than" in math. just because C jumps off the bridge, that's not a reason for Nim to do the same |
17:11:00 | renesac | ok, and then you have that one, valid, argument against it |
17:11:13 | Araq | and again I wonder what kind of programs you write. << is simply not a useful operator, it's used for setBit or multiplication |
17:11:54 | renesac | or move bunch of bits at the same time |
17:11:55 | renesac | etc |
17:11:57 | Araq | and a setBit proc/template is not that hard to come up with and use instead |
17:12:33 | renesac | yeah, I have one set bit |
17:12:39 | renesac | *setbit |
17:12:53 | renesac | but for hashing you use << |
17:13:08 | flaviu | renesac: How often do you write hash functions? |
17:13:08 | renesac | for writting that setbit you use << |
17:13:41 | renesac | anyway, the things I want to write in nim is because they would be too slow in python |
17:14:01 | renesac | and in those things I'm usually treating with bytes, not numbers |
17:15:22 | renesac | and shr is useful for division by powers of two, especially if you are using signed ints |
17:15:37 | renesac | where the compiler can't optimize it for you |
17:16:49 | flaviu | renesac: So define an optimized int type, and write a `/` method that optimizes divison the way you want. |
17:17:06 | flaviu | semistatic seems to be made for this exact situation. |
17:17:10 | renesac | I preffer to be explicit |
17:17:14 | renesac | semistatic is no more |
17:18:34 | renesac | anyway, the last time I was coding in nim I wanted to help blaxprit write his Random library, giving him a log2 proc for integers, and needed bitshift there too |
17:18:49 | renesac | (and had some problem I don't remember what and din't finished it) |
17:20:20 | renesac | I passed to him the last version that partially worked though... |
17:24:20 | renesac | well, and data compression, bit granularity streaming, etc |
17:24:28 | renesac | anyways, it always come up for me |
17:30:10 | * | 5EXAAXYM0 joined #nim |
17:45:07 | Araq | renesac: you can use *< and *> and it's quite "logical" this way cause the precedence should be like * |
17:48:24 | Araq | and fwiw C completely lacks a bitwise rotation operator |
18:00:00 | federico3 | https://developerblog.redhat.com/2015/04/07/jit-compilation-using-gcc-5-2/ |
18:00:35 | endragor | Araq: do you usually implement hash() proc for standard library types? Rational doesn't have one, and I'm not sure if it's an intention or oversight |
18:02:12 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:09:45 | Araq | endragor: usually I don't but only because I'm lazy |
18:12:44 | * | yalla12 joined #nim |
18:21:14 | * | Pisuke quit (Ping timeout: 272 seconds) |
18:25:10 | * | Pisuke joined #nim |
18:26:09 | renesac | Araq: *> is arrow like right now, and I know you already asked me to do a PR correcting that |
18:26:24 | Araq | ok |
18:26:36 | renesac | but changing only that isn't that good |
18:26:57 | renesac | as there is "xor" and all that left |
18:27:37 | renesac | and mantaining an hackish operator library while the language rightly changes under your feet isn't very good either |
18:28:43 | renesac | it seems that #!strongSpaces wont be a big thing in the future |
18:29:22 | flaviu | I really don't see the problem here. |
18:29:30 | renesac | as you are already correcting the "echo $x" problem with a toned down version of it |
18:29:30 | flaviu | Is foo = foo shr 1 really that bad? |
18:29:58 | renesac | flaviu: about as bad as "foo = foo add 1" |
18:30:22 | Araq | people are too scared of strong spaces and I usually listen to people even though I pretend to not do that |
18:31:35 | flaviu | renesac: That's not that bad. |
18:31:37 | renesac | and strong spaces isn't compatible with keyword operators |
18:31:49 | renesac | flaviu: yeah, it is possible to live with |
18:31:53 | EXetoC | if you completely ignore the usage frequence yes |
18:31:55 | Araq | renesac: I intend to fix that though, haven't forgotten about your bug report |
18:32:22 | renesac | Araq: I don't mean that, but also "echo not 1" fails to compile |
18:32:33 | renesac | right now |
18:32:56 | Araq | that's not different from echo $1 |
18:33:01 | renesac | and the unary precedency rule regarding spaces won't change that |
18:33:15 | renesac | yeah, but "echo $1" will be corrected |
18:33:29 | Araq | aha ok |
18:33:37 | EXetoC | as in #!strongSpaces will never be implicit? |
18:33:49 | Araq | EXetoC: I don't think so. |
18:34:47 | renesac | is ! being used as an unary operator right now? |
18:34:56 | * | user7181 joined #nim |
18:35:01 | * | MyMind joined #nim |
18:35:14 | Araq | I don't think so, renesac |
18:35:29 | EXetoC | no point in using then I guess. I assume it'll just result in confusion |
18:35:53 | * | BlaXpirit joined #nim |
18:35:54 | renesac | it has the same precedence as "not" , and is already used in "!=" comparator |
18:36:58 | * | Pisuke quit (Ping timeout: 252 seconds) |
18:37:00 | renesac | that way we could fix the application of all unary operators in the language |
18:37:11 | renesac | at least |
18:37:41 | Araq | s/fix/change |
18:43:46 | * | emilsp quit (Quit: Lost terminal) |
18:48:57 | * | Jehan_ joined #nim |
18:57:03 | * | endragor quit (Remote host closed the connection) |
18:59:04 | * | endragor joined #nim |
19:07:07 | * | MyMind quit (Ping timeout: 256 seconds) |
19:08:44 | * | repax quit (Quit: repax) |
19:12:26 | * | BitPuffin quit (Ping timeout: 265 seconds) |
19:14:41 | renesac | continuint the nitpicking, it is interesting how Nim and C reached the same bitwise and/or/xor operator precedence over comparison by different paths |
19:15:06 | renesac | that C creators recognized as unfortunate |
19:16:20 | renesac | at least in nim it will cause a compilation error not using parenthesis, while in C it will likely lead to an unintended result |
19:19:52 | Araq | also there are good reasons for Nim whereas in C it's completely arbitrary anyway |
19:20:11 | renesac | for C it was backwards compatibility |
19:20:33 | Araq | with what? B? BCPL? |
19:20:39 | Araq | older C? |
19:20:45 | renesac | with B and older C |
19:21:02 | renesac | originally, C didn't had && and || operators |
19:21:33 | renesac | with short-circuit semantics |
19:22:20 | renesac | so it made sense to have | and & operators with lower precedence than == |
19:23:16 | renesac | http://stackoverflow.com/questions/4685072/operator-precedence-bitwise-lower-than |
19:24:35 | Jehan_ | Well, there are certainly advantages to the Smalltalk approach to operator precedence as the other extreme, too. :) |
19:25:08 | renesac | in D they also have lower precedence, but in Python, Rust, Swift, Go,.. they corrected it |
19:25:40 | * | eigenlicht quit (Quit: WeeChat 0.3.2) |
19:25:44 | renesac | and &, | and ^ have higher precedence than ==, but lower or equal precedence to * |
19:28:17 | renesac | and & always have higher precedence than | or ^ |
19:28:43 | renesac | well, in nim "and" has higher precedence than or/xor too |
19:28:51 | Jehan_ | In Smalltalk, all operators have the same precedence. :) |
19:30:28 | Jehan_ | That said, what you generally want for convenience is: logical operators < relational operators < arithmetic/bit operators. |
19:30:45 | renesac | yeah |
19:30:50 | Jehan_ | The biggest problem is sorting out the precedence for the various arithmetic/bit operators. |
19:31:34 | Jehan_ | Other than + and - being below * and /, things are pretty much up for grabs. |
19:32:13 | * | vendethiel joined #nim |
19:34:29 | renesac | well, go uses only two precedence levels for arithmetic, then one for relational, and two again for logical (mantains && higher than ||) |
19:34:53 | renesac | it is the simplest I've seen (except for smalltalk or lisp of course) |
19:35:36 | * | Strikecarl joined #nim |
19:37:12 | Strikecarl | Can someone help me using RegQueryValueExA |
19:37:34 | renesac | it is interesting that swift gives << higher precedence than *, while rust gives it lower precedence |
19:38:18 | renesac | oh, D also gives it lower precedence than + - |
19:39:21 | renesac | Strikecarl: it seems you are making this question for some days now |
19:39:25 | renesac | what is that? |
19:39:38 | Strikecarl | Yea, yesterday i was wondering how you could echo out an REG_SZ |
19:39:46 | Strikecarl | Today i found the RegQueryValueExA |
19:40:08 | renesac | and I have no idea what you are talking about, sorry |
19:40:09 | Strikecarl | Need to feed it with info tho, i dont know what half of it is: key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD, lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG |
19:40:16 | Strikecarl | You don't use windows i guess. |
19:40:29 | renesac | oh, windows registry |
19:40:29 | BlaXpirit | i'm annoyed by this. |
19:40:45 | renesac | well, I don't know |
19:40:58 | Strikecarl | All good renesac. |
19:41:06 | Strikecarl | I dont know anyone atm using windows with NIM <.< |
19:41:16 | renesac | varriount? |
19:41:19 | flaviu | Strikecarl: Gotta think in hungarian notation :P |
19:41:35 | Strikecarl | What flaviu ? |
19:42:25 | flaviu | Don't mind me, I'm just making fun of the hungarian notation the windows api loves so much. |
19:42:37 | * | yalla12 quit (Quit: Leaving) |
19:43:00 | dom96 | Strikecarl: I'm using Nim on Windows. |
19:43:12 | flaviu | https://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx might be useful |
19:43:17 | Strikecarl | dom96, do you have any experience using the registry with NIM? |
19:43:27 | dom96 | Nope, sorry. |
19:43:41 | dom96 | If you follow the docs flaviu posted you should be able to get something working. |
19:43:43 | Strikecarl | flaviu, its the same data i need it to spoonfeed, lemme read it. |
19:44:12 | Strikecarl | wait |
19:44:16 | Strikecarl | ReqQueryValueEx |
19:44:25 | Araq | Strikecarl: it's not hard but tedious. registry.nim would make a good Nimble package |
19:44:39 | Strikecarl | I first have to find the right one, |
19:44:47 | Strikecarl | as the one i am looking at doesnt seem to do the job. |
19:45:27 | Strikecarl | nvm it is |
19:45:29 | dom96 | Strikecarl: Try looking for examples in C/C++, converting them to Nim shouldn't be too difficult. |
19:45:52 | Strikecarl | dom96, it's the same proc name, which is why i think i can use it. |
19:46:09 | Strikecarl | ReqQueryValueEx in C++. |
19:46:25 | Strikecarl | Wait, nvm i am retarded. |
19:50:35 | * | endragor quit (Remote host closed the connection) |
19:50:38 | EXetoC | flaviu: yeah the wrong kind of hungarian |
19:59:37 | Strikecarl | meh |
19:59:41 | Strikecarl | i give up for today |
19:59:42 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:19:41 | * | ChrisMAN quit (Remote host closed the connection) |
20:27:18 | * | ChrisMAN joined #nim |
20:28:40 | * | lyro joined #nim |
20:33:13 | * | lyro quit (Client Quit) |
20:33:18 | * | pipeep quit (Ping timeout: 245 seconds) |
20:37:13 | * | lyro joined #nim |
20:40:49 | * | pipeep joined #nim |
20:41:26 | * | Ven joined #nim |
20:43:39 | * | 5EXAAXYM0 quit (Quit: This computer has gone to sleep) |
21:17:41 | * | pafmaf joined #nim |
21:26:10 | * | wink-s joined #nim |
21:45:26 | * | lyro quit (Ping timeout: 252 seconds) |
21:53:15 | * | a5i quit (Quit: Connection closed for inactivity) |
22:01:10 | * | Jehan_ quit (Quit: Leaving) |
22:03:38 | * | Kingsquee joined #nim |
22:05:28 | renesac | oh, I discovered a trick in github |
22:05:53 | renesac | appending ?w=0 makes nim commit diff pages readable again |
22:06:04 | renesac | ignores changes in whitespace |
22:07:03 | renesac | https://github.com/ReneSac/Nim/commit/e41a3e966151cf7c399c747af120cae3482bb793?w=0 |
22:07:13 | * | gsingh93 quit (Ping timeout: 250 seconds) |
22:07:16 | renesac | this is another application for it |
22:08:09 | renesac | I wonder if I can make that default |
22:08:31 | * | Senketsu_ joined #nim |
22:08:44 | * | pregressive quit (Read error: Connection reset by peer) |
22:08:49 | flaviu | renesac: Probably not, but you can write a userscript to do it, I think. |
22:08:51 | * | Senketsu quit (Read error: Connection reset by peer) |
22:09:03 | * | mwbrown quit (Ping timeout: 264 seconds) |
22:09:09 | * | pregressive joined #nim |
22:09:23 | * | nulpunkt quit (Read error: Connection reset by peer) |
22:10:27 | * | Jehan_ joined #nim |
22:11:03 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:11:07 | * | reactormonk quit (Ping timeout: 250 seconds) |
22:12:21 | * | reactormonk joined #nim |
22:18:15 | dom96 | I always thought it was ?w=1 |
22:20:14 | * | gokr quit (Quit: Leaving.) |
22:20:15 | * | nulpunkt joined #nim |
22:21:59 | * | pregressive quit () |
22:22:52 | flaviu | w=18029483029 also works. Coincidence? I think not! ;) |
22:23:53 | gmpreussner|work | haha |
22:25:24 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:29:29 | * | Trustable quit (Remote host closed the connection) |
22:29:34 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:31:44 | * | nulpunkt quit (Ping timeout: 250 seconds) |
22:36:57 | * | flaviu quit (Remote host closed the connection) |
22:39:10 | * | flaviu joined #nim |
22:40:36 | * | nulpunkt joined #nim |
22:47:56 | * | vendethiel quit (Ping timeout: 240 seconds) |
23:04:33 | * | ChrisMAN quit (Ping timeout: 245 seconds) |
23:07:57 | * | jefus__ joined #nim |
23:09:18 | * | jefus__ is now known as jefus |
23:09:47 | * | pafmaf quit (Quit: This computer has gone to sleep) |
23:09:57 | * | Jehan_ quit (Quit: Leaving) |
23:11:36 | * | jefus_ quit (Ping timeout: 252 seconds) |
23:12:59 | * | saml_ joined #nim |
23:19:08 | * | BitPuffin joined #nim |
23:24:37 | * | user7181 quit (Quit: leaving) |