00:31:18 | * | rauss joined #nim |
00:35:25 | * | vlad1777d_ quit (Quit: Leaving) |
00:46:30 | * | pigmej quit (Ping timeout: 264 seconds) |
00:47:33 | * | pigmej joined #nim |
00:47:56 | * | pigmej is now known as Guest42697 |
00:48:03 | * | Guest42697 quit (Excess Flood) |
00:48:11 | * | pigmej_ joined #nim |
01:16:39 | * | pigmej_ is now known as pigmej |
01:24:46 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:26:00 | * | jrenner001 joined #nim |
01:26:25 | jrenner001 | Anyone know how to get YouCompleteMe working with any nim plugin for vim? |
01:33:03 | * | jrenner001 quit (Remote host closed the connection) |
01:38:44 | * | chemist69 joined #nim |
01:42:17 | * | zachcarter_ joined #nim |
01:46:02 | * | zachcarter quit (Ping timeout: 268 seconds) |
01:46:02 | * | zachcarter_ is now known as zachcarter |
02:05:29 | * | brson quit (Quit: leaving) |
02:06:33 | * | devted quit (Quit: Sleeping.) |
02:34:37 | * | askatasuna quit (Ping timeout: 240 seconds) |
02:34:52 | * | askatasuna joined #nim |
02:41:08 | * | libman quit (Quit: Connection closed for inactivity) |
02:47:27 | * | yglukhov joined #nim |
02:48:38 | * | zachcarter quit (Ping timeout: 260 seconds) |
02:52:50 | * | yglukhov quit (Ping timeout: 252 seconds) |
02:56:18 | * | zachcarter joined #nim |
03:01:59 | zachcarter | hrm |
03:02:02 | zachcarter | this vdom thing is tripping me up |
03:08:50 | zachcarter | didn’t realize I could create scripts elements with it too wtih karax |
03:08:54 | zachcarter | karax is effing awesome :D |
03:09:12 | ldlework | what is that |
03:09:38 | zachcarter | the spa framework araq and euantor and some others built |
03:10:02 | zachcarter | http://162.243.192.65/ |
03:10:51 | zachcarter | no js written whatsoever :) |
03:19:45 | * | krux02 quit (Remote host closed the connection) |
03:21:18 | FromGitter | <Varriount> zachcarter: How is it awesome? Forgive me, I know little of react. Could I see some of the source? |
03:21:29 | zachcarter | sure |
03:21:37 | zachcarter | https://github.com/zacharycarter/nim-playground-frontend |
03:21:50 | zachcarter | I’m not sure if I’m doing everything correctly or not either |
03:23:59 | ldlework | no dockerfile, can't run it |
03:25:50 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:26:08 | FromGitter | <Varriount> zachcarter: The frontend seems to work well |
03:26:21 | zachcarter | thanks Varriount |
03:28:10 | FromGitter | <Varriount> zachcarter: Now all it needs are <blink> tags and some background music |
03:28:18 | zachcarter | :D |
03:30:41 | * | chemist69 joined #nim |
04:02:07 | zachcarter | added a spinner to the submit button |
04:02:11 | zachcarter | http://162.243.192.65/ |
04:04:33 | zachcarter | Idlework: to your point - I’m pretty sure getting docker to run inside of docker like I was trying to do is either not possible or difficult / beyond my abilities |
04:04:39 | zachcarter | I tried but i couldn’t get the daemon to start |
04:05:55 | zachcarter | I did however, do some awesome stuff with docker over the weekend |
04:12:00 | zachcarter | Varriount: care to see something curious related to some Nim code? |
04:36:22 | FromGitter | <Varriount> zachcarter: Sure |
04:36:44 | zachcarter | most of the details are here |
04:36:45 | zachcarter | https://github.com/yglukhov/sound/issues/17 |
04:36:49 | zachcarter | it’s that issue with the sound library |
04:37:01 | zachcarter | for some reason this one section of code executes way slower on windows than on linux / osx |
04:38:20 | FromGitter | <Varriount> zachcarter: My immediate suspicion is on stb_vorbis_get_samples_short_interleaved |
04:38:26 | zachcarter | nope! |
04:38:28 | zachcarter | I benchmarked that |
04:38:35 | zachcarter | same execution time on both OS's |
04:38:47 | zachcarter | it seems to be the size of the buffer |
04:39:04 | zachcarter | I don’t understand why |
04:39:26 | FromGitter | <Varriount> zachcarter: How many times is the buffer being resized on Windows vs Linux |
04:40:25 | zachcarter | I’m not sure of that specifically I just know that it’s looping through that section of logic far more times on windows than on linux |
04:40:58 | zachcarter | so my guess would be a lot more |
04:40:59 | * | BennyElg quit (Remote host closed the connection) |
04:41:41 | FromGitter | <Varriount> How many channels are there on Windows, vs on Linux? |
04:42:16 | FromGitter | <Varriount> `let dataRead = ... * i.channels` |
04:42:30 | zachcarter | oooooo |
04:42:32 | zachcarter | good question |
04:42:45 | zachcarter | I didn’t think that would matter but let me check |
04:46:15 | zachcarter | 2 on windows |
04:47:01 | FromGitter | <Varriount> That buffer is reallocated on each loop, which isn't a cheap operation. |
04:47:27 | zachcarter | 2 on osx |
04:47:53 | zachcarter | I’m just wondering why it loops so many more times |
04:48:17 | zachcarter | I don’t even know why it’s reading this way |
04:48:18 | zachcarter | tbh |
04:49:28 | FromGitter | <Varriount> I wish I had bootcamp or parallels on my Mac. :/ |
04:49:32 | * | yglukhov joined #nim |
04:49:45 | zachcarter | I just use virtualbox |
04:50:27 | FromGitter | <Varriount> zachcarter: What are the actual values for `dataRead` on each system? |
04:52:52 | zachcarter | they’re the same |
04:52:58 | zachcarter | 32768 |
04:54:00 | * | yglukhov quit (Ping timeout: 260 seconds) |
04:54:22 | FromGitter | <Varriount> That loop on windows is looping more? |
04:54:28 | zachcarter | yup |
04:54:54 | FromGitter | <Varriount> What. |
04:55:31 | FromGitter | <Varriount> Something fishy is going on. |
04:55:35 | zachcarter | I’m compiling with mingw |
04:55:48 | zachcarter | yeah I agree |
04:55:55 | zachcarter | I should compare the generated C |
04:58:11 | zachcarter | meh I dunno |
04:58:57 | FromGitter | <Varriount> Is c_realloc actually resizing things correctly? |
04:59:37 | FromGitter | <Varriount> Why is it using malloc and realloc anyway? |
04:59:44 | zachcarter | no idea |
04:59:46 | FromGitter | <Varriount> Nim has unsafe allocation functions |
05:00:04 | zachcarter | I didn’t write this code |
05:00:18 | FromGitter | <Varriount> Hrm. |
05:00:31 | FromGitter | <Varriount> zachcarter: Is there a test sample I could run on my Mac? |
05:00:39 | zachcarter | sure |
05:00:46 | FromGitter | <Varriount> I know I won't encounter the problem, but I want to modify the code. |
05:00:53 | zachcarter | okay |
05:00:57 | zachcarter | let me put up a gist |
05:01:00 | zachcarter | and I’ll link you to an ogg |
05:01:52 | zachcarter | so replace the content of sound.nim with - https://gist.github.com/zacharycarter/f814d9b7ce7f412a6ecb3398a63d9f07 and here’s the ogg - http://www.vorbis.com/music/Epoq-Lepidoptera.ogg |
05:03:58 | FromGitter | <Varriount> Epog of the Butterfly? |
05:04:01 | FromGitter | <Varriount> *Epoq |
05:05:07 | zachcarter | lol |
05:05:17 | zachcarter | just some sample on vorbis.com |
05:05:23 | zachcarter | not really my type of music |
05:05:31 | FromGitter | <Varriount> zachcarter: What do you by replace? sound.nim contains the implementation. |
05:06:19 | zachcarter | https://github.com/yglukhov/sound/blob/master/sound/sound.nim this file |
05:11:57 | FromGitter | <Varriount> Any idea how big a "sample" is? |
05:12:31 | zachcarter | not sure |
05:22:14 | zachcarter | going to head to sleep, have a good night |
05:26:38 | FromGitter | <Varriount> zachcarter: This looks like it's trying to buffer the entire vorbis file at once. |
05:34:05 | * | chemist69 quit (Ping timeout: 260 seconds) |
05:36:31 | * | chemist69 joined #nim |
05:55:43 | * | rauss quit (Quit: WeeChat 1.7) |
06:09:05 | * | chemist69 quit (Ping timeout: 260 seconds) |
06:16:46 | * | yglukhov joined #nim |
06:23:40 | * | yglukhov quit (Remote host closed the connection) |
06:27:03 | * | chemist69 joined #nim |
06:35:14 | * | BennyElg joined #nim |
06:35:14 | * | BennyElg quit (Remote host closed the connection) |
06:35:22 | * | BennyElg joined #nim |
06:48:05 | * | zachcarter quit (Quit: zachcarter) |
06:49:57 | * | nsf joined #nim |
06:57:53 | * | gokr joined #nim |
07:04:29 | * | Arrrr joined #nim |
07:26:12 | * | vlad1777d joined #nim |
07:45:59 | * | yglukhov joined #nim |
07:46:03 | * | vivus quit (Quit: Leaving) |
07:50:12 | * | Arrrr quit (Ping timeout: 260 seconds) |
08:10:03 | euantor | zachcarter: The Nim playground editor seems to work for me now. Not sure what you changed to fix it, but it worked :) I tried looking at the generated JS code for the app but it's really difficult to read. Normally in JS what we'd do to get around the issue you were having (and to get around a whole bunch of other possible issues because JS is crap) is use a |
08:10:03 | euantor | self executing anonymous function: http://markdalgleish.com/2011/03/self-executing-anonymous-functions/ |
08:11:22 | * | Vladar joined #nim |
08:12:39 | * | couven92 joined #nim |
08:17:26 | * | Arrrr joined #nim |
08:17:26 | * | Arrrr quit (Changing host) |
08:17:26 | * | Arrrr joined #nim |
08:25:40 | FromGitter | <timeyyy> ls |
08:32:10 | Arrrr | Araq, now that you are fixing tuples https://pastebin.com/ZBZD7Zsr |
08:32:43 | Araq | that's a regression I think :-) |
08:33:57 | Arrrr | Yes, because before updating to today i didn't have this issue. I guess it was introduced after the `[]` overriding for tuples |
08:37:04 | * | rokups joined #nim |
08:37:54 | FromGitter | <Varriount> Euantor: maybe it's just me, but half the justification for self-executing anonymous functions seems to be for better minimification |
08:38:21 | FromGitter | <Varriount> Which will hopefully become obsolete with webassembly |
08:38:28 | euantor | Better minification, and prevent pollution of the global namespace |
08:38:42 | euantor | But yes, hopefully that will become obsolete eventually |
08:39:17 | euantor | In the world of JS it's not uncommon to have 100+ packages. If all of them operated in the global anmespace, you'd have name clashes all the time |
08:39:29 | euantor | *namespace |
08:40:17 | FromGitter | <Varriount> Hm. I wonder if that will become a huge problem for Nim |
08:40:25 | euantor | I saw the other day (it might have been linked here) a guy had created packages to colour terminal output for node.js. He'd created aseparate package for each colour, so if you needed 3 colours you had 4 packages straight away (one for each colour + another they all depended upon) |
08:40:55 | FromGitter | <Varriount> euantor: Why separate packages? |
08:41:05 | euantor | very good question |
08:41:18 | euantor | he had a stupid response for it, I'm trying to find it again now |
08:43:10 | euantor | https://github.com/jonschlinkert/ansi-yellow |
08:43:33 | euantor | https://github.com/jonschlinkert?utf8=%E2%9C%93&tab=repositories&q=ansi&type=&language= |
08:44:52 | FromGitter | <Varriount> Good grief |
08:45:14 | euantor | Yeah |
08:45:37 | euantor | I can't find the issue where he tried to justify it, it's on one of the many repositories |
08:48:36 | Arrrr | Maybe he wants the stars |
08:50:01 | euantor | He's in the top 5 most downloaded projects on NPM, according to: https://gist.github.com/bcoe/dcc961b869bbf6685002 |
08:50:19 | euantor | As he points out here: https://github.com/jonschlinkert/maintainers-guide-to-staying-positive#preamble |
08:52:20 | FromGitter | <Varriount> Perhaps we should do that with Nim |
08:52:43 | FromGitter | <Varriount> Create hundreds of single-function repositories |
08:56:08 | euantor | I'd rather not ;) |
08:56:48 | * | bjz joined #nim |
08:57:53 | Arrrr | So npm actually stands for "Noob's Programming Machine", that explains a lot. The top user has a lot of redundant packages such as "bin-version" and "bin-version-check" and "bin-version-check-cli" |
09:00:14 | gokr | The js world is a ... well. Hard to describe. Kinda like an asylym or something. Some stuff is good, but you easily drown in it all. |
09:01:35 | * | PMunch joined #nim |
09:04:12 | Araq | Arrrr: fixed |
09:06:55 | dom96 | hello guys |
09:07:42 | Arrrr | I'll give it a test as soon as you update motherstream |
09:12:16 | Araq | Arrrr: pushed it |
09:13:06 | FromGitter | <TiberiumPY> donator: there it is: https://github.com/jonschlinkert/ansi-green/issues/1#issuecomment-250623396 |
09:13:18 | FromGitter | <TiberiumPY> *eunator |
09:13:30 | FromGitter | <TiberiumPY> *euantor |
09:13:58 | euantor | Ah yes, thanks TiberiumPY :) |
09:13:59 | FromGitter | <TiberiumPY> (typing from the phone isn't the best thing in the world) |
09:14:18 | euantor | Doesn't help that my name is full of vowels ;) |
09:16:05 | * | Arrrr1 joined #nim |
09:16:06 | * | Arrrr quit (Disconnected by services) |
09:16:10 | * | Arrrr1 quit (Client Quit) |
09:20:05 | * | Arrrr joined #nim |
09:20:17 | * | couven92 quit (Read error: Connection reset by peer) |
09:20:39 | Arrrr | Regression fixed, everything is fire. |
09:20:47 | * | couven92 joined #nim |
09:20:58 | * | couven92 quit (Read error: Connection reset by peer) |
09:21:26 | * | couven92 joined #nim |
09:30:02 | FromGitter | <Varriount> Arrrr: I'll go call the fire department. |
09:34:59 | * | Tiberium joined #nim |
10:03:39 | Araq | ping yglukhov, we need to talk about JS backtraces again |
10:06:25 | yglukhov | hey what about them? |
10:06:27 | yglukhov | Araq |
10:06:59 | yglukhov | brb 10 mins |
10:30:45 | Tiberium | lol, you can even use generic proc's to use something like "print_r" from PHP (just playing around) |
10:32:10 | Tiberium | btw, if I have "proc output(args: varargs[cstring]) {.importc: "echo"}", how to use it like that: output("Hello", "from", "Nim!") ? Because Nim compiles it to echo(array("Hello","from","Nim")) in PHP |
10:32:40 | * | Vladar quit (Quit: Leaving) |
10:44:24 | Tiberium | ah, nvm, figured it out. but anyway, it's better to use nim's builtin "echo" :) |
10:44:29 | Tiberium | it acts the same as php's "echo" |
10:44:52 | yglukhov | Araq: so what about js? |
10:45:49 | Araq | yglukhov: never mind, I think it was just an ordinary JS codegen glitch |
10:46:04 | yglukhov | ok |
10:50:16 | PMunch | Hmm, http://ix.io/rQm |
11:02:06 | * | Sembei joined #nim |
11:02:20 | * | Snircle joined #nim |
11:02:33 | * | devted joined #nim |
11:03:52 | * | zachcarter joined #nim |
11:04:55 | zachcarter | Araq: I was being stupid yesterday and forgot you could add a script tag through the vdom |
11:05:04 | zachcarter | now http://162.243.192.65/ should load fine |
11:06:26 | PMunch | Is that a web-front for Nim? |
11:06:46 | zachcarter | it is |
11:07:18 | zachcarter | https://github.com/zacharycarter/nim-playground & https://github.com/zacharycarter/nim-playground-frontend |
11:07:56 | zachcarter | euantor ^ might be interested in the fix as well I’m reading over logs now |
11:09:52 | Araq | this is so cool :-) |
11:10:40 | dom96 | this is amazing |
11:10:41 | ldlework | zachcarter: nice |
11:10:49 | dom96 | and I love that you've separated it into a frontend and backend repos :) |
11:10:54 | ldlework | Now we need autocomplete |
11:10:55 | zachcarter | thank you |
11:10:57 | ldlework | :D |
11:11:00 | ldlework | and emacs bindings |
11:11:18 | dom96 | now we need the ability to compile gist's |
11:11:27 | ldlework | zachcarter: did you use docker? |
11:11:29 | ldlework | just curious |
11:11:44 | dom96 | Perhaps 162.243.192.65/?gist=gistIdHere :) |
11:11:44 | Tiberium | ldlework, he did |
11:11:56 | Tiberium | AFAIK |
11:12:02 | zachcarter | dom96: I can do that |
11:12:13 | zachcarter | also saving snippets might be nice |
11:12:19 | zachcarter | Idlework: yup! |
11:12:26 | dom96 | I think you can piggy back to gist on that. |
11:12:45 | dom96 | but then again, it would be handy |
11:13:20 | dom96 | You might be able to add the ability to save to an anonymous gist fairly transparently though. |
11:14:00 | zachcarter | yeah |
11:14:28 | Tiberium | Also - https://replit.canny.io/languages-requests/ we're close to Julia |
11:14:55 | Tiberium | but I think it take some time for them to actually start implementing Scala, Julia, and Nim |
11:17:10 | zachcarter | I tried to show the project to my boss at work and he didnt’ understand it |
11:17:13 | PMunch | How do you do permissions and stuff? |
11:17:42 | zachcarter | PMunch : some permissions are set in the code |
11:17:50 | zachcarter | others are set in the scripts |
11:18:18 | zachcarter | you can configure the temporary directory to write to |
11:18:46 | zachcarter | and the service needs read rights in its own directory |
11:20:23 | PMunch | Hmm, echo staticExec("whoami") returns root. Please tell me that's not right :P |
11:20:36 | zachcarter | PMunch it’s running inside a docker container |
11:20:43 | euantor | Ha, I sent a message mentioning you earlier zachcarter just after you'd disconnected |
11:20:46 | * | Sembei quit (Ping timeout: 268 seconds) |
11:20:46 | PMunch | Ah right |
11:20:48 | zachcarter | so do whatever you want |
11:20:49 | zachcarter | :P |
11:20:50 | PMunch | That helps :P |
11:21:00 | euantor | THe issue is fixed for me, and I was wondering what you'd done to get it fixed |
11:21:02 | zachcarter | ah yeah it was late for me euantor |
11:21:06 | dom96 | Shall I point play.nim-lang.org to your IP? :) |
11:21:10 | dom96 | or should it be try.nim-lang.org? |
11:21:32 | zachcarter | hrm this is up to you but yes I think that’ d be wonderful! |
11:21:46 | euantor | I know it's been mentioned but the only thing I'd like to see is realtime update of the compiler status |
11:21:55 | euantor | Perhaps WebSockets would be the way to go for that? |
11:22:06 | zachcarter | I’m not sure how I’d do that |
11:22:16 | dom96 | That seems like it way more trouble than it's worth :) |
11:22:38 | zachcarter | I’m restricting network access to the docker container |
11:22:48 | dom96 | So which subdomain would you like? |
11:22:57 | zachcarter | whatever you think is best dom96 |
11:23:06 | zachcarter | I assumed play, but try is fine too |
11:23:15 | ldlework | paste.nim-lang.org |
11:23:17 | Tiberium | to be honest, even rust doesn't have "stream compiler log" feature |
11:23:22 | Tiberium | (i mean rust playground_ |
11:23:39 | zachcarter | euantor: to fix it I just used a script tag in the vdom instead of trying to fiddle with the body onload stuff |
11:23:53 | ldlework | Also is there no permanent host? |
11:24:05 | zachcarter | https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/app.nim#L74 |
11:24:18 | zachcarter | it’s hosted on digital ocean atm |
11:24:19 | euantor | That would make sense actually, never thought of that |
11:24:26 | zachcarter | me either until last night :P |
11:24:30 | dom96 | Both rust and go call it 'play' |
11:24:32 | dom96 | so play it is |
11:24:40 | zachcarter | yay! |
11:24:48 | euantor | nice! |
11:25:06 | euantor | Will it also have HTTPS support in that case? |
11:25:12 | euantor | Just to add another job to the list ;) |
11:25:21 | zachcarter | I’ll probably need the certs |
11:25:24 | dom96 | https://play.nim-lang.org/ |
11:25:27 | zachcarter | and I can set up https |
11:25:29 | Tiberium | yay |
11:25:32 | zachcarter | oh wow |
11:25:32 | Tiberium | it's HTTPS already |
11:25:33 | Tiberium | lol |
11:25:33 | zachcarter | that was fast |
11:25:35 | zachcarter | :D |
11:25:36 | dom96 | CloudFlare takes care of that |
11:25:43 | zachcarter | sweeeeet |
11:25:47 | ldlework | zachcarter: did you use jwilder's nginx image? |
11:25:49 | dom96 | but SSL between CloudFlare and your server would be nice too of course |
11:26:02 | zachcarter | Idlework: no, I didn’t use docker for deployment |
11:26:05 | FromGitter | <Varriount> zacharycarter: Isn't it possible for a submission to delete/replace the compiler? |
11:26:09 | ldlework | oh I thought you said you did |
11:26:21 | zachcarter | no just for the code execution part |
11:26:27 | ldlework | any reason? |
11:26:28 | Tiberium | oh wait |
11:26:33 | Tiberium | it doesn't work |
11:26:36 | zachcarter | Varriount: I suppose so but it’d just affect that docker container |
11:26:38 | Tiberium | "app.js:2083 Mixed Content: The page at 'https://play.nim-lang.org/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://162.243.192.65:3000/compile'. This request has been blocked; the content must be served over HTTPS." |
11:26:50 | ldlework | change your links to :// |
11:26:53 | dom96 | D: |
11:26:54 | euantor | yeah, there's an absolute path hardcoded in the front end |
11:27:00 | zachcarter | okay I’ll change it to https |
11:27:15 | zachcarter | one sec |
11:27:17 | euantor | remove the IP altogether, you probably don't want to expose that |
11:27:31 | zachcarter | sure |
11:27:37 | ldlework | don't change it to https, change it to the url form that will use the current schema |
11:27:45 | ldlework | yeah |
11:27:48 | zachcarter | okay |
11:27:54 | dom96 | lol, the Rust playground just accepts the code in the URL |
11:27:54 | FromGitter | <Varriount> zachcarter: I'll see if I can poke any holes in the sandbox. |
11:28:00 | zachcarter | awesome |
11:28:07 | zachcarter | it needs its run through |
11:28:13 | dom96 | yeah, the IP should be hidden |
11:28:22 | dom96 | CloudFlare will protect you from DDoS |
11:28:38 | zachcarter | ://play.nim-lang.org:3000/compile |
11:28:40 | zachcarter | that look good? |
11:29:05 | zachcarter | I guess I should make this configurable real quick |
11:29:06 | ldlework | well I can't remember if it uses the : but I think it does |
11:29:11 | zachcarter | okay |
11:29:11 | Tiberium | I think no |
11:29:17 | ldlework | /compile should work |
11:29:27 | zachcarter | what about the port? |
11:29:28 | Tiberium | maybe you can just do same 80 port? |
11:29:32 | Tiberium | somehow |
11:29:38 | ldlework | /compile will use the same port |
11:29:45 | zachcarter | it doesn’t though atm |
11:29:48 | zachcarter | I’d have to update nginx too |
11:29:54 | ldlework | ? |
11:30:02 | Tiberium | ldlework, currently compile uses 3000 |
11:30:08 | ldlework | oh I see |
11:30:12 | dom96 | I don't think cloudflare will work with port 3000 |
11:30:18 | ldlework | best way to do it is in nginx for sure! |
11:30:26 | euantor | Yeah, I would update nginx to reverse proxy it |
11:30:29 | zachcarter | okay |
11:30:35 | zachcarter | I will fix these things, one moment |
11:30:43 | ldlework | zachcarter: great work. |
11:30:47 | ldlework | good night |
11:30:53 | zachcarter | thanks, gn |
11:31:06 | Tiberium | and next we must set up a favicon.ico and we're ready :) |
11:32:54 | Tiberium | "If `s` contains extra data, it will raising `JsonParsingError`." "raising" is correct here? |
11:33:44 | euantor | `it will raise` |
11:34:20 | Tiberium | there's a couple of comments like that in json parser |
11:36:12 | FromGitter | <Varriount> Tiberium: It should be 'raise', 'raising' is future-tense |
11:36:30 | FromGitter | <Varriount> English tenses are weird. |
11:37:21 | PMunch | Hmm, I'm trying to install the nim-geocoding package but nimble complains that package names can't contain '-' |
11:37:28 | Tiberium | you can clone it locally |
11:37:32 | Tiberium | rename it and install |
11:37:37 | Tiberium | (as a workaround) |
11:37:41 | PMunch | Fair enough |
11:37:49 | PMunch | Wonder if it still works :P |
11:37:59 | PMunch | Requires Nim 0.10.0 or up.. |
11:38:39 | FromGitter | <Varriount> zachcarter: Might try running the Nim program through Google's closure compiler tool, to optimize and minify it. |
11:39:06 | zachcarter | hmm good idea |
11:39:23 | FromGitter | <andreaferretti> I get an error 521 on https://play.nim-lang.org/ |
11:39:34 | FromGitter | <andreaferretti> and it seems to reload continuously |
11:39:37 | Tiberium | https://github.com/nim-lang/Nim/pull/5758 |
11:40:02 | Tiberium | omg, and now we need to wait if tests will break because of comments :D |
11:40:44 | Tiberium | andreaferretti: it doesn't work right now, but it will work if you go directly to the IP |
11:41:01 | FromGitter | <andreaferretti> yeah, I know |
11:41:04 | FromGitter | <Varriount> Tiberium: I could merge it in now. :D |
11:41:14 | FromGitter | <andreaferretti> but I read it was already working a few liens bove |
11:42:08 | PMunch | Hmm, got this http://ix.io/rQE has SSL support been removed from httclient? |
11:42:10 | Tiberium | someone said that https://play.nim-lang.org website was working (DNS and such) |
11:42:20 | Tiberium | PMunch, no |
11:42:24 | Tiberium | PMunch, you need to compile with -d:ssl |
11:42:38 | Tiberium | PMunch, nim c -d:ssl somefile.nim |
11:42:50 | PMunch | Ah right |
11:43:14 | Tiberium | https://github.com/nim-lang/Nim/pull/5750 I love this PR name |
11:43:17 | PMunch | Okay, now I'm getting some other error. Thanks :) |
11:44:06 | zachcarter | okay I fixed nginx |
11:44:16 | zachcarter | http://162.243.192.65 appears to work |
11:44:25 | zachcarter | not sure why play.nim-lang.org still isnt’ working |
11:44:36 | zachcarter | cache maybe? |
11:44:39 | FromGitter | <Varriount> zachcarter: `import osproc;execCmd("/bin/bash -c \"rm -rf /\"")` |
11:44:56 | Tiberium | zachcarter, "Mixed Content: The page at 'https://play.nim-lang.org/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://162.243.192.65:3000/compile'. This request has been blocked; the content must be served over HTTPS." |
11:45:13 | Tiberium | you need to serve compile endpoint over https too |
11:45:16 | FromGitter | <andreaferretti> I do not see such an error |
11:45:18 | zachcarter | Tiberium: if you try http://162.243.192.65 that error should be gone |
11:45:21 | FromGitter | <andreaferretti> just a cloudflare error page |
11:45:38 | Tiberium | zachcarter, I know that it works by direct IP |
11:45:41 | Tiberium | because it's not https |
11:45:52 | zachcarter | I removed the hardcoded url |
11:45:59 | zachcarter | but it’s acting like I didn't |
11:46:07 | zachcarter | Varriount: I should probably try to catch that |
11:46:11 | Tiberium | cloudflare cache |
11:46:20 | zachcarter | Tiberium: that would be my guess |
11:46:25 | Tiberium | zachcarter, maybe you can overwrite some libraries like osproc? |
11:46:29 | Tiberium | with empty .nim files :) |
11:46:57 | dom96 | zachcarter: I cleared the cache for you |
11:47:01 | zachcarter | thanks |
11:47:19 | Tiberium | or maybe there's a way to restrict executing shell commands from executable? |
11:47:46 | zachcarter | bleh it’s still not working not sure I need to get ready for work but I’ll continue troubleshooting afterwards |
11:48:05 | Tiberium | zachcarter, I think in the future you need to make "nim" compile binary files as user "nobody" |
11:48:17 | Tiberium | so no one can damage docker image |
11:48:50 | zachcarter | oh it is working |
11:48:55 | zachcarter | https://play.nim-lang.org/ |
11:48:56 | FromGitter | <andreaferretti> works for me now |
11:49:01 | zachcarter | yay! |
11:49:10 | zachcarter | Tiberium: good idea |
11:49:32 | Tiberium | works for me too |
11:49:35 | Tiberium | good job! |
11:49:35 | zachcarter | I can do that right now actually |
11:49:37 | zachcarter | the nobody thing |
11:49:39 | FromGitter | <Varriount> zachcarter: And run with as little privilege as possible |
11:49:47 | FromGitter | <Varriount> So I can't erase the entire iamge. |
11:49:56 | zachcarter | what happens when you erase the image |
11:49:57 | zachcarter | just curious? |
11:50:04 | FromGitter | <Varriount> Want to find out? |
11:50:11 | zachcarter | sure |
11:50:14 | Tiberium | nothing, but your compile will not be accessible |
11:50:20 | Tiberium | you will need to recreate image |
11:50:41 | dom96 | Can't you recreate the image each time? |
11:50:53 | zachcarter | I don’t even think it’s going to wipe out the image |
11:50:57 | zachcarter | I think it’s just going to wipe out the container |
11:51:01 | Tiberium | I think it would be slower, but I might be mistaken |
11:51:58 | zachcarter | rm: it is dangerous to operate recursively on '/' |
11:51:59 | zachcarter | rm: use --no-preserve-root to override this failsafe |
11:52:04 | Tiberium | yes |
11:52:11 | Tiberium | just add "--no-preserve-root" |
11:52:13 | Tiberium | and you're done :D |
11:52:19 | zachcarter | I did |
11:52:21 | Tiberium | rm -rf / --no-preserve-roo |
11:52:27 | Tiberium | lol |
11:52:28 | zachcarter | okay you just get empty logs |
11:52:40 | zachcarter | the next time you run something |
11:52:41 | zachcarter | it works again |
11:52:46 | zachcarter | I’m actually fine with this |
11:53:15 | zachcarter | the one security vulnerability I really worry about at the moment is someone injecting malicious JS / HTML |
11:53:24 | zachcarter | not sure if that’s possible or not but it might be |
11:53:38 | FromGitter | <Varriount> zachcarter: Are all submissions run in the same instance/image? |
11:53:44 | zachcarter | nope! |
11:53:50 | zachcarter | an instance is created for every submission |
11:53:56 | FromGitter | <Varriount> Woah, really? |
11:53:58 | zachcarter | yup |
11:54:00 | Tiberium | really? |
11:54:02 | zachcarter | with a 20s timeout |
11:54:08 | FromGitter | <Varriount> I didn't know docker was that fast. |
11:54:16 | Tiberium | zachcarter, also don't forget to add guid for source files |
11:54:21 | Tiberium | because for now I can "echo readFile("/usercode/in.nim")" |
11:54:31 | Tiberium | ah nvm |
11:54:41 | euantor | yeah, we talked about that yesterday |
11:54:44 | Tiberium | so each code sample is being run in different containers? |
11:54:46 | zachcarter | yeah it has a guid now so submissions don’t step on each other |
11:54:48 | zachcarter | yup |
11:54:58 | zachcarter | every request spins up its own docker instance |
11:55:10 | FromGitter | <Varriount> Which means one user can't poison a binary (such as GCC) |
11:55:19 | FromGitter | <Varriount> and affect other users |
11:55:35 | zachcarter | although things seem broken now |
11:55:42 | zachcarter | oh |
11:55:46 | Tiberium | maybe we can try import osproc;execCmd(":(){ :|: & };:") ? |
11:55:48 | zachcarter | cause I’m using chrome still :p |
11:55:50 | Tiberium | it's a fork bomb |
11:56:09 | Tiberium | It will slowdown entire machine as I think |
11:56:33 | zachcarter | just that container :P |
11:56:47 | Tiberium | I'll try now :D |
11:56:50 | zachcarter | okay |
11:56:57 | zachcarter | yeah please beat on this thing |
11:57:26 | Tiberium | lol |
11:57:26 | Tiberium | sh: 1: Syntax error: Bad function name |
11:57:31 | PMunch | Tiberium, you can also just use staticExec without osproc |
11:58:13 | Tiberium | it hanged out |
11:58:27 | Tiberium | ok |
11:59:01 | FromGitter | <Varriount> zachcarter: Just in case, I would recommend hardening as much as possible outside the Docker containers |
11:59:31 | FromGitter | <Varriount> If someone does manage to escape the sandbox, it's best to make things hard |
11:59:41 | zachcarter | yeah I think I just need to harden the service file |
11:59:48 | Tiberium | it reminds me of something |
12:00:04 | zachcarter | good suggestion Varriount: I’ll work on that today |
12:00:29 | FromGitter | <Varriount> zachcarter: What kind of network access so the containers have? |
12:00:34 | zachcarter | none |
12:00:55 | FromGitter | <Varriount> Ah good. No sending spam out. |
12:01:14 | zachcarter | yup! |
12:02:32 | PMunch | Tiberium, http://ix.io/rQL |
12:02:37 | PMunch | Running the fork-bomb :P |
12:03:30 | PMunch | The container seems to abort after a short while though :P |
12:03:55 | zachcarter | things ar eprobably broken |
12:03:57 | zachcarter | atm |
12:04:01 | zachcarter | I’m hardening things on the server |
12:04:15 | Tiberium | maybe at the end of this week we can spread the word about this new service? |
12:04:43 | FromGitter | <Varriount> I wish we had a professional pen tester |
12:06:26 | FromGitter | <Varriount> zachcarter: You might also want to impose a limit on the amount of standard output read/transferred |
12:06:44 | zachcarter | I could do that |
12:07:37 | Tiberium | ok, question about nim. I want to have code like "vk.users.get(id=1)" and I want it to translate to api.callMethod("users.get", {"id":"1"}) |
12:07:43 | Tiberium | can I do that with macros? |
12:07:55 | zachcarter | Varriount: I may be able to get a buddy at work to run a pen test for me |
12:10:10 | * | Vladar joined #nim |
12:14:39 | * | zachcarter quit (Quit: zachcarter) |
12:24:28 | * | sz0 quit (Quit: Connection closed for inactivity) |
12:31:03 | * | yglukhov quit (Remote host closed the connection) |
12:32:30 | PMunch | Tiberium, don't see why not |
12:32:36 | Tiberium | PMunch, and then another thing |
12:32:45 | Tiberium | how can I produce code with await's ? |
12:32:47 | Tiberium | from macro |
12:32:52 | Tiberium | or template |
12:33:41 | * | yglukhov joined #nim |
12:34:49 | PMunch | Write an example of the code you want to create and then run dumpTree: on it. Then you will see what you need to do to recreate it :) |
12:35:25 | * | Sentreen quit (Quit: WeeChat 1.4) |
12:37:56 | * | Sentreen joined #nim |
12:40:02 | Tiberium | PMunch, it's not that easy with await |
12:41:15 | Tiberium | all "await" are required to be placed in async procs, but if I generate "await" in macro (which is not an async proc), Nim complains that it can't find "await" |
12:41:44 | Tiberium | Error: undeclared identifier: 'await' |
12:43:27 | Tiberium | so I want to generate 'await' identifier outside of async proc (but this identifier will be placed into async proc later) |
12:43:53 | Tiberium | because async proc is generated by another macro |
12:44:16 | Tiberium | yeah, there's a workaround: merge this two macros into one |
12:45:24 | Tiberium | but then it will look very messy |
12:45:39 | PMunch | Hmm |
12:45:41 | PMunch | I see |
12:45:54 | PMunch | What about having a macro with sub-procedures |
12:46:56 | PMunch | Would that work? |
12:47:06 | PMunch | Or you could do something like what I did in wxnim |
12:47:11 | PMunch | https://github.com/PMunch/wxnim/blob/master/genui.nim |
12:47:26 | PMunch | Having a intermediate format which is then later converted into code |
12:51:06 | * | fredrik92 joined #nim |
12:51:20 | PMunch | Hmm, can I define a proc that returns a tuple or nil? |
12:52:06 | Tiberium | I think yes |
12:52:22 | Tiberium | if you want to return "nil", just don't change "result" variable and just do "return" |
12:53:47 | Tiberium | ok, for now I'll use "await vk users.get()" |
12:54:44 | * | smt__ joined #nim |
12:55:14 | PMunch | That would just return the default value wouldn't it |
12:55:59 | PMunch | Yeah, that just returns a tuple with default values. |
12:56:05 | Tiberium | PMunch, ah, hmm |
12:58:47 | * | smt_ quit (Ping timeout: 260 seconds) |
12:59:57 | * | fredrik92 quit (Quit: Disconnecting) |
13:03:55 | Tiberium | ok, another question: how to convert everything to string in macro? |
13:04:08 | Tiberium | I want to construct a table |
13:05:34 | * | zachcarter joined #nim |
13:06:45 | Tiberium | (i mean nnkIntLit, nnkFloatLit |
13:08:43 | * | Sembei joined #nim |
13:08:48 | dom96 | everything? `$` typically |
13:09:27 | PMunch | dom96, I think he meant how can he convert a nnkIntLit AST node to a string node |
13:10:04 | Tiberium | yeah, for table construction |
13:10:11 | dom96 | newStrLitNode($intNode) would be my guess |
13:10:16 | * | krux02 joined #nim |
13:11:07 | Araq | newLit($x.intVal) |
13:13:11 | Tiberium | that worked |
13:13:19 | Tiberium | thanks! |
13:15:02 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:20:17 | arnetheduck | Araq, what do you think about running detect.nim on the build servers and upload the generated files to github pages or something similar? that would make it easy to grab constants for tested platforms.. |
13:20:43 | * | devted quit (Quit: Sleeping.) |
13:20:59 | arnetheduck | poked around a little in travis, and it should be possible, though there's some access / auth stuff to set up |
13:21:35 | demi- | arnetheduck: i imagine to push to a github pages thing you just need an auth token |
13:22:15 | arnetheduck | yeah, and some magic in travis.yml |
13:22:42 | Tiberium | you can encode your auth key |
13:23:33 | Tiberium | https://docs.travis-ci.com/user/deployment/releases/#Authenticating-with-an-Oauth-token there's an example for deploy |
13:26:19 | * | krux02 quit (Disconnected by services) |
13:26:19 | * | krux02- joined #nim |
13:26:21 | * | krux02- is now known as krux02 |
13:26:33 | * | krux02 quit (Disconnected by services) |
13:26:34 | * | krux02- joined #nim |
13:26:42 | * | krux02 joined #nim |
13:31:43 | * | Sembei quit (Ping timeout: 240 seconds) |
13:35:23 | * | krux02 quit (Remote host closed the connection) |
13:39:46 | Araq | arnetheduck: I don't have an opinion yet but one option is to make koch.nim exec detect.nim on Nim installation time for the exotic platforms out there |
13:40:11 | Araq | the build servers don't have to be touched, I can easily run detect.nim on the 3 OSes that are tested anyway |
13:41:03 | Araq | but the proliferation of posix_os_cpu.nim combinations is a valid concern, it's ugly |
13:46:49 | krux02- | I recently tried to run Nim opengl on nixos, it just failed. |
13:47:15 | krux02- | the simple program "import opengl" already crashes |
13:48:35 | dom96 | Araq: arnetheduck: Couldn't we somehow perform this detection at compile-time? Just a crazy idea, it probably would be far too messy. |
13:49:28 | arnetheduck | dom96, not without having a c compiler and c headers present, which sort of defeats the purpose |
13:50:09 | dom96 | Ahh, then using koch to do it is out too. |
13:51:09 | Araq | no, why? koch can do it. built with the existing posix.nim |
13:51:18 | arnetheduck | Araq, I can't think of a way to get around that proliferation - either it will be in separate files or one giant file with when blocks - no real difference there really except I think it's easier to manage the files separately |
13:51:25 | Araq | and then koch patches the stdlib to use a more specialized posix.nim |
13:51:57 | arnetheduck | koch could do it if the pre-genned file is not available, it's not a bad idea |
13:52:58 | arnetheduck | on the unmaintained platforms, the headers are needed anyway, might as well have koch do the work and have the constants as real nim constants |
13:54:04 | arnetheduck | the point with letting the build servers do it is when a constant is added, then there's a stable source of detect runners |
13:54:31 | Araq | the build servers start with a Nim installation |
13:54:52 | Araq | I mean with our "installation" instructions |
13:55:15 | Araq | patch koch and the infrastructure takes care of the rest |
13:57:39 | arnetheduck | still needs an upload somewhere so that they can be put in the main repo for "supported" platforms |
13:59:49 | * | couven92 quit (Quit: Client disconnecting) |
13:59:52 | Araq | not really, everybody runs koch during the installation process |
14:03:00 | * | PMunch quit (Quit: leaving) |
14:03:12 | * | Sembei joined #nim |
14:06:03 | dom96 | Doesn't this also require a C compiler and C headers to be present? |
14:06:40 | arnetheduck | hm, that's not bad actually for now - eventually pregenned files would allow us to avoid -devel dependencies, but it's a really good step forward, and the rest of the way is pretty long |
14:07:07 | arnetheduck | dom96, yes, but the constants are properly available to nim, instead of being fake vars |
14:07:54 | dom96 | I don't understand why performing this detection at compile-time isn't ok, but using koch to do it is. |
14:08:26 | arnetheduck | now, it's possible to do something like posix.RTLD_LAZY = 42, and from nims point of view, that's perfectly ok |
14:08:43 | arnetheduck | there's gonna be a compile error in the c compile stage later on, but... |
14:09:05 | arnetheduck | being vars, they can't be used for many things either that require a const (think ctfe) |
14:09:30 | dom96 | To be clear, I'm talking about running the detect.nim script at compile time and using a macro to define these constants. |
14:09:49 | dom96 | If we could cache the results it might work well. |
14:13:01 | arnetheduck | sounds like a nightmare to debug.. and if you want to maintain that cache and check it for consistency, you'll incur quite a bit of compile time penalty as well |
14:15:33 | arnetheduck | it's important to remember that the c constants _never_ change - doing so would break so much stuff that it's virtually impossible to do |
14:16:41 | * | devted joined #nim |
14:16:58 | * | zachcarter quit (Quit: zachcarter) |
14:17:58 | * | zachcarter joined #nim |
14:19:58 | arnetheduck | hm, koch-at-install time won't work for cross compiling, or the tricks the build does to run parts of the compile with different -d:hostOs etc settings |
14:20:44 | Araq | that is a very good point |
14:21:12 | Araq | that pretty much means we need to have a static soup of const sections |
14:22:31 | arnetheduck | Araq, regarding the libc poc, would it be more digestible if it was a single libc.nim that ppl were to import? that's kind of the main point of that branch - single import or split-by-c-header doesn't really matter that much |
14:24:07 | arnetheduck | system does that already sort of with ansi_c.nim, that's the model I want to have for the std lib as well, instead of relying on "posix".. |
14:30:01 | * | couven92 joined #nim |
14:30:38 | Araq | I don't even want the libc dependency |
14:30:57 | Araq | so why would we have a special wrapper for it? |
14:32:42 | Araq | what problem do you actually want to solve? posix is a standard we have to live with, libc is an implementation detail |
14:32:49 | * | zachcarter quit (Quit: zachcarter) |
14:35:23 | * | zachcarter joined #nim |
14:35:30 | * | zachcarter quit (Client Quit) |
14:35:59 | * | Vladar quit (Quit: Leaving) |
14:36:47 | * | zachcarter joined #nim |
14:37:09 | FromGitter | <battila7> Hey! Sorry for disturbing but this is the best place for asking. There is this RealWorld example app initiative of Thinkster. Developing backend and frontend from the same specs with different techs and languages. https://github.com/gothinkster/realworld |
14:37:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:37:46 | FromGitter | <battila7> It'd be a great opportunity for Nim and Jester to compare with other backends |
14:37:53 | * | zachcarter quit (Client Quit) |
14:38:13 | FromGitter | <battila7> Sadly I'm not experienced enough with Nim but thought that someone here might take the challenge |
14:38:32 | * | zachcarter joined #nim |
14:43:36 | * | BennyElg quit (Remote host closed the connection) |
14:46:01 | Araq | thanks, sounds useful |
14:54:46 | * | aedigix quit (Ping timeout: 255 seconds) |
14:54:55 | arnetheduck | two problems to solve: posix and its lowest common denominator approach leads to it being poorly specified and therefore hard to import "correctly", and 2) on windows there's no posix, but there are a bunch of useful c library functions.. I suspect because of this, ppl are reluctant to import posix where it might not be so well defined or working. |
14:55:18 | arnetheduck | c is a standard too, there are so many to choose from ;) |
14:55:33 | FromGitter | <andreaferretti> @battila7 might be nice to showcase https://github.com/andreaferretti/rosencrantz |
14:55:38 | FromGitter | <andreaferretti> if I find the time |
14:56:46 | arnetheduck | saying that you want nim not to rely on c sounds optimistic at best - the c lib has a bunch of well optimized and tested code, and is a convenient gateway to the OS generally - not using it *as an implementation detail* seems like a waste |
14:57:31 | * | sz0 joined #nim |
14:57:47 | * | rauss joined #nim |
14:59:00 | arnetheduck | and effectively, it's no different from any other lib on the system, so having a thin wrapper that takes care of abi problems (and abi problems only) seems like a win, in clarity and ease of use for ppl implementing other parts of the nim std lib |
15:00:55 | FromGitter | <battila7> @andreaferretti This looks great! Do you have some experience on connecting it to some DB? |
15:01:21 | arnetheduck | you already have that situation in the posix library - epoll.nim for example is not part of any posix standard or version, yet it sits in the posix folder, why? |
15:01:24 | FromGitter | <battila7> I'm still contemplating whether to give it a shot on the weekend |
15:02:09 | dom96 | arnetheduck: indeed, the posix folder should be renamed to `unix` |
15:02:47 | arnetheduck | dom96, so where should "memcpy" be taken from? it's available on windows too |
15:03:41 | dom96 | no idea |
15:04:18 | arnetheduck | that's the point. if there's a libc library in wrappers, that's the one natural place to have it |
15:04:53 | Tiberium | a little wrapper for tinyexpr (and my first nimble package) - https://github.com/TiberiumN/nim-mathexpr |
15:05:37 | Tiberium | also "nimble publish" is magic |
15:05:38 | dom96 | arnetheduck: I'm happy with a libc module if that's what you're suggesting |
15:05:43 | Tiberium | doing all dirty work |
15:07:14 | arnetheduck | dom96, indeed, that's exactly what I'm suggesting: https://github.com/nim-lang/Nim/pull/5698 |
15:08:38 | arnetheduck | that branch goes a little further and has the libc module divided by c header, but that's really not necessary.. |
15:09:54 | * | couven92 quit (Quit: Disconnecting) |
15:10:45 | arnetheduck | Araq, btw, https://github.com/nim-lang/Nim/pull/5678 has a test now.. it's a little ugly because the behaviour is different in unix and windows, but it's.. tricky to do any other way since there aren't really any signals in nim |
15:10:51 | arnetheduck | *in windows |
15:10:54 | FromGitter | <andreaferretti> @battila7 no, but I would use something like https://github.com/jlp765/db |
15:11:33 | * | willprice joined #nim |
15:13:16 | * | aedigix joined #nim |
15:13:39 | arnetheduck | and thanks for all the other merges, with them, nlvm can now compile with a clean upstream nim - managed to set up travis for it as well |
15:15:51 | arnetheduck | works pretty well with markandsweep - can compile itself (still broken with default refcount gc though) |
15:17:25 | * | shashlick quit (Ping timeout: 260 seconds) |
15:18:38 | FromGitter | <battila7> @andreaferretti Thanks, nice one, I hope I'll have the time |
15:19:07 | * | shashlick joined #nim |
15:29:49 | Araq | memcpy is not libc, it's a nice way to get efficient inline asm |
15:32:17 | * | McSoFake joined #nim |
15:38:29 | zachcarter | dom96: thinking about swapping out spectre for http://bulma.io/ |
15:38:50 | * | Trustable joined #nim |
15:39:38 | dom96 | zachcarter: I like it |
15:39:54 | zachcarter | same, will do that this evening |
15:42:41 | FromGitter | <battila7> @zachcarter bulma is pretty easy to work with and looks great, I definitely suggest it |
15:43:11 | zachcarter | battila7: nice! good to hear |
15:53:04 | * | aziz joined #nim |
15:59:58 | FromGitter | <battila7> Opened an issue for Nim, gonna start working on it this weekend: https://github.com/gothinkster/realworld/issues/60 |
16:00:36 | FromGitter | <battila7> I think I'll ask a lot here about different Nim patterns :smile: |
16:10:45 | Tiberium | battila7: I'm not an experienced dev in Nim, but IMO it's better to pick Jester if you're not experienced in Nim like me, because Jester is written by dom96, core Nim developer, so you can get help faster :) But it's up to you for choose framework |
16:12:29 | dom96 | I would say that getting help from andreaferretti is pretty fast too :) |
16:13:22 | Tiberium | also, which library I can use for unpacking data from network protocol? In python there's https://docs.python.org/3/library/struct.html |
16:15:09 | * | Arrrr quit (Quit: Leaving.) |
16:22:56 | * | brson joined #nim |
16:24:35 | dom96 | Might need to create a nimble package for htat |
16:24:36 | dom96 | *thar |
16:24:37 | dom96 | *that |
16:32:31 | dom96 | aww yeah, got curl working with a progress bar :D |
16:33:39 | * | willprice94 joined #nim |
16:35:12 | * | willprice quit (Ping timeout: 260 seconds) |
16:38:21 | * | vlad1777d quit (Ping timeout: 268 seconds) |
16:52:04 | * | yglukhov quit (Remote host closed the connection) |
16:56:23 | krux02- | dom96: do you know wget, it has a progress bar by default ;) |
16:57:19 | dom96 | I'd rather have a consistent progress bar on all OS' |
16:58:38 | Tiberium | dom96, you're doing progress bar library for Nim? or just playing with curl? |
16:58:56 | Tiberium | because there's cool and simple https://pypi.python.org/pypi/tqdm |
16:59:03 | dom96 | I'm working on choosenim |
16:59:11 | Tiberium | you just wrap your iterable in tqdm() and it shows progress bar of this iterable |
16:59:11 | dom96 | Creating a progress bar isn't that difficult |
16:59:12 | * | ftsf quit (Ping timeout: 260 seconds) |
17:00:42 | demi- | there is a handly module for doing this already |
17:02:24 | Tiberium | demi-, what is it? |
17:03:15 | demi- | `progressbar` |
17:03:58 | Tiberium | demi-, maybe `progress` ? |
17:04:03 | demi- | yeah |
17:04:13 | demi- | something like that ¯\_(ツ)_/¯ |
17:10:35 | * | BennyElg joined #nim |
17:10:56 | euantor | Yeah, my progress library does that: https://github.com/euantorano/progress.nim |
17:11:11 | euantor | And is fairly customisable to most needs |
17:13:32 | FromGitter | <battila7> @Tiberium Yup, it seems to be a more rookie-friendly choice |
17:14:15 | FromGitter | <battila7> I'm a bit worried about the separation of concerns and best practices |
17:18:47 | Calinou | Bulma looks good, I forgot about it completely for some reason :P |
17:22:54 | Calinou | I should try it out, really |
17:23:59 | * | Sembei quit (Ping timeout: 268 seconds) |
17:26:20 | Calinou | 112 KB minified (non-gzipped), 16 KB minified and gzipped |
17:26:54 | Calinou | let's compare this to the latest Bootstrap 4 Git… |
17:26:57 | dom96 | hrm, I remember seeing this piece of art that doubled as QR code a while back on Reddit or somewhere but I can't find. |
17:27:06 | dom96 | Any chance anyone here stumbled upon the same thing and has a link? |
17:27:06 | Calinou | also, hi dom96 :) |
17:27:47 | FromGitter | <battila7> @Calinou I've used it together with Mithril for an SPA and they've made a good team together |
17:28:00 | Calinou | yeah, the fact you have to implement JavaScript features yourself makes sense |
17:28:09 | Calinou | it's lower-level for sure, but this way you're sure there is no jQuery dependency |
17:28:21 | Calinou | so you can easily fit it in Angular, React, Vue.js, etc… projects, without loading jQuery |
17:28:26 | Calinou | (which is still big, and slow, to date) |
17:28:48 | Calinou | most features seem to work without JavaScript anyway, but if eg. you want modals, you have to implement the class toggle yourself, it should be easy anyway |
17:29:55 | * | vivus joined #nim |
17:31:46 | * | TheLemonMan joined #nim |
17:32:08 | Calinou | Bootstrap 4 is 140 KB minified, 20 KB minified and gzipped, so it's a bit larger, but this is only the CSS |
17:32:40 | Calinou | if you add the (pretty much required) JavaScript, you have to add 48 KB minified, 16 KB minified and gzipped |
17:32:58 | Calinou | oh, and you also need Tether.js anyway with Bootstrap 4… so that's even more size to add :) |
17:33:06 | Calinou | and jQuery of course |
17:34:54 | * | yglukhov joined #nim |
17:35:05 | * | vlad1777d joined #nim |
17:36:42 | * | rauss quit (Ping timeout: 240 seconds) |
17:39:05 | * | rauss joined #nim |
17:39:20 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:39:52 | FromGitter | <battila7> That's gonna add up to a lot |
17:40:25 | FromGitter | <battila7> Have you checked Semantic? It is modularized pretty well so you can include only what's needed |
17:44:25 | Calinou | yeah, I've looked at Semantic UI |
17:44:40 | Calinou | the full package is gigantic, so you definitely want to use only what you need (but unfortunately, it takes time to select packages, and to add/remove them as needed…) |
17:44:48 | Calinou | it seems highly targeted at Web apps, rather than just websites |
17:45:16 | Calinou | Bulma has the advantage of having an usable (not too large) full package, not requiring jQuery or JavaScript, and being able to design both websites and Web apps |
17:54:17 | FromGitter | <battila7> Yeah, Semantic is a big gun for big things I think. But in the same time, quite fun to work with. |
18:10:13 | euantor | Just looked at that `tqdm` lib for Python, seems like a big library for something simple like a progress bar |
18:11:14 | euantor | It runs a thread to monitor a progress bar |
18:13:56 | Tiberium | euantor, I think that most python libraries aren't made for speed, but for usability |
18:14:06 | euantor | yeah, it seems that way |
18:17:15 | euantor | it does have some nice features, though I'm not sure how much more I want to add to progress as it's meant to be simple |
18:17:56 | zachcarter | gotta run to an appointment soon |
18:18:03 | * | zama quit (Remote host closed the connection) |
18:18:03 | zachcarter | but I started playing with bulma |
18:18:06 | zachcarter | dom96: http://imgur.com/a/BnhCe |
18:18:47 | * | zama joined #nim |
18:19:02 | euantor | Looks good! |
18:19:24 | zachcarter | thanks |
18:19:42 | zachcarter | anyways be back in a bit |
18:23:58 | * | zachcarter quit (Ping timeout: 252 seconds) |
18:24:03 | Tiberium | zachcarter, looks way cooler than other playgrounds |
18:24:15 | Tiberium | (i mean other languages) |
18:28:51 | * | yglukhov joined #nim |
18:30:41 | * | jrenner0001 joined #nim |
18:37:57 | * | zachcarter joined #nim |
18:53:50 | * | aziz quit (Remote host closed the connection) |
18:56:13 | * | zachcarter quit (Quit: zachcarter) |
19:00:20 | * | Matthias247 joined #nim |
19:16:26 | federico3 | can I convert a typedesc to a string? |
19:16:53 | krux02- | there is a package you can import where you can acces the name |
19:17:37 | krux02- | https://nim-lang.org/docs/typetraits.html |
19:17:51 | federico3 | tnx |
20:03:55 | * | Tiberium quit (Remote host closed the connection) |
20:09:06 | krux02- | my nim tetris has now animations yay |
20:09:22 | krux02- | very rudimentary, and not all animations, but the foundation is there |
20:12:17 | * | rokups quit (Quit: Connection closed for inactivity) |
20:13:05 | dom96 | krux02-: ever played/heard of Frets on Fire? |
20:13:29 | dom96 | It would be rather cool to port it to Nim. |
20:15:37 | Calinou | yeah, I almost wanted to make a rythm game once |
20:15:48 | Calinou | but it's not easy, you need to store scores, and have an editor for them |
20:26:13 | * | Sembei joined #nim |
20:28:58 | krux02- | dom96: yes heared of it |
20:29:47 | krux02- | but I am not really a fan of guitar hero nor its clones |
20:30:05 | krux02- | if I port something that it should be something that I enjoy, too. |
20:30:44 | * | McSoFake quit (Quit: leaving) |
20:30:51 | krux02- | also I don't think that fret's on fire is really that great fo a concept anymore, because more and more keyboards are non-standard (laptops and small sized keyboards) |
20:33:28 | * | Snircle joined #nim |
20:34:22 | * | shashlick quit (Ping timeout: 260 seconds) |
20:44:08 | * | Sentreen quit (Ping timeout: 260 seconds) |
20:46:39 | * | zachcarter joined #nim |
20:48:49 | * | rauss quit (Quit: WeeChat 1.7.1) |
20:58:20 | * | Sentreen joined #nim |
21:00:40 | FromGitter | <TiberiumPY> Hmm, would it be hard to implement this protocol? http://wiki.vg/Protocol |
21:01:56 | FromGitter | <TiberiumPY> (i mean packing and unpacking values) |
21:03:10 | dom96 | ooh, minecraft |
21:03:13 | dom96 | Sounds like fun |
21:03:29 | dom96 | Check to see if there are any unpacking Nimble packages |
21:03:47 | dom96 | If not then maybe you could reimplement Python's in Nim? |
21:05:24 | dom96 | As for your question, implementing the pure essentials of that protocol shouldn't be too difficult |
21:05:51 | dom96 | It would make sense to have a library that makes unpacking easier though |
21:08:14 | FromGitter | <edlich_twitter> Sorry: is there an echo without newline? like write(STDOUT, "myMessage) |
21:09:25 | FromGitter | <TiberiumPY> echo "hello" |
21:09:28 | FromGitter | <TiberiumPY> :D |
21:09:36 | FromGitter | <edlich_twitter> no this does a newline. |
21:09:39 | FromGitter | <TiberiumPY> Ah |
21:09:40 | FromGitter | <TiberiumPY> import os |
21:10:10 | FromGitter | <TiberiumPY> stdout.write("go") |
21:10:24 | FromGitter | <edlich_twitter> :-) thx!! |
21:10:25 | FromGitter | <TiberiumPY> I may be wrong :) |
21:11:09 | FromGitter | <edlich_twitter> works! Thanks. Without any import. |
21:16:32 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:18:45 | FromGitter | <TiberiumPY> dom96: there's two choices: port from C (CPython):https://github.com/python/cpython/blob/master/Modules/_struct.c or RPython(PyPy) : https://github.com/mozillazg/pypy/blob/eea0db70f96338d036569109a164edf31b093ba1/pypy/module/struct/interp_struct.py and https://github.com/mozillazg/pypy/blob/eea0db70f96338d036569109a164edf31b093ba1/pypy/module/struct/formatiterator.py |
21:19:14 | FromGitter | <TiberiumPY> But I think I know what I will use as a reference :) |
21:19:48 | dom96 | :) |
21:19:50 | federico3 | given B = ref object of A, can I run a specific proc/method "foo" for B in "for x in @[A(), B()]: foo(x)" ? |
21:19:56 | dom96 | You can also look at the docs and try implementing it that way |
21:21:02 | dom96 | federico3: the foo() defined for B will be run on the B() |
21:21:14 | dom96 | and the foo() defined for A will be run on the A() |
21:21:20 | dom96 | assuming they are methods |
21:21:40 | dom96 | Maybe you could do: foo(x.B)? |
21:23:03 | FromGitter | <TiberiumPY> Wait, maybe we can just use cast ? :D |
21:23:32 | FromGitter | <TiberiumPY> because this Python struct module unpacks C structure |
21:23:42 | FromGitter | <TiberiumPY> *structs |
21:23:57 | federico3 | dom96: aha, found the issue: I was actually trying to run method for B and C, both subclasses of A, without having a method for A |
21:24:35 | dom96 | Tiberium: You might be able to, yeah. |
21:24:46 | dom96 | Tiberium: Be careful of little-endian vs. big-endian |
21:26:13 | FromGitter | <TiberiumPY> Sadly this protocol used big endian |
21:40:37 | FromGitter | <Varriount> euantor: In python world, design tends to trump speed. |
21:41:11 | euantor | That seems to be the case. That library does look nice |
21:41:33 | FromGitter | <Varriount> The reason being that speed is rarely a constraint |
21:51:17 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:54:23 | * | Trustable quit (Remote host closed the connection) |
21:57:32 | * | zachcarter quit (Read error: Connection reset by peer) |
21:57:50 | * | zachcarter joined #nim |
22:04:11 | * | yglukhov quit (Remote host closed the connection) |
22:10:34 | * | bjz joined #nim |
22:10:59 | * | yglukhov joined #nim |
22:18:55 | * | willprice94 quit (Ping timeout: 255 seconds) |
22:30:29 | * | devted quit (Quit: Sleeping.) |
22:40:07 | * | nsf quit (Quit: WeeChat 1.7) |
22:44:28 | * | sz0 quit (Quit: Connection closed for inactivity) |
22:46:26 | * | krux02- quit (Remote host closed the connection) |
22:49:50 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:56:40 | * | Sembei quit (Ping timeout: 260 seconds) |
23:04:27 | * | bjz joined #nim |
23:12:31 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:21:02 | * | vlad1777d quit (Quit: Leaving) |
23:35:13 | zachcarter | I put up a new front end for the website but I’m still getting the old css for some reason |
23:37:28 | zachcarter | dom96: does cloudflare need to have its caches cleared for stuff like that? |
23:44:26 | zachcarter | http://imgur.com/a/unjKJ |
23:44:32 | zachcarter | here’s what it should look like ;) |
23:51:20 | dom96 | you might be able to append ?somethign_random_and_unique to the CSS url every time you update it |
23:51:28 | dom96 | I think the CSS is primarily cached |
23:51:30 | dom96 | the HTML not so much |
23:52:25 | zachcarter | hrm okay |
23:52:29 | dom96 | I cleared for you now anyway |
23:52:33 | zachcarter | thank you |
23:52:35 | dom96 | but I must head to bed |
23:52:38 | dom96 | see you tomorrow |
23:52:43 | zachcarter | good night! |