00:03:44 | FromGitter | <Quelklef> So, question |
00:03:53 | FromGitter | <Quelklef> How do macros, like, work? |
00:04:00 | FromGitter | <Quelklef> Are they interpreted? |
00:04:15 | FromGitter | <Quelklef> I mean, I can use seqs of NimNodes inside of a macro |
00:04:25 | FromGitter | <Quelklef> but a seq and all of its operations are kind of a runtime concept |
00:04:31 | FromGitter | <Quelklef> and macros happen before runtime |
00:05:16 | FromGitter | <Quelklef> With Lisp, I just handwaved it because I figured that the interpreted nature of lisp would allow it to kind of mix compiletime with runtime, so a "runtime" function could be used "normally" within a macro |
00:05:31 | FromGitter | <Quelklef> But Nim is compiled, so it must be doing something else... |
00:06:10 | * | shashlick quit (Remote host closed the connection) |
00:06:27 | * | shashlick joined #nim |
00:21:12 | * | wildlander joined #nim |
00:25:19 | FromGitter | <rayman22201> tehe. I love this question :-P |
00:25:32 | FromGitter | <Quelklef> why lol |
00:25:51 | FromGitter | <rayman22201> It's one of those questions that blows peoples minds |
00:26:02 | FromGitter | <Quelklef> ahhhhhh |
00:26:11 | FromGitter | <rayman22201> It's that inception feeling |
00:26:47 | FromGitter | <rayman22201> So first of all, yes macros are interpreted. Nim has a vm |
00:26:59 | FromGitter | <rayman22201> so does lisp :-P |
00:27:43 | FromGitter | <Quelklef> Interesting |
00:28:03 | FromGitter | <Quelklef> I had half-assumed since there's no "nim interpreter" (except `nim secret`), it wouldn't have one internally |
00:28:18 | FromGitter | <Quelklef> But alright, continue. blow my mind |
00:28:37 | FromGitter | <rayman22201> Well, the problem is that the Nim VM is meant for macros, not for REPLS |
00:28:49 | FromGitter | <rayman22201> that's why it's nim secret |
00:28:54 | FromGitter | <Quelklef> Ah, okay |
00:29:01 | FromGitter | <Quelklef> But when I use nim secret, it's the same thing? |
00:29:07 | FromGitter | <rayman22201> same VM, yeah |
00:29:11 | FromGitter | <Quelklef> Cool |
00:29:34 | * | shashlick quit (Remote host closed the connection) |
00:29:49 | FromGitter | <rayman22201> A compiler works like a conveyer belt. "source code / text" -> lexer -> parser -> optimization -> output (machine code / js / whatever) |
00:29:51 | * | shashlick joined #nim |
00:30:09 | FromGitter | <rayman22201> macros let you stick your own step in the middle of the process |
00:30:28 | FromGitter | <rayman22201> so you get ... parser -> macro -> ... |
00:30:54 | FromGitter | <rayman22201> or for reader macros (which Nim does not have, but could have): lexer -> reader macro -> parser ... |
00:31:17 | FromGitter | <Quelklef> Aw geez but you have to parse the reader macro before using the reader macro to parse |
00:31:19 | FromGitter | <Quelklef> anyway, continue |
00:32:00 | FromGitter | <rayman22201> reader macros are weird, it's why pretty much only lisp has them. They let you do cool stuff like invent your own syntax though. anyways |
00:32:55 | FromGitter | <rayman22201> A macro is a function that takes an AST as an argument and returns an AST as an argument. You intercept the conveyor belt basically |
00:33:27 | FromGitter | <rayman22201> it runs in between the compiler phases |
00:34:05 | FromGitter | <rayman22201> Nim does runs the function by passing it to a VM and using the result on the next step of the process |
00:34:24 | FromGitter | <Quelklef> Hmmmm |
00:34:33 | FromGitter | <Quelklef> I think I need to learn more about VMs |
00:35:41 | FromGitter | <rayman22201> learn about interpreters first |
00:35:51 | FromGitter | <rayman22201> VMs are fancy interpreters |
00:36:13 | FromGitter | <Quelklef> ? I thought it was the opposite |
00:36:20 | FromGitter | <Quelklef> Don't interpreters run on VMs |
00:36:22 | FromGitter | <Quelklef> (typically) |
00:39:02 | * | shashlick quit (Remote host closed the connection) |
00:39:16 | FromGitter | <rayman22201> they don't have to |
00:39:17 | * | shashlick joined #nim |
00:41:16 | FromGitter | <rayman22201> I'm simplifying a lot here, but essentially a VM is a interpreter for a very simple language (like say byte-code, to just Java terminology). You write code in a higher level language that, wait for it, gets compiled into byte-code, that is then interpreted by the VM. |
00:42:24 | FromGitter | <Quelklef> right |
00:42:52 | FromGitter | <rayman22201> You could just have "high level language" -> interpret into machine code. |
00:43:06 | FromGitter | <rayman22201> the VM is an abstraction layer |
00:43:22 | FromGitter | <Quelklef> "compile into machine code"? |
00:43:29 | FromGitter | <rayman22201> nope interpret |
00:43:37 | FromGitter | <Quelklef> ?? |
00:43:47 | FromGitter | <Quelklef> What does it mean to "interpret into" somethig |
00:43:48 | FromGitter | <rayman22201> as in, you write x86 assembly code and feed it to the cpu one line at a time, live |
00:43:58 | FromGitter | <Quelklef> hmmmmmmm |
00:43:58 | FromGitter | <rayman22201> well, you don't, the intrepter does |
00:44:27 | FromGitter | <rayman22201> a lot of older dynamic languages used to work this way actually |
00:44:56 | FromGitter | <Quelklef> That's funky |
00:45:31 | FromGitter | <rayman22201> it's actually a lot simpler |
00:46:08 | FromGitter | <rayman22201> it's the simplest way to create a programming language. When I took compilers in college we learned interpreters first. |
00:46:41 | FromGitter | <Quelklef> feeding machine code in real time seems no different from spitting it out into a file for later |
00:47:23 | FromGitter | <rayman22201> it isn't any different |
00:47:41 | FromGitter | <rayman22201> the cpu does not care if you give it one assembly code at a time or a whole files worth |
00:47:56 | FromGitter | <Quelklef> right, so why do you say it's simpler? |
00:47:59 | FromGitter | <Quelklef> or did I misunderstand |
00:48:00 | FromGitter | <rayman22201> well it does.... cpu caches and branch predictors and all that... but lets keep it simple :-P |
00:48:28 | FromGitter | <rayman22201> It's simpler for a programmer to implement |
00:49:07 | FromGitter | <Quelklef> `feed(inst)` vs `write(inst)`? |
00:49:54 | zacharycarter[m] | craftinginterpreters.com |
00:50:23 | zacharycarter[m] | author of Dart |
00:50:26 | zacharycarter[m] | and gameprogrammingpatterns.com |
00:50:27 | FromGitter | <rayman22201> good website. definitely worth going through |
00:50:28 | FromGitter | <Quelklef> ooh, fancy! |
00:51:50 | FromGitter | <rayman22201> `write(inst)` is harder, mostly because of the details. I.E. making a binary file with proper headers for a .exe or linux executable is a pita. |
00:51:52 | zacharycarter[m] | not finished yet - the section about scripting language based in C that he writes is still being written, but I think he actually has an implementation of the VM / scripting language done |
00:52:17 | zacharycarter[m] | but you could get started and unless you read through it super fast, he'll probably have more up before you're finished |
00:52:36 | FromGitter | <Quelklef> Ah, gotcha @rayman22201 |
00:53:47 | FromGitter | <rayman22201> In the "old" days it was less hard. They were much closer. Interpreters are still really useful though. It's good to have both ways. |
00:53:57 | FromGitter | <Quelklef> @zacharycarter I mean, even if it's not totally complete I'm sure there's a lot in there that I'll learn |
00:56:07 | FromGitter | <rayman22201> The other advantage to compiling over interpreting is that you can apply optimizations to the code before it actually runs on the cpu because it's going to a file first. |
00:56:11 | FromGitter | <rayman22201> VM's are an attempt to be the best of both worlds. You get the REPL like instant execution, but it puts a layer in the middle so you can do compiler style optimizations. |
00:57:43 | FromGitter | <Quelklef> I dunno if I buy that |
00:57:51 | FromGitter | <Quelklef> You could optimize without a VM |
00:58:12 | FromGitter | <Quelklef> source --parse>> AST --optimize>> AST --interpret>> result |
00:58:18 | FromGitter | <rayman22201> VM's also let you do real time optimization, which is pretty mind blowing. This is what the Javascript engines do. the VM can detect if you are running the same code through the REPL over and over again (say you have a loop going), and in real time it will optimize that code (that is what JIT is doing) and swap the original code for optimized code |
00:58:35 | FromGitter | <Quelklef> Ok, that's cool |
00:59:37 | FromGitter | <rayman22201> that's why VMs have "warm up" periods where they start slow and get fast after a while. They have to "learn" what your code is doing, and adjust the heuristics. |
00:59:46 | FromGitter | <rayman22201> modern VMs anyway |
01:00:39 | FromGitter | <rayman22201> a simple interpreter is source -> parse -> result. but a VM goes source -> parse -> VM -> optimize -> result |
01:04:55 | FromGitter | <rayman22201> the way Araq wrote the Nim VM is pretty cool, though probably not a good beginner example: https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim |
01:09:35 | FromGitter | <Quelklef> yeah im not sure im ready for nim's inner workings quite yet |
01:12:29 | FromGitter | <rayman22201> something to work up to :-) |
01:12:47 | FromGitter | <Quelklef> Indeed |
01:12:52 | FromGitter | <Quelklef> I'd love to be a serious contributor someday |
01:15:40 | FromGitter | <rayman22201> me too :-) |
01:34:43 | * | CcxWrk quit (Quit: ZNC 1.6.5 - http://znc.in) |
01:37:31 | * | CcxWrk joined #nim |
01:41:23 | FromGitter | <amscotti> Just a fyi, the Nim track on Exercism is now live! đ â You can see it on the languages page, https://exercism.io/#explore-languages |
01:47:37 | * | ftsf joined #nim |
02:09:48 | zacharycarter[m] | amscotti: \o/ |
02:23:12 | * | ieatnerd1 joined #nim |
02:39:50 | * | craigger_ joined #nim |
02:41:23 | * | craigger quit (Ping timeout: 276 seconds) |
02:44:23 | * | gangstacat quit (Ping timeout: 255 seconds) |
02:54:33 | * | ftsf quit (Ping timeout: 244 seconds) |
03:01:35 | * | ieatnerd1 quit (Ping timeout: 268 seconds) |
03:02:35 | FromGitter | <Varriount> @rayman22201 @Quelklef My command shell just interprets AST directly. No bytecode for me. |
03:02:45 | FromGitter | <Varriount> :/ |
03:03:04 | FromGitter | <Quelklef> My HTML doesn't even interpret anything :\ |
03:03:14 | FromGitter | <Quelklef> it just sits there, a sad little AST |
03:04:18 | * | gangstacat joined #nim |
03:24:33 | FromGitter | <Quelklef> What precisely does the `push` pragma do? |
03:25:03 | FromGitter | <Quelklef> Its documentation is about a sentence |
03:25:08 | FromGitter | <Quelklef> I can't find the implementation |
03:35:37 | * | leorize quit (Ping timeout: 245 seconds) |
03:36:51 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
03:40:20 | * | Lord_Nightmare joined #nim |
03:53:10 | FromGitter | <rayman22201> They let you turn on / off compiler flags temporarily |
03:54:47 | FromGitter | <rayman22201> You could {.push boundschecks: off.} for part of your program, and then {.pop.} to turn it back on again |
03:54:52 | FromGitter | <rayman22201> idk where the implementation is though |
04:08:23 | * | leorize joined #nim |
04:08:52 | FromGitter | <Quelklef> Hmmm |
04:08:55 | FromGitter | <Quelklef> That's what I thought |
04:09:04 | FromGitter | <Quelklef> I've seen `{.push importcpp.}` though? |
04:09:12 | FromGitter | <Quelklef> also bout to sleep so @ me if you answer |
05:09:47 | * | nsf joined #nim |
05:13:10 | * | miran joined #nim |
05:15:01 | * | leorize quit (Ping timeout: 260 seconds) |
05:30:51 | * | xylef joined #nim |
05:32:33 | * | Perkol joined #nim |
06:04:11 | * | Vladar joined #nim |
06:13:34 | * | Perkol quit (Quit: Leaving) |
06:22:24 | * | dddddd quit (Remote host closed the connection) |
06:57:27 | * | ieatnerd1 joined #nim |
07:01:57 | * | ieatnerd1 quit (Ping timeout: 240 seconds) |
07:02:22 | FromGitter | <mratsim> @rayman22201 youâre mixing JIT, interpreter and VM. A VM parse/fetch, decode, and execute code |
07:02:43 | FromGitter | <mratsim> an interpreter is the naive way, a JIT does what you call dynamic recompilation |
07:03:19 | FromGitter | <mratsim> an interpreter doesnât start slow and get faster, a JIT does |
07:21:44 | * | nsf quit (Quit: WeeChat 2.1) |
07:43:40 | * | ftsf joined #nim |
07:50:08 | * | xylef quit (Quit: WeeChat 2.2) |
08:13:43 | * | stefanos82 joined #nim |
08:23:21 | * | xylef joined #nim |
08:33:23 | * | wildlander quit (Quit: Konversation terminated!) |
09:03:14 | * | benjikun quit (Quit: Leaving) |
09:23:48 | * | ieatnerd1 joined #nim |
09:28:51 | * | ieatnerd1 quit (Ping timeout: 268 seconds) |
09:55:09 | FromGitter | <tim-st> I saw that many types in stdlib have something like `type TImpl = object ..` and `type T = ref TImpl`. I see when I dont use `ref` my type has to be declared `var` to work with all procs, are there other downsides? |
09:58:47 | FromGitter | <tim-st> I read somewhere that although object it a value type it's not copied by value, so I'm wondering where are the other differences for the example above |
09:59:28 | FromGitter | <tim-st> (not copied by value when I use it as prog param) |
09:59:31 | FromGitter | <tim-st> *proc |
10:04:05 | * | Ven`` joined #nim |
10:10:06 | * | ftsf quit (Ping timeout: 244 seconds) |
10:11:17 | FromGitter | <tim-st> ok, I saw the answer here: http://nim-lang.org/docs/manual.html#procedures-var-parameters ; so a ref object is always on the heap and a non ref passed by var not always |
10:11:53 | * | yglukhov[i] joined #nim |
10:12:01 | FromGitter | <tim-st> so it's better to use non ref for my type |
10:28:35 | * | xylef quit (Ping timeout: 240 seconds) |
10:29:14 | FromGitter | <Varriount> @tim-st Keep in mind that, behind the scenes, objects are usually passed by pointer. (references are usually passed by value, since they're the size of a pointer anyway) |
10:31:19 | * | nsf joined #nim |
10:42:57 | * | leorize joined #nim |
10:56:19 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzzâŚ) |
11:36:15 | * | xylef joined #nim |
11:53:52 | * | dddddd joined #nim |
12:18:32 | zacharycarter[m] | yglukhov: are you around by any chance Yuri? |
12:19:33 | yglukhov[m] | zachary carter: hey |
12:20:07 | zacharycarter[m] | I have a question about jsbind if you don't mind - I'm trying to create a signature for console.log - is there any way to handle JS rest parameters? |
12:20:16 | zacharycarter[m] | I've tried with openarrays / varargs / JSObj but no joy so far |
12:20:33 | zacharycarter[m] | I'm using emscripten btw |
12:20:54 | * | Ven`` joined #nim |
12:22:00 | yglukhov[m] | I don't think so. I'd just format the string on the nim side, and then pass it alone to console.log. |
12:22:14 | zacharycarter[m] | :thumbsup: thank you sir - good idea |
12:28:34 | * | xylef quit (Ping timeout: 260 seconds) |
12:47:08 | FromGitter | <Yardanico> btw, about exercism - https://github.com/exercism/nim/pull/99#issuecomment-406823642 |
12:47:48 | miran | @Yardanico woohoo!! |
12:48:09 | miran | nim, the language with the largest logo :D :D |
12:49:42 | FromGitter | <Yardanico> xD |
12:53:22 | Calinou | hmm, I did some testing comparing `nim c` versus `nim cpp` |
12:53:29 | Calinou | binaries generated using `nim cpp` are slightly larger and slower |
12:53:58 | Calinou | (it's also slightly longer to compile) |
12:58:10 | dom96 | "My logo is bigger than yours!" |
12:58:21 | FromGitter | <Yardanico> maybe they didn't change it to be transparent |
12:59:12 | FromGitter | <Varriount> Calinou: Have you had the chance to any debugging to find out why? |
12:59:18 | FromGitter | <Varriount> *to do |
12:59:23 | Calinou | I don't know how I could debug this |
12:59:27 | Calinou | the C version is plenty fast anyway :) |
12:59:42 | FromGitter | <Varriount> Probably use some sort of C/C++ profiler. |
12:59:42 | Calinou | but I wanted to see if the C++ version was smaller/faster by any chance |
13:00:10 | FromGitter | <Varriount> Calinou: Have you turned on link-time-optimization? |
13:00:21 | miran | @Yardanico please mentor my solution(s) :D |
13:00:34 | Calinou | noâŚÂ how do you do that with Nim? |
13:00:38 | FromGitter | <Varriount> For Nim, that usually makes the file size smaller. It might also make it faster for the C++ backend. |
13:00:45 | FromGitter | <Varriount> Calinou: What C compiler are you using? |
13:00:49 | Calinou | GCC |
13:01:56 | FromGitter | <Varriount> Calinou: Try adding `--passc:"-flto"` to the Nim compiler command |
13:03:09 | Calinou | the binary is smaller, and just as fast, nice :) |
13:03:24 | Calinou | I see a warning when linking though: https://hastebin.com/utayahesiw.txt |
13:04:05 | Calinou | (binary is 178 KB, 79 KB in a .zip, 65 KB in a .tar.xz archive! that's quite impressive) |
13:05:35 | FromGitter | <Yardanico> you may also try upx |
13:05:55 | Calinou | at this point, I don't need it :P plus, it causes false positives in antiviruses on Windows |
13:06:29 | FromGitter | <Varriount> Calinou: Hm, I suspect then there might be some sort of overflow error in a strutil call somewhere. |
13:06:30 | FromGitter | <Yardanico> does it? |
13:06:45 | FromGitter | <Yardanico> @Calinou and yeah, if you need optimizations for size, you can use opt:size |
13:07:09 | FromGitter | <Varriount> Plus, UPX is bad for runtime memory. It prevents the OS from using various paging optimizations to reduce memory usage. |
13:08:19 | Calinou | if I use --opt:size with LTO, the original stripped binary weighs 129 KB, 56 KB in a .zip and 46 KB in .xz :D |
13:16:54 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzzâŚ) |
13:18:58 | Calinou | is there documentation on using MinGW to cross-compile for Windows? |
13:19:20 | Calinou | (I'm setting up Travis CI for uploading releases) |
13:32:37 | * | clyybber joined #nim |
13:38:32 | * | rockcavera quit (Ping timeout: 276 seconds) |
13:47:35 | * | Ven`` joined #nim |
13:50:57 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
13:52:29 | * | BitPuffin joined #nim |
13:52:50 | * | BitPuffin quit (Remote host closed the connection) |
13:53:17 | * | BitPuffin joined #nim |
13:54:03 | * | yglukhov[i] joined #nim |
13:56:56 | FromGitter | <Varriount> Calinou: I would look at documentation on cross-compiling C code first. |
14:00:38 | Calinou | also, wow⌠the binary I compiled on Fedora 28 works on a fresh Ubuntu 14.04 VM |
14:00:53 | Calinou | I thought glibc would have bit me already :P |
14:03:43 | stefanos82 | laugh and cry with me people...we live in the middle of 2018 and glibc still uses K&R internally...I don't know how to react! O.o https://sourceware.org/git/?p=glibc.git;a=blob;f=string/strlen.c;hb=HEAD |
14:04:59 | Calinou | maybe we can do more productive things than laughing and crying over code style? |
14:05:10 | Calinou | the JavaScript community is starting to understand this :) |
14:05:17 | Calinou | (thanks to Prettier) |
14:07:18 | FromGitter | <alehander42> @zacharycarter https://github.com/pragmagic/karax/blob/master/karax/karax.nim |
14:07:20 | FromGitter | <alehander42> look at kout |
14:07:36 | FromGitter | <alehander42> i also didnt know how before i saw it there |
14:10:12 | FromGitter | <alehander42> but i have no idea if this works for ermscripten :D |
14:12:59 | * | TheLemonMan joined #nim |
14:13:06 | stefanos82 | Calinou: true, but what I wanted to point out is that the very first standard came out in 1989 and now we have 2018 and they are in the process to release a bugfix as the next standard, named C17 |
14:13:07 | FromGitter | <alehander42> and i am not sure how does .varargs. work in general |
14:13:30 | Araq | stefanos82: that's not K&R. |
14:13:46 | Araq | size_t STRLEN (const char *str) |
14:13:50 | stefanos82 | Araq: which part exactly? |
14:13:53 | Araq | is a prototype |
14:13:58 | TheLemonMan | does anyone have a windows/osx box and is willing to test some code? |
14:14:21 | Araq | and prototypes were added in the Ansi standard, K&R lacked it |
14:14:41 | stefanos82 | Araq: actually I pasted the wrong link lol |
14:15:17 | Araq | TheLemonMan: ok |
14:16:08 | TheLemonMan | Araq, cool, here's the link: https://github.com/LemonBoy/criterion.nim you should try to execute the example snippet in the readme |
14:20:22 | stefanos82 | Araq: that's the link I should have pasted before, but copied HEAD version somehow O.o |
14:20:23 | stefanos82 | https://sourceware.org/git/?p=glibc.git;a=blob;f=string/strlen.c;h=5f22ce95097d4090c6c32fc7cf6c2ef9cf6e86a8;hb=24c0bf7a76ecec65aca0dbce1f7ebb8f68425dc2 |
14:26:05 | * | xylef joined #nim |
14:26:56 | Araq | criterion/impl.nim(8, 17) Error: cannot open file: criterion/timer |
14:28:25 | Araq | you need to use relative addressing, impl.nim is already in "criterion" and so should import "timer", not "criterion/timer" |
14:28:46 | TheLemonMan | oh, I wonder why it is working here |
14:34:07 | * | xylef quit (Ping timeout: 244 seconds) |
14:44:50 | FromGitter | <Yardanico> @TheLemon I can try on windows it you still need it |
14:44:55 | FromGitter | <Yardanico> @TheLemonMan |
14:45:45 | TheLemonMan | Yardanico, the more the merrier, I also need some feedback on the api design |
14:48:21 | * | ng0 joined #nim |
14:55:04 | FromGitter | <Yardanico> @Calinou there's no documentation about MinGW cross-compilation but it's very easy |
14:55:32 | FromGitter | <Yardanico> Nims example (works for macos/linux, ignore comments): â https://github.com/vk-brain/Nickel/blob/master/src/nickel.nims#L21 |
14:55:54 | FromGitter | <Yardanico> So after you add that to your config you can just do `nim c -d:crosswin myfile.nim` |
15:05:56 | Calinou | is the .nims file used automatically? |
15:06:56 | FromGitter | <Yardanico> if it has the same name as your .nim file - yes |
15:07:08 | FromGitter | <Yardanico> (in this case main file of my program is nickel.nim) |
15:07:25 | Calinou | ok, thanks :) |
15:11:18 | TheLemonMan | any news from the windows land? |
15:15:19 | * | nsf quit (Quit: WeeChat 2.1) |
15:38:14 | * | clyybber quit (Ping timeout: 268 seconds) |
15:40:01 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:40:14 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
15:40:19 | * | edcragg joined #nim |
15:49:11 | * | yglukhov[i] quit (Remote host closed the connection) |
15:51:00 | * | yglukhov[i] joined #nim |
15:55:33 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
15:55:34 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzzâŚ) |
16:05:13 | * | nsf joined #nim |
16:41:47 | * | skrylar joined #nim |
16:42:06 | skrylar | boop |
16:46:46 | * | clyybber joined #nim |
16:47:00 | * | clyybber quit (Client Quit) |
16:49:56 | FromGitter | <viniarck> Hi guys. What's the recommended way to tell nimble to compile my binary with a different name than the file name itself? For example, I have, `bin = @["myPackage/main"]`, I want to keep main.nim but I want my binary to be named something else. Should I use the before and after hooks to accomplish this? |
16:50:29 | FromGitter | <Quelklef> why not just `nim c myPackage/main & mv myPackage/main myPackage/newName`? |
16:51:12 | skrylar | i think nimble is opinionated in this manner |
16:51:22 | FromGitter | <viniarck> Trying to see if there's a way to use only nimble for this |
16:57:16 | * | yglukhov[i] joined #nim |
16:58:02 | FromGitter | <kaushalmodi> create a nimble task and call that `nim c` command + `mv` in there |
16:58:33 | FromGitter | <kaushalmodi> then instead of `nimble build`, do `nimble <mytask>` |
16:59:13 | * | xylef joined #nim |
16:59:14 | FromGitter | <kaushalmodi> though, not sure how `nimble install` will work with that. dom96? |
16:59:15 | FromGitter | <Vindaar> isn't the `--out` compiler flag precisely for this? |
16:59:43 | FromGitter | <kaushalmodi> yes! Use `--out` instead of `mv` |
17:00:35 | FromGitter | <kaushalmodi> may be you have have a nim.cfg for your project where you specify the `--out`. Then you don't need that custom nimble task. I have read about nim.cfg, but am hazy on how to configure it as I haven't yet used it personally |
17:00:44 | FromGitter | <kaushalmodi> *may be you can have a .. |
17:01:52 | FromGitter | <kaushalmodi> @viniarck relevant: https://forum.nim-lang.org/t/3939 |
17:03:17 | dom96 | nimble task won't work with `nimble install` |
17:03:30 | dom96 | after task could work |
17:03:37 | dom96 | `--out` inside nim.cfg might also work |
17:03:41 | dom96 | but I've never tried it |
17:03:59 | FromDiscord | <r00ster> is there some way to multiplicate a string? so that I can make a "hellohellohello" out of one "hello"? |
17:04:12 | FromDiscord | <r00ster> is there some efficient way to multiplicate a string? so that I can make a "hellohellohello" out of one "hello"? |
17:04:50 | FromGitter | <Vindaar> r00ster: https://nim-lang.org/docs/strutils.html#repeat,string,Natural |
17:05:50 | FromGitter | <viniarck> Thanks @kaushalmodi, @Vindaar @dom96, I'll try the --out flag with the .cfg file |
17:05:50 | FromDiscord | <r00ster> ah ok |
17:25:18 | FromGitter | <mratsim> @tim-st in the past you couldnât do `type Foo = ref object` you had to declare in 2 steps |
17:32:22 | FromGitter | <Quelklef> How can I do something like `readLine(stdin)` that doesn't halt execution but instead just returns `""` if there was no input? |
17:32:38 | FromGitter | <Quelklef> i.e. some function to see what the user has entered into the terminal since the last call to the function |
17:35:28 | Calinou | it's working!! https://github.com/Calinou/clr/releases |
17:38:34 | FromGitter | <kaushalmodi> Calinou: Is that a statically linked Linux binary? |
17:38:48 | * | yglukhov[i] quit () |
17:40:33 | FromGitter | <Varriount> yglukhov: I think I'm going to close that high/low tuple PR. |
17:40:35 | Calinou | https://hastebin.com/opurenekim.txt |
17:40:39 | Calinou | works in Ubuntu 14.04 VM too :) |
17:40:48 | Calinou | I just compiled it with the default settings from a Fedora 28 image on GitLab CI |
17:40:58 | Calinou | the binary is uploaded using gothub |
17:41:02 | Calinou | https://github.com/Calinou/clr/blob/master/.gitlab-ci.yml |
17:41:47 | FromGitter | <kaushalmodi> Calinou: Yes, I saw that. But I don't know what your args to `nim` mean in there.. |
17:41:49 | FromGitter | <kaushalmodi> `--passc:"-flto" -y` |
17:41:52 | FromGitter | <Varriount> @Quelklef Hm. Doing that in a cross-platform way is tricky. |
17:42:06 | FromGitter | <Quelklef> @Varriount No problem, only need it for Linux |
17:42:28 | FromGitter | <Varriount> It might be easier just to use a thread and channel to call readline |
17:42:29 | Calinou | it enables link-time optimization |
17:42:42 | Calinou | (smaller/faster binary, at the cost of slower linking and increased RAM usage while linking) |
17:42:43 | FromGitter | <Quelklef> Not familiar with channels. What do you mean? |
17:42:50 | Calinou | -y accepts all prompts :) |
17:42:57 | FromGitter | <kaushalmodi> Calinou: Understood, thanks :) |
17:43:10 | FromGitter | <kaushalmodi> I'm looking for a recipe for static linked binary deployment. |
17:43:31 | FromGitter | <kaushalmodi> I thought this was that. But I like your deployment yml. Thanks for sharing. |
17:46:22 | * | krux02 joined #nim |
17:50:13 | krux02 | Araq: Is it intentional that this code doesn't compile anymore http://ix.io/1i6j |
17:52:01 | * | xylef quit (Ping timeout: 248 seconds) |
17:54:30 | krux02 | I think it comes from the goal to remove `nil` as a valid stade for a NimNode. But it also makes it kind of hard to deal with nil in NimNode. |
18:00:25 | * | yglukhov[i] joined #nim |
18:00:31 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
18:06:21 | FromGitter | <Varriount> @Quelklef Have one thread whose sole purpose is to read lines from the terminal. Have it send lines to the main thread via a channel. |
18:07:21 | FromGitter | <Quelklef> Ah, hmmm |
18:07:46 | FromGitter | <Quelklef> as in just a `while true: let val = readLine(stdin); sendToMain(val)` |
18:07:52 | FromGitter | <Quelklef> ? |
18:10:41 | FromGitter | <Varriount> Yep |
18:10:53 | * | krux02 quit (Read error: Connection reset by peer) |
18:10:59 | FromGitter | <Varriount> Though, that only works if you want complete lines. |
18:10:59 | Calinou | @kaushalmodi the binary isn't 100% static, but from my testing, it should work out of the box on most desktop/server Linux distributions |
18:11:02 | Calinou | barring Alpine, I guess |
18:11:26 | Calinou | I'm still surprised, I thought I'd get a glibc error when trying to run the binary on Ubuntu 14.04 |
18:11:31 | FromGitter | <Quelklef> I don't care about complete lines or not. Thank you @Varriount ! |
18:15:51 | skrylar | why wouldn't it work on alpine? did you do something glibc specific |
18:16:22 | FromGitter | <Varriount> @Quelklef you can also do the same thing, but using read (1) instead of readline |
18:18:02 | FromGitter | <Quelklef> Cool |
18:18:56 | Calinou | how can I set an environment variable for the current process in Nim? |
18:26:32 | * | krux02 joined #nim |
18:28:01 | Calinou | @Yardanico looks like the .nims is working, but it tries to call GCC with an .exe extension, which doesn't work on Fedora with the system-provided GCC |
18:28:05 | Calinou | (the binary doesn't have an .exe extension) |
18:40:36 | Calinou | it works if I create a symlink corresponding to the name requested by the Nim compiler |
18:40:41 | Calinou | but I'd rather not do that if possible :P |
18:41:48 | skrylar | it looks like dear imgui is aligning itself now to debug uis instead of general use :ponders: |
18:41:57 | Calinou | it has been doing so for a while now |
18:42:07 | Calinou | skrylar: I thought Alpine could only run binaries linked to musl |
18:42:53 | skrylar | Calinou, i still hear general advocation for immediate guis so i still try to find things on why it should be used, although it does seem great for the debugging niche |
18:43:11 | skrylar | and yes alpine prefers you use musl; is nim not compatible with muscl? |
18:43:30 | Calinou | it is (there's a Docker image for Nim using Alpine) |
18:44:36 | skrylar | i have wondered for some time if what really bothers people is all the connector code |
18:45:03 | skrylar | like, i could just provide an API that looks like dearimgui but emits FLTK objects (and instead of called every frame, just hooks up cobweb/FRP triggers silently) |
18:45:49 | skrylar | shrug. |
18:45:57 | skrylar | Calinou, are you doing something explicitly incompatible with muscl at the moment? |
18:46:05 | Calinou | not that I know of |
18:46:12 | skrylar | i don't see the problem then :3 |
18:46:27 | Calinou | I just haven't looked into building a library linked to musl |
18:46:41 | Calinou | but all I need is a binary that runs well on old distros, and Nim + glibc seems to handle that well out of the box, surprisingly |
18:46:52 | skrylar | i want to say its binary compatible, but i can't say that authoratatively |
18:47:14 | skrylar | its SUPPOSED to be drop-in compatible, but not "bug compatible" [sic] |
18:48:54 | * | Jesin quit (Quit: Leaving) |
18:49:13 | Calinou | âŚexcept in applications linking to libGL :( |
18:49:19 | Calinou | thanks NVIDIA |
18:50:04 | skrylar | hrm. never tried to use gl on alpine |
18:52:39 | * | Jesin joined #nim |
18:55:21 | * | yglukhov[i] quit (Remote host closed the connection) |
19:04:42 | Calinou | attempting cross-compiling on GitLab CI now :) |
19:04:50 | Calinou | LTO works too |
19:07:51 | FromGitter | <kaushalmodi> Calinou: I happen to have to use a really old OS: RHEL 6.8 |
19:08:30 | FromGitter | <kaushalmodi> It's glibc is older than that on modern unix type OSes |
19:08:51 | skrylar | but the stability :) |
19:09:41 | skrylar | actually as much crap as i give centos and friends for being out of date, the slower moving target actually IS useful for people who have better things to do than continuously chase down CI bugs |
19:11:17 | Calinou | ... clr.nims(9, 22) Error: undeclared identifier: 'findExe' |
19:11:20 | Calinou | I'm getting this in CI |
19:11:25 | Calinou | was findExe added after 0.18.0? |
19:12:34 | Calinou | https://gitlab.com/Calinou/clr/-/jobs/83533521 |
19:12:42 | Calinou | âŚno, it wasn't |
19:16:25 | FromGitter | <Varriount> Are you in importing the right modules? |
19:16:30 | Calinou | it works locally :p |
19:16:41 | Calinou | here's the NimScript: https://github.com/Calinou/clr/blob/master/src/clr.nims |
19:27:31 | FromGitter | <Varriount> Calinou: I believe you need to import ospaths. |
19:27:57 | Calinou | I'll try that, thanks |
19:29:42 | * | Ven`` joined #nim |
19:31:35 | FromGitter | <tim-st> @mratsim thanks |
19:35:21 | Calinou | nope :( https://gitlab.com/Calinou/clr/-/jobs/83535317 |
19:35:23 | Calinou | same error |
19:38:25 | Calinou | findExe is part of `os` apparently |
19:42:25 | FromGitter | <Varriount> Oh, you're not using the devel branch? |
19:42:33 | skrylar | bleh, reading that exception thread |
19:42:50 | skrylar | methinks someone has become blinded by the "must do what embedded coders do" lens |
19:43:03 | Calinou | I can build from devel if needed |
19:43:06 | Calinou | I'm using choosenim already |
19:46:42 | Calinou | I get something different when importing os: https://gitlab.com/Calinou/clr/-/jobs/83536049 |
19:46:47 | Calinou | > lib/posix/posix_linux_amd64.nim(599, 3) Error: cannot 'importc' variable at compile time |
19:46:58 | * | yglukhov[i] joined #nim |
19:52:20 | Araq | skrylar: what works on embedded works everywhere |
19:58:14 | skrylar | short version: 1) the line of reasoning "average people don't use the right error type" is effectively "average people are bad, so no fun allowed" and is the same argument used to suppress macros in every other language, and 2) i guess i just need to do a personal analysis of what the direction of "no GC, mobile-first design" offers and if i still care about that |
19:59:07 | skrylar | i am biased because i believe Lisp and Smalltalk handle errors more correctly (ex. having explicit continue points) than the C++ model |
19:59:48 | * | nsf quit (Quit: WeeChat 2.1) |
20:03:26 | Araq | where do I make the argument "average people don't use the right error type"? |
20:04:43 | Araq | I don't understand your "having explicit continue points" remark |
20:06:43 | skrylar | https://github.com/nim-lang/Nim/issues/8363#issuecomment-406189955 |
20:07:11 | skrylar | > Custom" exceptions are just sophistry and work against composable systems, from the paper: [..] In fact, the "custom" exception DbError is worse than the more generic SyntaxError |
20:08:04 | skrylar | the remark about continue points is that lisp (more than smalltalk, but also) smalltalk not only have custom errors, but these can be either handled with a "oh wait, let me fix that" or trigger other behavior in a dev environment like "you called a nonexistent method, create it?" |
20:09:29 | * | aziz joined #nim |
20:10:19 | Araq | I don't read "average" anywhere in that. |
20:10:29 | Araq | DbError is in the stdlib. |
20:10:45 | Araq | all the things I don't like are in the stdlib |
20:11:41 | Araq | and the quote refers to what was found in other languages. if almost nobody gets it right, then it's a good argument for changing things |
20:12:07 | Araq | this has nothing to do with any "appeal to the masses" or "preventing bad programmers from themselves" |
20:12:58 | Araq | programming languages are for human beings, the machine only requires assembler code to be written. |
20:14:18 | skrylar | i'm not going to bother with this crap. it's your language, you do what you want with it |
20:20:53 | Araq | sure but I'm also listening to the community which includes you. |
20:34:53 | * | miran quit (Quit: Konversation terminated!) |
20:42:27 | * | byte512 quit (Quit: Bye.) |
20:47:58 | * | Ven`` quit (Read error: Connection reset by peer) |
20:48:28 | * | Ven`` joined #nim |
20:48:52 | FromGitter | <viniarck> I didn't find async implementations of the {read,write}File methods on the asyncdispatch library. So, probably threads are the way to go? |
20:49:57 | Araq | we have asyncfile in the stdlib but Linux doesn't have async file IO or something |
20:50:29 | FromGitter | <viniarck> I see. Thanks for pointing that out. |
20:50:59 | FromGitter | <rayman22201> wat? http://man7.org/linux/man-pages/man7/aio.7.html |
20:51:32 | FromGitter | <rayman22201> maybe it just hasn't been implemented in the async lib yet? |
20:51:38 | stefanos82 | Araq: most of the time you remind me of Bjarne. Your justifications are always straight on point and make me think twice or even thrice before I ask a question and still I make myself look like a complete idiot (lol) next to your greatness of knowledge around language design and implementation |
20:52:29 | FromGitter | <rayman22201> @Araq seems much nicer / has a better sense of humor than Bjarne :-P |
20:53:14 | Araq | rayman22201: I hope Linux improved but when I researched it, even Node.js used a background thread for "async" file IO on Linux. |
20:53:44 | * | xet7 joined #nim |
20:54:04 | Araq | well thank you. Bjarne is a respectable man. |
20:55:38 | stefanos82 | rayman22201: Personally I like Bjarne's humor; I found him hilarious most of the time when he jokes or goof around his presentations :D |
20:56:36 | FromGitter | <rayman22201> lol. âRemember the Vasa!â was pretty good |
20:56:37 | stefanos82 | Araq: I wish I met you back in my college days when I needed a programming mentor. Anywhere I looked for one I would get rejection and turning backs instead |
20:56:49 | Araq | also, I know for a fact now I'm not a nice person. :-) |
20:57:03 | stefanos82 | Araq: nobody's perfect |
20:59:24 | Araq | (just ask kaushalmodi) |
21:00:34 | * | byte512 joined #nim |
21:00:54 | * | aziz quit (Ping timeout: 260 seconds) |
21:03:09 | * | Vladar quit (Quit: Leaving) |
21:06:01 | FromGitter | <rayman22201> @Araq reading more about async io on linux. apparently async io is in newer kernels (>2.5), but it sucks. and the glibc verison uses posix threads anyway? lame :-( http://kkourt.io/blog/2017/10-14-linux-aio.html |
21:07:24 | Calinou | does anyone know why importing `os` in a NimScript file results in "Error: cannot 'importc' variable at compile time"? |
21:07:27 | Calinou | I need it to use findExe() there |
21:08:01 | Araq | nimscript only support ospaths.nim |
21:08:12 | Araq | which is in fact the reason for this ospaths vs os split |
21:08:20 | Calinou | I see |
21:08:44 | Calinou | "Include file that implements 'osErrorMsg' and friends. Do not import it!" |
21:08:58 | Calinou | what's strange is that it seems to be done automatically on my local install, but not on GitLab CI |
21:13:38 | * | aziz joined #nim |
21:14:42 | Calinou | I'll hardcore the GCC path for now and see |
21:14:53 | * | skrylar quit (Quit: Leaving) |
21:23:41 | stefanos82 | Araq: when I read dom96's book, the last chapter which was on metaprogramming was really fascinating, especially the macros' part. What I have noticed is that it was executing first the macros' output and then was attempting to compile the generated C code. |
21:23:49 | * | aziz quit (Read error: Connection reset by peer) |
21:23:59 | stefanos82 | is it possible to work around metaprogramming, like macros without emitting C code? |
21:40:09 | * | aziz joined #nim |
21:41:01 | krux02 | stefanos82, I think you don't quite get it. |
21:41:03 | * | Ven`` quit (Quit: q+) |
21:41:13 | stefanos82 | krux02: I guess I don't |
21:41:27 | krux02 | Nim by default compiles to C because it is a very reasonable compile target |
21:41:44 | krux02 | there are really a lot of C compilers out there that target lot's of different platforms |
21:42:02 | krux02 | much more than if you would for example just compile with a gcc or llvm frontend |
21:42:13 | stefanos82 | lol what are you talking about krux02? did you really read my question? |
21:42:34 | krux02 | well you talk about metaprogramming and emitting C code |
21:42:41 | stefanos82 | read my question again |
21:42:42 | krux02 | these two things have nothing to do with each other |
21:43:41 | krux02 | stefanos82, you are free to reformulate the question. |
21:43:55 | krux02 | if you don't want to be misunderstood. |
21:44:19 | stefanos82 | as I said, I was working on metaprogramming examples from Nim in Action |
21:44:29 | krux02 | yes |
21:44:55 | stefanos82 | while I was doing so, I have noticed during my "nim c -r foo.nim" command, the output was thrown first and then the code would attempt to compile the C code |
21:45:32 | krux02 | the compiler compiles the c code, not your code. |
21:45:34 | stefanos82 | what I asked is whether there is a way to work on the metaprogramming part without emitting C code, purely for testing purposes and when I want to, to choose C or C++ |
21:46:10 | krux02 | you can't choose/influence the compilation target from macros |
21:46:24 | krux02 | the compilation target is a command line argument to the compiler |
21:46:46 | krux02 | and for the macros the compilation target also should not matter that much |
21:47:22 | krux02 | but you can work in just the NimVM if that is what you want |
21:47:38 | krux02 | just put all your code in a ``static:`` block |
21:47:40 | stefanos82 | when you say NimVM? |
21:47:56 | krux02 | all macros are executed on the NimVM |
21:48:11 | stefanos82 | OK, and what should be my command of execution? nim ...? |
21:48:20 | stefanos82 | without c or cpp ? |
21:48:24 | krux02 | just nim c |
21:48:35 | krux02 | it will create a c file and compile that |
21:48:45 | krux02 | but the program won't do anything |
21:48:58 | krux02 | wait, maybet there is a better opiton |
21:49:02 | stefanos82 | so it has to generate C code, even if that code is plain void? |
21:49:10 | yglukhov[i] | stefanos82: you can't "not compile anything" to play with the macros :). |
21:50:08 | yglukhov[i] | you can use --compileOnly nim flag which will prevent from calling CC. the c sources will still be generated. |
21:50:13 | krux02 | --compileOnly |
21:50:21 | stefanos82 | I see |
21:50:28 | stefanos82 | let me try that |
21:50:42 | krux02 | nim check |
21:51:11 | krux02 | to "check" the project, macros have to be evaluated |
21:53:57 | stefanos82 | I think I'm doing something wrong with -c | --compileOnly: it throws an error: Error: invalid command src/foo.nim |
21:54:04 | stefanos82 | I tried nim -c src/foo.nim |
22:00:18 | stefanos82 | oops, I forgot to add a c right before -c lol |
22:00:28 | stefanos82 | yeah, it works as expected! ^_^ |
22:00:49 | FromGitter | <kayabaNerve> Sometimes I hate C. |
22:00:59 | * | aziz quit (Ping timeout: 260 seconds) |
22:01:46 | stefanos82 | say that after you try C++ lol |
22:01:59 | FromGitter | <kayabaNerve> I have â ` â {.compile: "Argon2/src/argon2.c".} â {.compile: "Argon2/wrapper.c".} â ` ... [https://gitter.im/nim-lang/Nim?at=5b54fed6b2411177a264237c] |
22:01:59 | stefanos82 | I have tried to test the latest standards and lost my mind |
22:02:39 | FromGitter | <kayabaNerve> stefanos82: I sometime's hate Nim's C FFI yet I'm polite enough to acknowledge it isn't Nim itself versus me/C being old and archaic. |
22:02:47 | FromGitter | <kayabaNerve> And I started with C++ |
22:03:32 | FromGitter | <kayabaNerve> Basically, Nim appears to be linking everything, however the C file isn't getting it. |
22:03:52 | stefanos82 | in order to use C correctly, you have to be extremely careful and most of the time use C's extensions like GCC's to make your program work as expected |
22:05:27 | stefanos82 | where does argon2.h resides kayabaNerve? |
22:06:23 | FromGitter | <kayabaNerve> ... I hate this part |
22:06:28 | FromGitter | <kayabaNerve> ../../src/lib/Argon2/src/argon2.h |
22:06:36 | * | yglukhov[i] quit (Remote host closed the connection) |
22:06:36 | FromGitter | <kayabaNerve> nimcache = ~/build/nimcache |
22:06:47 | FromGitter | <kayabaNerve> argon2.h = ~/src/lib/Argon2/src/argon2.h |
22:06:58 | FromGitter | <kayabaNerve> GCC Effective? ../../src/lib/Argon2/src/argon2.h |
22:08:54 | * | brainproxy joined #nim |
22:09:45 | stefanos82 | kayabaNerve: OK, where do your .nim files reside then? |
22:09:58 | stefanos82 | we need to make sure the --path is set on the right path |
22:10:15 | FromGitter | <kayabaNerve> I don't use any paths; just pragmas |
22:10:34 | stefanos82 | well, you have to help Nim to detect the location of your C code |
22:11:02 | FromGitter | <kayabaNerve> I do |
22:11:06 | FromGitter | <kayabaNerve> Via the pragmas |
22:11:28 | stefanos82 | what about the rest of ../src/lib then? |
22:12:21 | FromGitter | <kayabaNerve> What about it? |
22:12:50 | stefanos82 | now I got curious. can you provide the project's structure? |
22:13:41 | FromGitter | <kayabaNerve> Sure but I want to try something first lol |
22:13:50 | stefanos82 | no worries |
22:18:50 | FromGitter | <kayabaNerve> What do I use to map a uint32_t? cint, cuint, or int32? |
22:22:30 | FromGitter | <Varriount> What is it used for? |
22:22:44 | krux02 | uint32_t is just uint32 |
22:23:09 | FromGitter | <kayabaNerve> @Varriount Binding |
22:23:33 | FromGitter | <kayabaNerve> I think it's explicit due to the fact it's a cryptography lib and therefore bitwise? |
22:25:02 | Calinou | I present to you, after a few dozen amended commits, https://github.com/Calinou/clr/releases |
22:25:08 | Calinou | I tested the Windows binary in WINE |
22:25:13 | Calinou | it works :) I do have to ship pcre64.dll with it though |
22:25:16 | Calinou | (it's included in the ZIP) |
22:28:37 | krux02 | congratulations. |
22:28:57 | krux02 | I am just sceptical. Is a command line program really suitable to operate on color? |
22:30:14 | krux02 | I mean most of the time you want to process millions of color values like in a photo or in real time graphics. Sometimes you operator on colors for syntax highlighting, but even there you have so many colors that you would not want to insert them manually on a command line, or even stare a new system process for each individual color. |
22:30:47 | FromGitter | <kayabaNerve> stefanos82 Yo |
22:30:57 | stefanos82 | sup |
22:31:26 | krux02 | Calinou, I think to make this tool usful for the command line, you should really read colors from stdin |
22:31:46 | krux02 | you can keep the format, but that way you can convert an entire list of colors |
22:31:50 | Calinou | krux02: it's not a library, it's an utility application :) |
22:32:04 | Calinou | interactive mode isn't a bad idea, but I personally don't need it |
22:32:22 | Calinou | that said, I might add ways to generate color palettes or something |
22:32:37 | Calinou | I could make the `info` subcommand accept several colors and display them all too |
22:32:56 | FromGitter | <kayabaNerve> https://gist.github.com/kayabaNerve/4550a6d0587ef7e6c019925fb25d787b |
22:32:57 | krux02 | I don't want to make it interactive, I just think the use case is very very small. But anyway, it is good that you accomplished what you wanted to accomplish. |
22:33:00 | Calinou | I'll also make the manipulation colors display the original color for comparison |
22:33:08 | FromGitter | <kayabaNerve> There's a Gist of the Project Repo and erro |
22:33:16 | Calinou | it's not very small for me :) I find myself wanting to input HSL colors in applications *all the time* |
22:33:24 | Calinou | (when they only accept hexadecimal or RGB values) |
22:33:31 | FromGitter | <kayabaNerve> And I put it in a Gist to try to stop sharing the repo so much here, but guess what? Gitter printed the entire thing in chat for me. Lol |
22:33:35 | Calinou | it's a niche use case, but it's a niche I wanted to fill |
22:33:54 | krux02 | Calinou, I think to make this tool kind of useful, I think about it to work similar to sed: detect colors on stdin transform them and wrtie them out again |
22:34:36 | krux02 | and then you can reat the contents of a colorscheme in any textural format, apply an operation on it and just use the transformed color scheme |
22:34:41 | dom96 | Calinou: Needs a macOS release :P |
22:34:41 | * | BitPuffin quit (Remote host closed the connection) |
22:35:10 | dom96 | Of course, installing via Nimble is simple |
22:35:20 | dom96 | nimble install https://github.com/Calinou/clr.git |
22:35:24 | dom96 | You can update your readme to just that |
22:35:45 | Calinou | I'll publish it on Nimble in due time |
22:35:50 | Calinou | as for macOS⌠I'll need to set up Travis |
22:35:57 | Calinou | (GitLab CI does not offer macOS instances, unfortunately) |
22:36:41 | Calinou | krux02: accepting from stdin makes sense for CLI apps, but these usually don't use standard formats for colors, do they? |
22:36:53 | Calinou | (e.g. ImageMagick) |
22:37:42 | dom96 | Guess my terminal doesn't support true color |
22:37:50 | krux02 | Calinou, that is the reason you should have to option pass the input format and output format with som sort of pattern. |
22:37:53 | dom96 | Otherwise it's working well |
22:38:13 | Calinou | "export COLORTERM=truecolor" |
22:38:18 | dom96 | Case sensitive `-V` for version is odd |
22:38:25 | FromGitter | <kayabaNerve> Oh. Meant to say stefanos82. I am on devel. Maybe 1.5 weeks old at this point |
22:38:32 | krux02 | no environment variables please |
22:38:32 | Calinou | you need to set the variable, Nim's enableTrueColors() isn't effective if that variable is not set |
22:38:33 | krux02 | they suck |
22:38:39 | Calinou | it's on Nim's side :) |
22:38:39 | dom96 | Calinou: No change |
22:38:47 | Calinou | Terminal.app does not support truecolor, but iTerm2 does |
22:39:02 | Calinou | https://gist.github.com/XVilka/8346728 |
22:39:07 | dom96 | ahh, too lazy to get iTerm2 |
22:39:16 | Calinou | dom96: oh, you can nimble install from Git repo URLs? that's great |
22:39:19 | stefanos82 | kayabaNerve: did you figure out what was the problem? |
22:39:24 | dom96 | Calinou: yep |
22:39:30 | krux02 | dom96: do you need help on porting you workflow over to Linux? |
22:39:35 | Calinou | I can add a lowercase -v option since I don't use -v for "verbose" |
22:39:41 | dom96 | krux02: hrm? |
22:39:47 | Calinou | but if I ever add a verbose mode, I'd need to break it :( |
22:40:25 | dom96 | Nah, I hate that python doesn't give its version when I write `python -v` |
22:40:40 | dom96 | Instead of launches dumbly with verbose mode |
22:40:41 | Calinou | yeah, same |
22:40:49 | Calinou | some apps use -V, some use -v |
22:41:00 | FromGitter | <kayabaNerve> Nope |
22:41:01 | Calinou | supporting both is an easy way to make everyone happy, but it means you can't use it for verbose mode :P |
22:41:03 | FromGitter | <kayabaNerve> I still need help |
22:41:09 | krux02 | Will prevent you from nasty surprises like "ah next version no OpenGL support. Next version we drop support for headphone jacks. Next version we drop support for usb. Next version we stop supporting Keyboards. Next version we stop supporting mice. |
22:41:10 | dom96 | Nim/Nimble support both :P |
22:41:23 | dom96 | because case insensitivity ftw |
22:41:28 | FromGitter | <kayabaNerve> The Nim file is also saying it's redefining itself but I figured I'd fix c first and that'd go away |
22:41:29 | Calinou | also, you can get iTerm2 from Homebrew |
22:41:34 | Calinou | it takes one line to install it that way :P |
22:41:34 | krux02 | :P |
22:41:59 | dom96 | krux02: Lol. I feel like you're assuming that I'm a Linux noob |
22:42:05 | dom96 | I've used Linux for many years |
22:42:17 | dom96 | Still do of course |
22:42:17 | FromGitter | <kayabaNerve> Steam :( |
22:42:19 | krux02 | then why did you change to macos? |
22:42:48 | dom96 | Because I needed a new laptop and with student discount a MacBook Pro was an incredible deal |
22:43:08 | krux02 | but you can install Linux on a MacBook, too. |
22:43:12 | krux02 | It's a free upgrade. |
22:43:17 | krux02 | :P |
22:43:17 | dom96 | Yeah, that sounds like fun |
22:43:58 | dom96 | I prefer to get shit done not get pissed off every time I boot up my machine after an upgrade |
22:44:22 | krux02 | yea the very reason to use Linux |
22:44:31 | FromGitter | <kayabaNerve> Tbh Chromebook + crouton is amazingly functional |
22:44:32 | krux02 | at least on the right distro |
22:44:46 | FromGitter | <kayabaNerve> I did that years ago just to have something and I developed a lot on it |
22:45:03 | FromGitter | <kayabaNerve> Ofc, you want an x86 one and those are discontinued |
22:45:12 | krux02 | kayabaNerve: It is not just about funcitional. I haven't tried chromeos, but with that stuff you are so much tied into the google shit. |
22:45:21 | krux02 | With macos you are tied into Apple shit |
22:45:29 | Calinou | Linux on MacBooks is becoming more and more complicated with every new laptop |
22:45:31 | krux02 | and with Windows you are tied to Microsoft shit |
22:45:50 | Calinou | I don't agree that you're tied to Apple/Microsoft with Windows or macOS. You can use only traditional apps if you wish |
22:45:52 | krux02 | everybody tries to track you down and abuse their power if they can. |
22:46:03 | Calinou | I can play the same games, use the same CLI/GUI apps on Windows and macOS for the most aprt |
22:46:04 | Calinou | part* |
22:46:35 | dom96 | There is a lot dumb shit about macOS |
22:46:43 | dom96 | But honestly, it's the best of the bunch. |
22:46:58 | krux02 | Calinou, it is not about playing the same games and apps. It is about the fact the the core is corruped. |
22:47:11 | krux02 | Windows has advertisement in the start menue |
22:47:15 | dom96 | That said, I haven't tested Windows recently on a laptop. I would be tempted to give the Surface Book a chance |
22:47:29 | FromGitter | <kayabaNerve> Krux02: Crouton installs Linux in a chroot. |
22:47:40 | FromGitter | <kayabaNerve> You can also override chromeos entirely. |
22:47:47 | FromGitter | <kayabaNerve> I was saying the hardware is great for the price |
22:47:56 | FromGitter | <kayabaNerve> You can even install macos El Capitan |
22:48:05 | krux02 | I can only recommend to anybody who has a computer to install Manjaro. |
22:48:26 | dom96 | Hehe. I've been there and done that with Chrome OS and Crouton as well. |
22:48:29 | stefanos82 | I'm quite pleased with XFCE to be honest with you |
22:48:37 | dom96 | Got an HP Chromebook, which to be fair is a shitty machine. |
22:48:44 | krux02 | I use xfce for many years now. |
22:48:45 | stefanos82 | I used to use Mint, but they had a serious bug that would consume all my memory and replaced it with XFCE |
22:48:58 | krux02 | it is the most boring desktop environment in a positive way. |
22:49:15 | krux02 | I don't want a new exciting way to start my application that I have been using for years |
22:49:21 | krux02 | I want that it works like yesterday |
22:49:32 | stefanos82 | why did I say mint?! I meant MATE |
22:49:54 | stefanos82 | I miss GTK 2.2x series |
22:50:01 | stefanos82 | those were the best days of my life |
22:50:05 | dom96 | Pff, Manjaro. Back when I used Linux all you had was Arch |
22:50:21 | stefanos82 | Debian testing for the win, woooooooot! |
22:50:43 | Calinou | I'm on Fedora these days, I used Manjaro, Antergos, Debian testing, Xubuntu, Ubuntu in the past |
22:50:48 | krux02 | I used open suse with kde 3 I think 10 years ago. |
22:50:58 | krux02 | more than 10 years |
22:51:12 | krux02 | KDE 3 was really great back then. |
22:51:31 | krux02 | And I think if they never had started with the KDE 4 branch I would still be using kde |
22:51:35 | stefanos82 | should we take this conversation to #nim-offtopic? |
22:51:38 | stefanos82 | we could continue there |
22:51:45 | krux02 | nah |
22:51:57 | krux02 | we just continue here until someone actually has a nim question and then we stop |
22:52:00 | dom96 | Nobody is talking on-topic so indeed, nah |
22:52:17 | Calinou | "btw I use arch" |
22:52:20 | dom96 | But anyway, I used to be really opposed to macOS |
22:52:27 | dom96 | Until I was actually forced to use it for a while at work ;) |
22:52:27 | stefanos82 | I such a traitor these days -_- I'm revising both C++ and PHP knowledge for interviews and I feel awful |
22:53:28 | Calinou | I write code in a lot of languages: https://codestats.net/users/Calinou |
22:53:32 | Calinou | Nim already surpassed Go and Rust :D |
22:53:37 | dom96 | I shudder to think how awful the MBP touch pad is on Linux |
22:53:48 | krux02 | I use arch on this laptop, too. But the overall experience of Manjaro is better. In the beginning I did not like that they "filter" the arch packages and therefore it is not a trie "Arch". But they actually solves problems for you, so that you are allowed to care less about the operating system you are working on. |
22:54:10 | krux02 | this laptop is just historically an Arch laptop |
22:54:26 | krux02 | I don't know when I installed Arch on it. But it was many years ago. |
22:54:33 | stefanos82 | Calinou: I don't consider myself a passionate programmer as I used to see myself as one. I'm more of a problem solver, that's all |
22:54:40 | Calinou | same for me |
22:54:59 | stefanos82 | you are better than me; you code a lot |
22:55:00 | stefanos82 | I don't |
22:55:29 | Calinou | I'm not better than you :) |
22:55:33 | stefanos82 | I'm still regretting for making technology my profession |
22:55:43 | krux02 | I still kind of passionate about what I do. |
22:55:50 | Calinou | I don't consider myself an expert in programming |
22:55:55 | dom96 | stefanos82: It's never too late to change tracks |
22:55:58 | krux02 | But in the end it is problem solving. |
22:56:03 | stefanos82 | I have no passion for anything |
22:56:14 | Calinou | I'm interning in back-end web development currently (well, I'm on summer break right now) |
22:56:26 | stefanos82 | ah the power of youth |
22:56:28 | Calinou | working on a Node.js project (ES2017), will be doing PHP/Laravel soon |
22:56:36 | Calinou | yeah, I turned 20 in March |
22:56:40 | dom96 | Node, PHP, :( |
22:56:41 | stefanos82 | 20?! |
22:56:48 | stefanos82 | once upon a time ;( |
22:56:55 | Calinou | dom96: PHP isn't that bad. I prefer working with a nice PHP framework such as Symfony rather than Node.js, honestly |
22:56:58 | krux02 | I really think programming is my passion. And I just can't stand to work with people who have an attitude of "don't care". |
22:57:01 | Calinou | it even has static typing to an extent :) |
22:57:11 | Calinou | (as long as you work with modern PHP versions) |
22:57:32 | dom96 | Ahh, 20, I'm even feeling old and I'm only 22. |
22:58:08 | krux02 | dom96: you are really that young? |
22:58:20 | dom96 | It's not that young, is it? |
22:58:36 | stefanos82 | dom96: *cough* excuse me young men *cough*, please allow the old turd to pass |
22:58:45 | krux02 | I am 30 |
22:58:53 | stefanos82 | only? that's good |
22:58:54 | krux02 | and I never wrote a book |
22:59:19 | stefanos82 | I had the unfortunately privilege to waste 1.5 years of my life to writing one lol |
22:59:24 | krux02 | having a book released with 22 is pretty impressive. |
22:59:35 | dom96 | Glad to hear that :) |
23:00:12 | krux02 | stefanos82, I think realeasing the first of anything is horrible torture and the result will be crap and you should not show it to anybody. |
23:00:13 | dom96 | I feel like I should have achieved even more by now, like created a successful startup or something. |
23:00:45 | stefanos82 | krux02: don't worry, dom96 by the age of 30+ he will be writing fantasy stories based on his traumas with mysterious bugs in generated C code that turned to nightmares |
23:01:17 | krux02 | I don't want to rate Nim in Action. Because when it arrived here at home. I already knew everything about Nim that I cared about. The book did not offer a lot of interesting topics for me to read about. |
23:01:38 | stefanos82 | krux02: the book I wrote was not for me, but for my private university |
23:01:53 | dom96 | Yeah, it's not for everyone. But surely you can find something in there that you don't know :) |
23:02:31 | krux02 | stefanos82, I don't think the generated C code is that bad. I actually was reading throught the generated C code, and I was surprised how readable it is (when you compile it release and turn all the debug informations off) |
23:02:45 | stefanos82 | my colleagues were too busy to take notes due to intense schedule with courses and EU conferences, therefore I had to volunteer so I can get a taste of writer |
23:03:29 | stefanos82 | the code is indeed readable up to a point. C on the other hand behaves weird, depending on its mood |
23:04:44 | krux02 | for some reason I don't think C behaves weird. |
23:04:58 | stefanos82 | if Nim was depended on GCC exclusively, I could say it would be a good sacrifice to fix some language's gimmicks by introducing GCC extension to the language and use that as part of the generated code, so it can produce really secure code |
23:05:34 | krux02 | the good thing in the generated C code is, that it doesn't really rely on macros anymore |
23:05:39 | krux02 | macros in C behave weird |
23:06:47 | krux02 | stefanos82, I don't think so, because Nim cannot rely on error messages from the C compiler. |
23:06:49 | stefanos82 | they need to turn to countless micros |
23:06:59 | krux02 | The goal of the nim compiler is to emit correct C code |
23:07:10 | krux02 | the c code should then compile with warnings turned off. |
23:07:52 | stefanos82 | I really need how OCaml implemented its crazy logic to emit optimized C code that is actually optimized inlined assembly code |
23:07:58 | krux02 | stefanos82, what are those GCC features that you had in mind? |
23:07:59 | stefanos82 | *need to study how... |
23:08:23 | dom96 | Yay, the Nim survey officially passed last year's response numbers |
23:08:34 | krux02 | dom96: great |
23:08:47 | krux02 | I took part in it. but I only found out about it by accident |
23:09:23 | * | sammy joined #nim |
23:09:33 | sammy | nim |
23:09:37 | sammy | reeeeeeeeet |
23:09:48 | Calinou | dom96: I do feel old sometimes |
23:09:55 | sammy | ok |
23:10:05 | stefanos82 | I really want to know how old Araq is lol |
23:10:05 | sammy | what is the port here |
23:10:26 | krux02 | sammy: what port? |
23:10:35 | stefanos82 | if he's younger than me, then I will become Gandalf the Green |
23:10:46 | sammy | anyone pay gta5 |
23:10:50 | sammy | play |
23:10:58 | krux02 | not really. |
23:10:59 | stefanos82 | what the hell are you talking about |
23:11:08 | sammy | do you play gta5 |
23:11:24 | sammy | on pc |
23:11:25 | krux02 | sammy, this is a a chat about the Nim programming language |
23:11:35 | sammy | oof |
23:11:35 | stefanos82 | I play some Metallica songs, some Megadeth, and some Nirvana. Does this count? |
23:11:45 | sammy | anychat for gta5 |
23:12:02 | krux02 | sammy, I think you are in the wrong channel. |
23:12:07 | FromGitter | <rayman22201> Dammit @dom96 22? You are making us 30 year olds look bad đ |
23:12:39 | stefanos82 | no wonder why I have gray hair -_- |
23:12:41 | dom96 | sammy: try ##gaming or ##games or something like that |
23:12:59 | sammy | ok |
23:13:09 | sammy | ##gaming |
23:13:17 | dom96 | You'll have better luck on other IRC networks though |
23:13:21 | dom96 | FreeNode isn't really for games |
23:13:44 | dom96 | QuakeNet might be a good place https://www.quakenet.org/ |
23:13:59 | * | ftsf joined #nim |
23:14:04 | stefanos82 | sammy: I just googled it for you and found this http://www.gamers-irc.org/ |
23:14:12 | stefanos82 | the servers are listed on the right sidebar |
23:15:20 | krux02 | I heard that freenode is the only IRC network that is still growing |
23:15:45 | FromGitter | <rayman22201> I love how nice this channel is. It's like a small town where you can knock on any door and ask for directions if you are lost lol |
23:15:54 | * | sammy quit (Quit: Page closed) |
23:16:19 | krux02 | other channels are similar. |
23:16:31 | krux02 | I think it is just open source software in general |
23:16:46 | FromGitter | <rayman22201> And then we go back to fighting to the death over exception handling đ |
23:17:14 | krux02 | All I want for exception handling is a way to not deal with it. |
23:18:23 | krux02 | damn it. I don't want to talk about that topic. |
23:18:26 | Calinou | dom96: speaking of Nimble, how should I handle the version tag for in-development versions? (the one in my .nimble file, and the one that's displayed when passing the -V switch) |
23:18:34 | stefanos82 | I remember when I joined a channel once and said "greetings folks" and a Wolverine-at-the-bar-cameo-scene behavior stroke me in face: GO F*** YOURSELF! |
23:18:45 | stefanos82 | I was like...ooookaaaay! |
23:18:58 | FromGitter | <rayman22201> Sorry. Too soo maybe. I was just being cheeky |
23:19:22 | FromGitter | <rayman22201> Yeah... I've had some bad irc experiences myself |
23:19:30 | krux02 | stefanos82, that is not normal. Not for any channel. |
23:19:43 | stefanos82 | krux02: some people need to get a life, that's for sure |
23:19:47 | krux02 | there were some bad experiences here as well. |
23:19:57 | stefanos82 | it can happen to anyone |
23:20:08 | krux02 | yea some people on the emacs channel are always online. |
23:20:23 | krux02 | I don't know why, but it keeps the channel alive. |
23:20:43 | krux02 | but sometimes I wonder if they just hang out there becaues they don't want to work. |
23:20:48 | stefanos82 | I'm doing my best to keep an eye on my behavior as well due to multiple factors: long hours in front of the screen, hunger, persistent issues with coding, and the like |
23:21:00 | FromGitter | <kayabaNerve> We should've sent Sammy to the rust IRC :( |
23:21:06 | krux02 | I defititively do that from time to time. I hang out here in this chat, because I just don't want to work. |
23:21:24 | stefanos82 | krux02: pay me half your salary and I will work for you |
23:21:27 | FromGitter | <rayman22201> I've been to some Linux support channels that just yell at you for being a noob and telling you to rtfm |
23:21:36 | krux02 | kayabaNerve: would only have worked if he would have played the rust game |
23:21:56 | krux02 | stefanos82, you will for free?!!! Deal!!! |
23:22:08 | stefanos82 | rayman22201: I have been using UNIX-like systems since 2003 and still I'm a newbie |
23:23:09 | stefanos82 | for free? am I going to gain anything out of it eventually? |
23:24:41 | krux02 | stefanos82, All income you get from an open source project. |
23:24:53 | stefanos82 | you mean all these millions?! O.o |
23:24:56 | stefanos82 | no way! |
23:25:26 | krux02 | I mean the project is interesting. |
23:26:04 | FromGitter | <rayman22201> https://giphy.com/gifs/nfl-week-play-13B1WmJg7HwjGU |
23:26:27 | FromGitter | <rayman22201> I couldn't resist |
23:26:37 | krux02 | Write a program that doesn't just use the CPU, but compiles to a GPU/CPU hybrid target with code sharing on both GPU and CPU |
23:27:21 | stefanos82 | rayman22201: there should be another scene with his mini-me where he says "1 minion dollars" |
23:27:21 | krux02 | it's like writngi a sever client application, as if it was just one program. |
23:28:00 | dom96 | Calinou: You can do some clever importing and reuse the same constant in your program and your .nimble file |
23:28:03 | dom96 | Or just duplicate it |
23:28:05 | stefanos82 | krux02: you mean like cuda syntax? |
23:28:35 | dom96 | Still too complex for my liking, but here is how Nimble does it: https://github.com/nim-lang/nimble/blob/master/nimble.nimble#L4 |
23:28:45 | krux02 | stefanos82, cuda only has compute kernels. |
23:29:14 | Calinou | dom96: I wonder if it's possible to extract info from the .nimble file, yeah |
23:29:15 | krux02 | I support full rasterization pipeline, too. and automatic resource serialization. |
23:29:20 | Calinou | so that I don't have to write it twice |
23:29:29 | krux02 | So I think I am a bit better than just cuda. |
23:29:39 | dom96 | kayabaNerve: haha yeah, "You can discuss the Rust game here though: #rust" :D |
23:29:56 | stefanos82 | krux02: you mean something like this? https://hal.inria.fr/hal-00807033v1/document |
23:30:00 | FromGitter | <rayman22201> @stephanos82 lol @krux02 that does sound fascinating. Isomorphic code or automatic code generation like vectorization? |
23:30:14 | dom96 | I remember when I wanted help using Python to write an IRC bot |
23:30:22 | dom96 | So I went to #python and they all told me to use Twisted |
23:30:30 | dom96 | "But I want to use the stdlib" |
23:30:35 | dom96 | "OMG WHY, JUST USE TWISTED" |
23:31:33 | dom96 | x = IRCBot(); x.connect() # I would have learned so much from this. |
23:32:16 | krux02 | rayman22201: I wrote the glm port for nim, and I compile the parts of the program that utilize the glm library to glsl builtin functions. |
23:32:31 | krux02 | functions not provided as a glm builtin are also translate to glsl. |
23:32:52 | krux02 | so basically you can use arbitary Nim code. of coulse with limitations and stuff |
23:34:04 | krux02 | stefanos82, here is an example https://github.com/krux02/opengl-sandbox/blob/master/experiment/main.nim#L392 |
23:34:15 | krux02 | just ask if something sounds magical or fake to you |
23:34:21 | stefanos82 | I've got nostalgic now :/ I miss the good ol' days where companies would place job ads all over the place and they would hire people with no previous experience and built on them |
23:35:51 | FromGitter | <rayman22201> @krux02 that is pretty damn cool |
23:36:04 | FromGitter | <kayabaNerve> Is #rust on Freenode evn for the rust lang? |
23:36:21 | stefanos82 | krux02: is that math I'm looking at?! if yes, https://www.wikihow.com/images/thumb/f/ff/AngryCatWikiHow.jpg/718px-AngryCatWikiHow.jpg |
23:36:39 | dom96 | kayabaNerve: it's ##rust, but yeah |
23:38:24 | dom96 | The channel is pretty much dead though |
23:38:55 | FromGitter | <kayabaNerve> Plot twist: He joined there and they sent him here |
23:40:47 | stefanos82 | dom96: you mean ##rust is dead or #rust? |
23:41:14 | dom96 | #rust on mozilla is very active |
23:41:17 | dom96 | ##rust on freenode is dead |
23:41:21 | dom96 | #rust on freenode doesn't exist |
23:43:21 | dom96 | 'night |
23:48:15 | stefanos82 | I need to get some sleep as well. goodnight folks |
23:48:18 | * | stefanos82 quit (Quit: Quitting for now...) |
23:48:43 | zacharycarter[m] | is it possible to check an objects subtype inside of a template? |
23:49:25 | zacharycarter[m] | or rather is it possible to ensure an object inherits a type inside of a template? |
23:50:50 | * | ftsf quit (Ping timeout: 276 seconds) |
23:51:43 | zacharycarter[m] | nm is ref object worked |
23:53:00 | * | ftsf joined #nim |
23:53:09 | * | xet7 quit (Quit: Leaving) |