00:04:30 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:09:17 | * | PMunch quit (Quit: leaving) |
00:22:15 | * | devted quit (Quit: Sleeping.) |
01:01:07 | * | libman quit (Quit: Connection closed for inactivity) |
01:05:09 | * | zachcarter quit (Quit: zachcarter) |
01:13:04 | * | Lord_Nightmare joined #nim |
01:37:40 | * | chemist69 quit (Ping timeout: 258 seconds) |
01:49:59 | * | chemist69 joined #nim |
02:30:24 | * | rauss joined #nim |
02:59:09 | * | sz0 joined #nim |
03:27:59 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:35:59 | FromGitter | <Varriount> Profile it? |
03:39:25 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:43:48 | * | chemist69 joined #nim |
04:36:01 | * | BennyElg quit (Remote host closed the connection) |
05:28:26 | * | Lord_Nightmare2 joined #nim |
05:29:16 | * | Lord_Nightmare quit (Ping timeout: 260 seconds) |
05:29:19 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
05:47:13 | * | chemist69 quit (Ping timeout: 258 seconds) |
05:52:21 | * | chemist69 joined #nim |
06:38:24 | * | BennyElg joined #nim |
06:38:29 | * | rauss quit (Quit: WeeChat 1.7) |
06:39:03 | * | BennyElg_ joined #nim |
06:39:03 | * | BennyElg quit (Read error: Connection reset by peer) |
06:41:43 | * | BennyElg_ quit (Read error: Connection reset by peer) |
06:41:53 | * | BennyElg joined #nim |
07:20:24 | * | bjz quit (Ping timeout: 240 seconds) |
07:23:49 | * | bjz joined #nim |
07:28:48 | BennyElg | Hey, Anything like BeautifulSoup? |
07:32:06 | Araq | htmlparser? |
07:32:29 | Araq | or parsehtml? |
07:35:02 | * | McSoFake joined #nim |
07:35:13 | BennyElg | I'll check them both , thanks! |
07:41:21 | BennyElg | Araq: any nim repl for practice? (Even if it's not stable) |
07:45:23 | Araq | you can use 'nim secret' but I dunno why anybody would prefer typing in a terminal |
07:46:14 | Araq | why did we move away from Turbo Pascal? |
07:48:10 | BennyElg | Because sometime you would like to test things fast, or practice new behavior without "compiling" every sec |
07:48:57 | Araq | so use VS Code with the Nim plugin? |
07:49:24 | BennyElg | Sorry I didnt get you. |
07:49:49 | Araq | you type, it tells you your errors. |
07:50:49 | BennyElg | Yep, But sometimes its easy to see things right after you write them, it's something i got use to when I develop in python |
07:51:07 | BennyElg | Most of the code I wrote in my life were written in python. |
07:52:10 | Araq | good for you. most of the code I wrote was written in a language with a type system. |
07:52:37 | BennyElg | I'm working in Gett company as a big-data enginner . big data world is scala and python |
07:52:52 | BennyElg | scala is a type system too but has it's own repl |
07:53:15 | BennyElg | which is very handful when you use some external libraries such Apache spark |
07:53:20 | Araq | a REPL is nice when you keep the data in RAM and try different transformations on it |
07:53:31 | BennyElg | exactly. |
07:53:44 | Araq | but you wrote "(Even if it's not stable)" |
07:53:56 | Araq | I interpreted that as "just for learning purposes" |
07:54:09 | BennyElg | Yea, Because I'm not writing for any production now. it's for practice manner |
07:54:30 | Araq | and for learning I advise you to use an editor with a plugin. |
07:54:50 | BennyElg | Till Inteliji will create us a end 2 end IDE ?:) |
07:55:06 | Araq | because in a statically typed language you don't run code all the time, you typecheck it all the time. |
07:55:43 | BennyElg | You are right, its a bad thing to do and I should get use to write only in editor. |
07:57:06 | BennyElg | They guy who wrote nim book is sometime in IRC? |
08:01:51 | Araq | I think so |
08:05:32 | BennyElg | I check the library httpclient but its not support javascript. :/ |
08:08:38 | FromGitter | <stisa> BennyElg : with browser js you can access the dom with the dom module |
08:12:43 | BennyElg | @FromGitter can you show an example of how to request page and get also the JS content? I am trying to connect some so I m trying to httpclient.request(....) |
08:12:44 | FromGitter | BennyElg, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
08:22:52 | BennyElg | Nimble Is Awesome! |
08:36:14 | * | _orangejuice joined #nim |
08:38:24 | FromGitter | <stisa> BennyElg not sure I understand what you're trying to do, I think you need Ajax to get a page with js so http://stisa.space/ajax/examples/ex1.html maybe ? |
08:44:00 | * | nightmared quit (Quit: WeeChat 1.7) |
08:47:22 | * | nightmared joined #nim |
08:52:30 | * | rokups joined #nim |
08:57:51 | * | Arrrr joined #nim |
09:00:27 | * | zachcarter joined #nim |
09:01:12 | BennyElg | argparser (commandeer) any one used? |
09:02:18 | * | zachcarter quit (Read error: Connection reset by peer) |
09:03:01 | * | zachcarter joined #nim |
09:05:44 | * | Tiberium joined #nim |
09:08:57 | * | zachcarter quit (Quit: zachcarter) |
09:20:41 | * | zachcarter joined #nim |
09:23:26 | zachcarter | o/ |
09:59:46 | * | couven92 joined #nim |
10:01:33 | * | Matthias247 joined #nim |
10:11:16 | * | BennyElg quit (Remote host closed the connection) |
10:12:34 | euantor | That Nim performance tuning blog post tweeted from the Twitter account is an interesting read, thanks for sharing it :) |
10:14:23 | * | BennyElg joined #nim |
10:32:10 | Arrrr | Yep, why are optimizations at link time disabled by default? |
10:49:27 | BennyElg | Im trying to figure out how to give an alias to each parameter but Its seems that it's not acceptable. |
10:55:06 | * | _orangejuice quit (Quit: Connection closed for inactivity) |
10:56:06 | BennyElg | How to catch db error? |
10:56:13 | BennyElg | try: |
10:56:13 | BennyElg | return db_mysql.open(host, user, password, db) |
10:56:13 | BennyElg | except db_mysql.DbError: |
10:56:15 | BennyElg | echo db_mysql.errormsg |
11:02:33 | * | Snircle joined #nim |
11:06:45 | * | Snircle quit (Read error: Connection reset by peer) |
11:07:29 | * | Snircle joined #nim |
11:17:34 | * | yglukhov joined #nim |
11:26:30 | * | moriarty joined #nim |
11:26:40 | * | moriarty left #nim (#nim) |
11:26:59 | FromGitter | <Varriount> Arrrr: Some systems (like Redhat) still use versions of GCC that don't support LTO |
11:29:19 | zachcarter | man a pure nim vorbis decoder would be sweet right about now :P |
11:32:11 | zachcarter | why does audio have to be so painful |
11:35:51 | demi- | i think that should be handled async, or loaded into memory beforehand |
11:36:14 | zachcarter | what decoding vorbis files? |
11:36:39 | demi- | generally |
11:36:43 | zachcarter | yeah |
11:36:57 | demi- | you mentioned last night that there was a big deal with loading those files on windows |
11:37:11 | zachcarter | oh well I’m not sure where the hang up is in the sound library :/ |
11:37:20 | zachcarter | I’m not sure if it’s in the loading of the file or the decoding of the file or what |
11:37:27 | zachcarter | I know it’s using stb_vorbis to do decoding |
11:37:50 | demi- | my point is that it should be irrelevant to usage, as you should be able to parallelize the decoding of all your needed files |
11:37:59 | demi- | and have them ready to go |
11:38:02 | zachcarter | ah okay |
11:38:48 | demi- | i mean, it isn't unheard of to have loading delays in games |
11:39:10 | zachcarter | I know but the delays are way more significant on windows than on osx |
11:39:14 | zachcarter | or linux |
11:39:41 | demi- | you should be able to do some perf testing to figure out where the hang-up is and report the issue |
11:39:58 | zachcarter | well I reported the issue before doing the aforementioned work :P |
11:40:08 | zachcarter | I guess I can make good use of my time and do that now |
11:41:06 | demi- | are you virtualizing windows or running it natively? |
11:41:45 | zachcarter | virtualizing but I’ve had native users test and they reported the same issue |
11:58:39 | zachcarter | it’s this specific section of code here causing issues : https://github.com/yglukhov/sound/blob/master/sound/private/sound_al.nim#L73-L82 |
11:59:30 | zachcarter | it takes 15.152s for the code to execute reading a 4.2mb ogg file on Windows 10 64 |
11:59:43 | zachcarter | sorry 15.064s |
12:04:56 | zachcarter | if I use a larger buffer size on windows of like 5mb it loads in 2 :P |
12:05:36 | * | zachcarter quit (Read error: Connection reset by peer) |
12:05:57 | * | zachcarter joined #nim |
12:17:45 | * | Sentreen joined #nim |
12:21:14 | dom96 | zachcarter: hey, you wanted to discuss the playground/sandbox site? |
12:21:43 | zachcarter | o/ dom96: I did although I guess Tiberium found a project someone else had already built that was working as one |
12:21:51 | zachcarter | albeit on an old version of Nim |
12:22:05 | dom96 | yes, I saw. It uses JS though |
12:22:07 | dom96 | Doesn't it? |
12:22:10 | zachcarter | I believe so |
12:22:14 | Tiberium | yeah it does |
12:22:17 | Tiberium | via emscripten |
12:22:30 | Tiberium | but it works on 0.16.1 too (tested yesterday), but without modules |
12:22:33 | dom96 | That's not the same IMO. |
12:22:49 | Tiberium | it's just compiler compiled via emscripten |
12:23:25 | dom96 | hrm |
12:23:57 | dom96 | But doesn't it still use Nim's JS backend? |
12:24:34 | zachcarter | I believe so |
12:24:35 | zachcarter | https://jscheid.github.io/nim-sandbox/index.html |
12:24:44 | zachcarter | it generates JS not C |
12:24:57 | Tiberium | dom96, yes |
12:25:12 | Tiberium | this is real magic |
12:25:19 | Tiberium | rust can't do that :D |
12:25:29 | zachcarter | I guess my project could do both |
12:25:35 | dom96 | That's pretty cool but I would still prefer a proper website that compiles to C and executes the binary on the server/ |
12:25:40 | Tiberium | dom96, me too |
12:25:42 | zachcarter | this is what mine does |
12:26:07 | zachcarter | https://github.com/zacharycarter/nim-playground |
12:26:18 | dom96 | okay... so keep going, get it running so we can use it :) |
12:26:23 | zachcarter | I need a propper deployment solution |
12:26:47 | zachcarter | I think I’m just going to bite the bullet and set up my own docker image |
12:27:00 | dom96 | Honestly, you just set up a new DO droplet |
12:27:05 | zachcarter | okay |
12:27:07 | zachcarter | done that |
12:27:07 | dom96 | install nginx and edit a config file |
12:27:10 | zachcarter | okay |
12:27:22 | zachcarter | I’ll do this then |
12:27:36 | zachcarter | but I have to install Nim on the server too right? to compile my project? |
12:27:45 | zachcarter | or should I precompile it for digital ocean and then just move the binary over? |
12:27:48 | dom96 | https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04 |
12:28:01 | dom96 | Yes, you need to install Nim on the server |
12:28:09 | dom96 | or you can cross-compile and upload your binary |
12:28:13 | zachcarter | okay I’ll do that |
12:28:16 | zachcarter | thanks |
12:28:21 | * | PMunch joined #nim |
12:28:35 | zachcarter | dom96: I did work out a very cool cross compile deployment strategy for frag |
12:28:43 | zachcarter | you don’t have to install anything on your machine |
12:28:46 | zachcarter | besides docker |
12:28:57 | zachcarter | and you can cross compile your game for, lets say windows on osx |
12:29:09 | dom96 | Awesome. How did you do it? |
12:29:26 | dom96 | I guess Docker acts as a VM and you compile inside it? |
12:29:31 | zachcarter | exactly |
12:29:53 | zachcarter | I can post the dockerfiles somewhere |
12:30:18 | zachcarter | oh I did last night that’s right |
12:30:19 | zachcarter | https://gist.github.com/zacharycarter/66b5dc47ab0cfd677585fc389c0046df |
12:30:35 | zachcarter | the first one sets up the base image and installs Nim and everything |
12:30:45 | zachcarter | the second one is win64 specific |
12:30:52 | * | McSoFake quit (Quit: leaving) |
12:31:00 | dom96 | btw your playground code is blocking |
12:31:23 | zachcarter | I wanted to ask you about that too |
12:31:57 | dom96 | and have you tested that Docker sandboxes correctly? |
12:32:34 | zachcarter | not sure what you mean by whether it sandboxes correctly - I tried taking the binary and running it on a windows machine and it worked |
12:32:38 | dom96 | Things to check: create large files, try connecting to google.com, try accessing your machine's filesystem |
12:32:55 | zachcarter | okay |
12:33:06 | zachcarter | oh |
12:33:08 | zachcarter | I see what you mean |
12:33:11 | dom96 | By sandboxing I mean preventing users from doing bad things to your machine |
12:33:15 | zachcarter | okay |
12:33:22 | zachcarter | I haven’t tried that |
12:33:25 | zachcarter | how can I make this non-blocking btw? |
12:33:45 | zachcarter | I know the ^ operation blocks until the read completes |
12:34:28 | dom96 | You have to do something like this: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42 |
12:34:36 | dom96 | It's not ideal unfortunately |
12:34:52 | dom96 | basically use the `isReady` proc |
12:35:01 | zachcarter | okay gotcha thanks |
12:35:25 | dom96 | you can create a new async proc which will continuously check whether the flow var is ready |
12:36:45 | zachcarter | okay I’ll do that |
12:46:22 | ftsf | hmm undeclared identifier `inf` |
12:46:32 | ftsf | isn't inf a predefined constant? |
12:47:19 | ftsf | https://rosettacode.org/wiki/Infinity#Nim |
12:47:44 | ftsf | ahh Inf |
12:54:01 | * | yglukhov quit (Remote host closed the connection) |
13:04:11 | * | chemist69 quit (Ping timeout: 252 seconds) |
13:06:13 | zachcarter | dom96: does this make sense? https://gist.github.com/zacharycarter/cad53c22e5d6c9dffb4c651902538f84 |
13:06:31 | * | chemist69 joined #nim |
13:08:12 | BennyElg | How can I get the original error message from throwen exeption |
13:09:03 | dom96 | zachcarter: did you test it? |
13:09:09 | dom96 | zachcarter: because no, it does not :) |
13:09:13 | zachcarter | haha |
13:09:15 | zachcarter | it def crashes |
13:09:27 | zachcarter | I’m bad with async programming |
13:09:30 | dom96 | BennyElg: getCurrentExceptionMsg() or except Exception as err: echo(err.msg) |
13:09:31 | zachcarter | obviously…. |
13:10:10 | dom96 | zachcarter: this isn't particularly easy :) |
13:10:19 | dom96 | It could definitely be made easier (on my TODO) |
13:10:21 | BennyElg | Thanks. |
13:10:37 | zachcarter | :D |
13:14:13 | * | Ven joined #nim |
13:14:28 | * | sz0 quit (Quit: Connection closed for inactivity) |
13:14:37 | * | Ven is now known as Guest63917 |
13:16:04 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:17:38 | * | shashlick quit (Ping timeout: 258 seconds) |
13:18:15 | dom96 | zachcarter: something like this https://gist.github.com/dom96/f00fed7f9a635178d4e7a062c960c171 |
13:18:28 | zachcarter | thank you! |
13:20:42 | * | shashlick joined #nim |
13:24:34 | BennyElg | Ref Object & Object - the different is Ref Object is mutable and Object is Immutable? |
13:25:20 | BennyElg | Ref is pointing to the exact place in memory address and allow modify the value right? |
13:26:31 | * | nhywyll joined #nim |
13:26:53 | euantor | ref is allocated on the heap |
13:26:59 | euantor | object is a struct on the stack |
13:27:18 | euantor | You can modify an object if it's a var rather than a let and is passed to process as `var SomeObj` |
13:30:23 | BennyElg | So in general Object type is allocated at application startup by the runtime therefor cannot be changed? |
13:31:02 | FromGitter | <Varriount> BennyElg: An object *can* be *allocated* on the stack. |
13:31:11 | BennyElg | I see |
13:31:34 | FromGitter | <Varriount> That memory can still be changed. It just can't be referenced via a 'ref' |
13:32:06 | FromGitter | <Varriount> `var` parameters are somewhat like `ref` types, however they have different semantics |
13:32:52 | BennyElg | type |
13:32:52 | BennyElg | Person* = object |
13:32:52 | BennyElg | name: string |
13:32:54 | BennyElg | age: int |
13:33:02 | BennyElg | but if i define the example above |
13:33:02 | * | TheLemonMan joined #nim |
13:33:11 | zachcarter | dom96: I get an error inside jester with the example you shared, I’ve tried everything but I still encounter : https://gist.github.com/zacharycarter/a0b71e7d27289e3b2de00a660d415db3 - no matter what I try |
13:33:59 | BennyElg | and then proc setName(p: Person) = person.name = "x" |
13:34:02 | BennyElg | I'll get an error |
13:34:11 | dom96 | zachcarter: I guess it's because the 'nil' |
13:34:18 | dom96 | Maybe you could just pass newStringTable()? |
13:34:24 | zachcarter | okay sure |
13:34:57 | zachcarter | dom96: that fixed it thank you :D |
13:43:02 | TheLemonMan | Araq, any hint wrt 5740? |
13:43:29 | * | Guest63917 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:43:50 | TheLemonMan | I thought of having a late optimization pass to remove the trivial casts but I guess that's quite intrusive as a patch |
13:46:30 | zachcarter | dom96: couple of things - 1) this works but fails to handle subsequent requests. After the first request in the logs I see DEBUG 200 OK {Content-Length: 5} over and over again |
13:46:50 | zachcarter | 2) I tried opening a socket connection to google on port 80 and it worked :/ |
13:46:54 | zachcarter | at least I think it did |
13:49:04 | dom96 | Looks like there is more work to be done :) |
13:49:11 | zachcarter | well |
13:49:23 | zachcarter | I just found a way to easily disable networking on the docker container |
13:49:41 | zachcarter | so that should fix that problem :) |
13:53:02 | * | DebugDude12 joined #nim |
13:53:28 | zachcarter | now to make it handle multiple requests |
13:53:41 | DebugDude12 | Does nim have some counterpart to C's opaque type? |
13:53:57 | FromGitter | <stisa> zachcarter : wouldn't disabling network stop you from using nimble? Or do your containers share a common ``.nimble`` folder? |
13:54:18 | zachcarter | stisa: this is for the nim playground I’m working on |
13:54:30 | zachcarter | not for frag |
13:54:33 | FromGitter | <Varriount> BennyElg: Nim parameters can't be directly modified. |
13:55:46 | demi- | i thought they could if they were parameterized with `var` |
13:56:18 | FromGitter | <Varriount> demi: Ok, that's the exception. |
13:57:04 | FromGitter | <stisa> zachcarter yes I understand that, just saying that it would limit the playground to the standard library |
13:57:16 | zachcarter | yup! I think that’s what we want |
13:57:32 | zachcarter | but we could do what you’re suggesting |
13:57:40 | zachcarter | and allow them to upload modules somewhere to import |
13:57:42 | demi- | varriount, granted, doing that isn't advisable, because you end up with having to cascade that parameterization through all your code |
13:57:55 | zachcarter | should probably get dom96’s input on this |
13:58:30 | FromGitter | <Varriount> BennyElg: Essentially, you have to allow for the fact that read-only memory *may* by passed into a parameter. |
13:59:36 | FromGitter | <Varriount> Which is why you can modify `ref` and `var` types. In the former case, a reference in static memory will still (probably) point to dynamic memory, and in the latter, 'var' means the memory isn't static. |
14:00:29 | * | zachcarter quit (Quit: zachcarter) |
14:00:49 | FromGitter | <Varriount> BennyElg: Unlike C, Nim does the right thing and passes pointers to parameter data internally. |
14:01:13 | FromGitter | <stisa> zachcarter Yeah, I guess you could also provide a limited selection of pure nim libs that showcase nim feautures |
14:02:57 | dom96 | just standard lib should be fine |
14:03:24 | * | zachcarter joined #nim |
14:04:01 | * | bjz quit (Ping timeout: 260 seconds) |
14:04:06 | BennyElg | Any Nim meetup for english people soon? |
14:04:15 | * | bjz_ joined #nim |
14:04:50 | FromGitter | <stisa> sounds really similar to glot.io then, maybe have a look of how they do it? https://github.com/prasmussen/glot-containers/tree/master/nim/latest |
14:05:15 | DebugDude12 | Is it a good idea to create private types, but public functions that return them? |
14:05:24 | DebugDude12 | this would solve my problem |
14:05:29 | DebugDude12 | and it works |
14:06:32 | FromGitter | <Varriount> DebugDude12: What's your problem? |
14:07:02 | DebugDude12 | DebugDude12: i need a type that can only be created trough the functions i provide |
14:07:57 | FromGitter | <Varriount> DebugDude12: Define "created" - does that include both allocation and initialization, or just one of those? |
14:08:24 | DebugDude12 | only initialisation. I would like to put them on the stack |
14:08:53 | FromGitter | <Varriount> Hm. |
14:10:05 | dom96 | DebugDude12: why do you need that? |
14:10:33 | DebugDude12 | otherwise it would allow the user to create it via Foo(a: 1, b: 2) and pass wrongly initialized stuff to my functions |
14:10:44 | FromGitter | <Varriount> Generally you just provide an initialization procedure. If people don't use it and end up hurt, that's their problem. |
14:11:31 | DebugDude12 | like my own? Or does `object` have some constructor like feature? |
14:11:34 | BennyElg | Can someone check please what is going on with registering the forum community? |
14:11:54 | BennyElg | I registerd By I dont get anything into my email. I tried everything, |
14:12:41 | FromGitter | <Varriount> DebugDude12: You just create a procedure that initializes the memory, and document that it's supposed to be used. |
14:12:51 | BennyElg | I always get the message "Error: You need to confirm your email first." |
14:14:26 | FromGitter | <Varriount> DebugDude12: The convention it to use "new<Type Name>" for reference types, and "init<Type Name>" for object types. |
14:14:30 | zachcarter | is there any way to easily convert a tuple to json? |
14:15:24 | federico3 | http://blog.johnnovak.net/2017/04/22/nim-performance-tuning-for-the-uninitiated/ very interesting (sorry if it's a repost) |
14:17:21 | dom96 | BennyElg: What is your username, I can activate your account |
14:17:23 | * | Kenix joined #nim |
14:17:26 | zachcarter | ah I forgot about marshal |
14:17:36 | BennyElg | Benjaminel |
14:17:59 | dom96 | BennyElg: done |
14:18:00 | * | Kenix left #nim (#nim) |
14:18:04 | BennyElg | Thanks! |
14:19:14 | FromGitter | <Varriount> zachcarter: Careful with marshal, I wouldn't recommend it. |
14:19:22 | zachcarter | yeah |
14:19:25 | FromGitter | <Varriount> zachcarter: dom96 has a macro |
14:19:32 | zachcarter | I was thinking about that |
14:19:40 | zachcarter | I’m not sur ehow to use it though |
14:21:55 | DebugDude12 | Varriount: but initFoo suggests that it takes a reference to already allocated mem. I don't want to alloc at all. Just some kind of factory returning an opaque struct onto the stack. |
14:24:03 | FromGitter | <Varriount> DebugDude12: I (although not everyone) generally create two constructors for a type - one that accepts a `var` type to modify/allocate, and one that doesn't. |
14:25:27 | dom96 | Varriount: why do you do that? |
14:25:41 | dom96 | The convention is to either define a 'initT' or 'newT' depending on if it's a ref or not |
14:26:16 | * | krux02 joined #nim |
14:26:31 | FromGitter | <Varriount> dome96: The convention doesn't state whether those procedures accepts the destination as a 'var' parameter, or simply return |
14:27:40 | FromGitter | <Varriount> Since Nim supports overloading, I prefer both. It allows more optimization opportunities (such as reusing allocated memory) |
14:29:15 | * | EastByte_ joined #nim |
14:29:15 | * | EastByte quit (Read error: Connection reset by peer) |
14:29:37 | * | PMunch quit (Quit: leaving) |
14:33:27 | FromGitter | <Varriount> `proc initFoo(res: var Foo)` and `proc initFoo(): Foo` |
14:34:01 | FromGitter | <Varriount> Of course, the former has to check if the latter is allocated, but for reference types that's a simple if check. |
14:34:15 | FromGitter | <Varriount> *check if the ref is allocated |
14:34:51 | * | BennyElg quit (Remote host closed the connection) |
14:35:16 | * | BennyElg joined #nim |
14:36:00 | * | vlad1777d joined #nim |
14:36:07 | DebugDude12 | one could also overload the type and do stuff like `let a = Foo.init()` |
14:36:45 | DebugDude12 | but i guess i stick with keeping the type itself private and just providing createFoo(), which does what i want |
14:37:12 | dom96 | Please follow the convention as well. Either 'initFoo' or 'newFoo'. |
14:37:53 | DebugDude12 | dom96: does newFoo has to have return a ref or can it also return a plain object? |
14:38:05 | dom96 | it has to return a ref |
14:38:08 | FromGitter | <Varriount> DebugDude12: https://nim-lang.org/docs/apis.html |
14:38:25 | FromGitter | <Varriount> `init` for objects, `new` for refs |
14:38:46 | DebugDude12 | and initFoo() must take a ref? |
14:39:15 | FromGitter | <Varriount> DebugDude12: `init` is for objects |
14:40:00 | DebugDude12 | but whether it is `let a = initFoo()`, or `initFoo(a)` doesn't matter? |
14:40:11 | * | BennyElg quit (Ping timeout: 260 seconds) |
14:44:02 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:47:12 | DebugDude12 | why are nullable references default? O.O |
14:47:55 | zachcarter | dom96: can you please explain how to serialize an object using your macro? |
14:48:31 | zachcarter | sorry I meant deserislize |
14:48:36 | dom96 | https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L56 |
14:48:37 | zachcarter | there’s plenty of serialization examples |
14:48:47 | zachcarter | thanks |
14:48:49 | zachcarter | I’ll read this |
14:49:33 | zachcarter | perfect |
14:54:07 | DebugDude12 | how to call the cleanup routine? destroy, deinit, delete? |
14:56:19 | Tiberium | DebugDude12, for what? |
14:56:46 | Tiberium | if you're not interfacing with C or C++ libraries, in most cases you don't need to call destructors manually |
14:56:49 | Tiberium | nim has GC |
14:56:59 | DebugDude12 | i am interfacing. |
14:57:28 | DebugDude12 | And want to be consistent with the naming conventions. Unlike the SDL2 bindings :P |
15:06:12 | * | libman joined #nim |
15:09:01 | * | vlad1777d quit (Remote host closed the connection) |
15:15:25 | * | DebugDude12 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:15:42 | * | chemist69 quit (Ping timeout: 258 seconds) |
15:18:58 | * | chemist69 joined #nim |
15:23:49 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
15:24:35 | euantor | Thanks for merging that forum PR dom96, hopefully that will reduce the number of failed registrations. Next thing I'm going to work on is session handling |
15:24:59 | dom96 | Yeah... no problem. Sadly it hits a regression |
15:25:00 | euantor | Or not (just seen your most recent comment ;)) |
15:25:49 | dom96 | I was hoping this would be quick. |
15:26:14 | dom96 | Maybe i'll get the time later to grab 0.16.0 and hope it works |
15:27:05 | euantor | Whats the problem? |
15:27:39 | * | nsf joined #nim |
15:27:52 | * | adeohluwa joined #nim |
15:28:32 | dom96 | https://github.com/nim-lang/Nim/issues/5726 |
15:29:18 | euantor | Ah, damn |
15:34:36 | dom96 | This will all be easier with choosenim |
15:35:00 | dom96 | Which I also don't have the time to release right now :) |
15:35:28 | * | Trustable joined #nim |
15:43:10 | zachcarter | hrm |
15:43:28 | zachcarter | I can’t figure out why I have to call my post method twice |
15:43:34 | zachcarter | for the async method to update its results |
15:48:54 | zachcarter | any pointers here dom96? |
15:49:06 | dom96 | show me the code |
15:49:09 | zachcarter | sure one sec |
15:49:28 | zachcarter | https://gist.github.com/zacharycarter/9b93705067c0647f5c910db6206e18eb |
15:50:13 | dom96 | hrm |
15:51:56 | dom96 | so are you saying that when you POST to your route you're not getting a response until the route is POSTed to again? |
15:52:05 | zachcarter | nope |
15:52:17 | zachcarter | I post to it once and then change the parameters and post again and get the same response |
15:52:28 | zachcarter | the when I post a third time I get a different response |
15:53:14 | dom96 | hrm, try adding "resp.client.close()" |
15:53:22 | zachcarter | okay thanks |
15:53:22 | dom96 | after "result = resp.send(Http200, newStringTable(), $ret)" |
15:53:30 | dom96 | and s/result =/await/ |
15:54:16 | zachcarter | gotcha |
16:09:08 | * | kunev quit (Quit: е те!) |
16:11:17 | zachcarter | okay I implemented that and that resulted in a crash after the first response |
16:11:28 | zachcarter | hrm this is tough |
16:14:57 | dom96 | what's the crash? |
16:15:09 | * | kunev joined #nim |
16:15:22 | dom96 | It may be that Jester is being silly. |
16:16:13 | zachcarter | dom96: https://gist.github.com/zacharycarter/dcc922b037ac634a065a3dcfb24d7834 |
16:17:07 | dom96 | need to break out of that while loop? |
16:17:22 | zachcarter | ah maybe |
16:17:36 | dom96 | better yet, move the if statement condition into the while statement's condition |
16:17:58 | zachcarter | okay |
16:19:34 | demi- | dom96: i want to say thank you for building jester, this is so incredibly easy to use and get something minimal off the ground |
16:19:38 | zachcarter | hrm that results in a freeze |
16:19:45 | zachcarter | but the break works |
16:19:53 | dom96 | demi-: thanks for that :) |
16:20:13 | demi- | i just build a local github webhooks demo app using ngrok and i spent more time on the github interface than i spent with jester |
16:20:13 | zachcarter | dom96: woot thank you! I think we got something that works now! |
16:20:25 | zachcarter | going to put this up on digital ocean now |
16:21:04 | dom96 | To be honest I am still amazed by how much it is used. I really wish I had more time to make it better. |
16:21:11 | dom96 | zachcarter: yay |
16:21:38 | dom96 | zachcarter: I'm excited to add a command to NimBot to eval code btw |
16:21:48 | zachcarter | :) |
16:22:13 | dom96 | people can create a lot of things on top of this API :D |
16:23:50 | zachcarter | hopefully people will! |
16:27:33 | zachcarter | ./koch boot -d:release fails on digital ocean with gcc and buildtools essential installed |
16:27:37 | zachcarter | must be missing something else... |
16:27:44 | * | BennyElg joined #nim |
16:28:11 | dom96 | you might need swap |
16:28:17 | zachcarter | thanks I’ll try that |
16:28:53 | demi- | also ensure there aren't incompatibilities between the filesystems due to case sensitivity |
16:29:35 | demi- | if you are doing dev on OS X and deploying to linux that is something else you need to watch out for |
16:29:49 | demi- | since os x is case insensitive by default, but linux is not |
16:30:11 | * | arnetheduck quit (Ping timeout: 260 seconds) |
16:33:07 | zachcarter | adding swap was the key i think |
16:33:17 | zachcarter | thanks dom96 |
16:33:33 | zachcarter | demi-: didn’t think about that but good call I’ll watch for that |
16:33:57 | demi- | it can manifest in some really strange bugs |
16:48:05 | * | Arrrr quit (Ping timeout: 240 seconds) |
17:02:01 | BennyElg | Where can I purchase Nim stickers ? :D |
17:03:38 | federico3 | good question |
17:07:07 | BennyElg | Help: error: Undecleard TainedString |
17:08:56 | dom96 | Nowhere (yet). I need to set up a stickermule store for them. |
17:13:39 | BennyElg | Go go go :d |
17:14:23 | BennyElg | anyway of casting seq[TainedString] to seq[string]? |
17:16:38 | Tiberium | BennyElg, can you provide a failing source code snippet? |
17:17:05 | BennyElg | sec |
17:17:48 | BennyElg | this is the usage nim file |
17:17:49 | BennyElg | https://gist.github.com/Bennyelg/667aa14637bc6c8cba3cbc1bb817a8fa |
17:18:22 | BennyElg | the util https://gist.github.com/Bennyelg/e80f4c06b90547bdd370f9d2a76a8f93 |
17:18:31 | Tiberium | BennyElg, for future reference: you can insert two files into one gist :) |
17:18:43 | BennyElg | oh I didnt knew |
17:19:15 | BennyElg | I tired to change my module to get seq[TainedString] |
17:19:17 | BennyElg | it didnt work |
17:19:48 | dom96 | TaintedString == string |
17:20:04 | dom96 | (unless you compile with --tainmode:on, which I bet you're not doing) |
17:20:09 | dom96 | *--taintmode:on |
17:20:16 | Tiberium | BennyElg, ah |
17:20:21 | Tiberium | commandLineParams is as proc |
17:20:27 | Tiberium | and you're passing it to another proc |
17:20:42 | Tiberium | BennyElg, use commandLineParams() instead of commandLineParams |
17:20:47 | Tiberium | like res = parseArguments(commandLineParams()) |
17:21:23 | BennyElg | oh it fixed the problem lol |
17:21:27 | BennyElg | why it's matter |
17:21:47 | Tiberium | BennyElg, because you can pass proc to another proc |
17:22:02 | BennyElg | Oh, Great, thanks |
17:22:20 | Tiberium | BennyElg, and you don't need to declare "var res" like this |
17:22:42 | Tiberium | BennyElg, you can just "let res = parseArguments commandLineParams()" or "var res = parseArguments commandLineParams()" |
17:23:11 | BennyElg | thanks ! (Im very newbie but I'll learn quick ;]) |
17:26:29 | * | nhywyll quit (Quit: nhywyll) |
17:37:56 | * | rauss joined #nim |
17:38:13 | * | Matthias247 joined #nim |
17:42:17 | * | rokups quit (Quit: Connection closed for inactivity) |
17:45:19 | * | DebugDude joined #nim |
17:45:43 | * | DebugDude is now known as DebugDude12 |
17:45:57 | DebugDude12 | is there something like defer, but for error cases? |
17:46:20 | zachcarter | I’m following this guide here : https://github.com/nim-lang/Nim/wiki/Tutorial:-Creating-a-(micro)-service |
17:46:27 | zachcarter | but I’m getting 502 errors from nginx |
17:46:34 | zachcarter | DebugDude12: you mean like a finally? |
17:48:11 | DebugDude12 | zachcarter: yes, but only in case of errors. |
17:48:35 | zachcarter | not sure |
17:48:42 | DebugDude12 | im opening resources via bindings, and every line after that may throw, so they should be closed properly |
17:48:59 | DebugDude12 | but only on errors, otherwise i want to use/return them |
17:49:25 | DebugDude12 | I don't want end up nesting try/catch/reraise 12 times :S |
17:50:08 | dom96 | zachcarter: try just running the binary manually instead of as a service |
17:50:15 | zachcarter | okay |
17:51:18 | * | TheLemonMan joined #nim |
17:54:11 | DebugDude12 | nim doesn't seem to have deconstructors, which makes me wonder how im supposed to interface with C properly :S |
17:54:28 | DebugDude12 | even modern C++ with RAII and stuff is safer than this |
17:55:23 | TheLemonMan | DebugDude12, https://nim-lang.org/docs/manual.html#type-bound-operations-destructors ? |
17:56:30 | DebugDude12 | TheLemonMan: they are experimental and seem to apply for every object of that type |
17:56:37 | DebugDude12 | Here is what i mean: http://dpaste.com/3S4MG49 |
17:58:58 | * | Jesin joined #nim |
17:59:03 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
17:59:55 | TheLemonMan | hmm, that's what destructors do unless I'm being dense |
18:00:15 | * | Arrrr joined #nim |
18:00:47 | DebugDude12 | can i limit them to the scope of the function? |
18:01:44 | TheLemonMan | oh I see, you probably want a defer then |
18:02:22 | DebugDude12 | TheLemonMan: no i don't, look at the last line of the example i posted |
18:04:54 | TheLemonMan | back to square one then! what's wrong with having a destructor associated with every object of the same type? |
18:05:51 | DebugDude12 | TheLemonMan: i don't want to have all of them managed by the gc, since the resources are on the C side of things. I just need to release them on failure during initalisation |
18:06:29 | DebugDude12 | I think i guess with try/catch+re-raise |
18:07:20 | zachcarter | grr it just crashes on digital ocean with nginx |
18:07:27 | TheLemonMan | how does C++ solve this problem? |
18:07:41 | DebugDude12 | TheLemonMan: look up RAII |
18:07:44 | TheLemonMan | does it run the destructor when you throw? |
18:07:56 | DebugDude12 | yes, it unwinds the stack |
18:10:28 | TheLemonMan | interesting |
18:11:20 | DebugDude12 | they even addded move semantics and option types. But C++ is still too massive and filled with edgecases you must consider, etc. |
18:11:24 | DebugDude12 | which is why im here :P |
18:12:50 | TheLemonMan | you're after something like dlang's scope guard if I understand your problem correctly |
18:12:53 | TheLemonMan | https://dlang.org/spec/statement.html#ScopeGuardStatement |
18:13:27 | DebugDude12 | Yes :D, but don't let me get started on D |
18:14:04 | DebugDude12 | It is easy to implement in Nim. But im baffled nobody stumbled upon this before |
18:14:25 | TheLemonMan | hah, feel free to share your opinions about D |
18:15:54 | DebugDude12 | changes too fast, feels unfinished here and there, @attribute @hell, a GC advertised as feature but avoided like the plague by most people in the forums :P |
18:16:16 | DebugDude12 | "Yeah we have a GC, but don't use it, it sucks" |
18:17:48 | DebugDude12 | i really loved scheme for a time. If it wouldn't be for dynamic typing and its too small communitie(s), each one with his own implementation |
18:18:20 | DebugDude12 | and while typed racket is one of the most beautifull things i have seen so far, its runtime is too heavy |
18:18:33 | TheLemonMan | have you tried CHICKEN scheme? |
18:18:47 | DebugDude12 | yes. Yes i did |
18:19:02 | DebugDude12 | wicked fast, superior C ffi |
18:20:26 | TheLemonMan | I feel you, dynamic typing often bites you in the ass, especially in scheme land |
18:20:53 | DebugDude12 | imo it even limits expressiveness, unless you want to do runtime polymorphy |
18:21:47 | DebugDude12 | the major thing that keeped me hooked was (define-syntax ...) |
18:22:58 | TheLemonMan | that's fine until you have to debug such a macro heh |
18:23:15 | DebugDude12 | oh yea, it looks like vomit |
18:27:44 | * | PMunch joined #nim |
18:47:41 | * | Ven joined #nim |
18:48:04 | * | Ven is now known as Guest13374 |
18:53:17 | DebugDude12 | Wow, an argument in a proc can have more|than|one|type :O |
18:54:04 | Tiberium | yes | it | is | called | generic | proc |
18:54:49 | Tiberium | DebugDude12, also, if you didn't know, inside a generic proc you can use "when compiles(something): do something" |
18:55:00 | Tiberium | like "when compiles(object.len): echo object.len" |
18:56:34 | * | Guest13374 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:56:37 | * | DebugDude12 is gonna rewrite some code |
18:57:38 | Tiberium | but most exciting thing in Nim - macros. I came from Python, and even Nim is statically typed, it's more powerful than Python :D |
18:59:00 | DebugDude12 | languages with macros + proper static typing are very rare |
18:59:57 | FromGitter | <Varriount> zachcarter: Figured out a solution to your sound problem yet? |
19:03:19 | zachcarter | I did post an update in the issue Varriount, however yuriy has yet to respond |
19:05:06 | * | themagician joined #nim |
19:05:14 | zachcarter | I’ve been trying most of the afternoon to get the nim playground deployed on digital ocean and I’ve been failing |
19:05:58 | FromGitter | <Varriount> DebugDude12: zachcarter and I came across someone who believed that C macros were better than Nim macros, mainly because C macros can change language syntax. |
19:06:00 | * | vlad1777d joined #nim |
19:07:11 | FromGitter | <Varriount> We were somewhat flummoxed by that. |
19:07:40 | zachcarter | truth |
19:08:43 | DebugDude12 | i wonder what his opinions on lisps are ... |
19:11:51 | FromGitter | <Varriount> I mean, yeah, you can change the visual syntax using C macros - on the other hand, make mistake with this "new" syntax, and you get cryptic compiler errors. |
19:12:37 | * | adeohluwa joined #nim |
19:14:53 | PMunch | Yeah, I feel Nim has managed to pick a nice middle ground there |
19:20:01 | Tiberium | What is {.noreturn.} pragma? it was needed in the past? |
19:21:31 | TheLemonMan | it has the same meaning it has for C |
19:22:25 | PMunch | "The noreturn pragma is used to mark a proc that never returns." |
19:22:28 | PMunch | From the docs |
19:22:37 | Tiberium | ah, ok |
19:22:57 | PMunch | Hmm, that never returns? |
19:23:13 | * | yglukhov joined #nim |
19:24:22 | TheLemonMan | yep, eg. abort() |
19:24:23 | * | zachcarter quit (Read error: Connection reset by peer) |
19:24:43 | * | zachcarter joined #nim |
19:24:53 | Tiberium | Also maybe I'll make a library like https://github.com/achesak/nim-speech (for google TTS), based on https://github.com/pndurette/gTTS. It'll be multisync (so at least I'll learn how to work with multisync) |
19:25:01 | Tiberium | because this library no longer works |
19:25:08 | PMunch | TheLemonMan, ah right. |
19:25:17 | Tiberium | (because tts-api.com is dead)? |
19:25:42 | TheLemonMan | yay, found the root cause of another bug o/ |
19:25:52 | PMunch | Woo |
19:26:28 | TheLemonMan | the first thing I do when I evaluate a new language is trying to fix some bugs in the compiler |
19:26:42 | Tiberium | wow |
19:27:32 | * | yglukhov quit (Ping timeout: 240 seconds) |
19:37:29 | FromGitter | <Varriount> TheLemonMan: You can actually understand the compiler? |
19:38:18 | TheLemonMan | I do understand the parts I've read heh |
19:38:21 | * | BennyElg quit (Remote host closed the connection) |
19:38:53 | FromGitter | <Varriount> Please dominant any functions you touch, so future explorers don't have to guess as much. |
19:40:10 | * | BennyElg joined #nim |
19:53:06 | FromGitter | <Varriount> *document |
19:59:04 | * | DebugDude12 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:02:11 | * | Tiberium quit (Remote host closed the connection) |
20:03:59 | onionhammer | thought there were about 1 people that understand the nim compiler completely |
20:05:53 | * | chemist69 quit (Ping timeout: 258 seconds) |
20:11:06 | * | chemist69 joined #nim |
20:12:28 | FromGitter | <Kemonozume> Hey hope its the right channel to ask a question about nim |
20:12:56 | FromGitter | <Kemonozume> I'm learning nim at the moment and im stuck with a error message regarding generics |
20:15:11 | FromGitter | <stisa> Hi @Kemonozume ! Which error? |
20:15:15 | FromGitter | <Kemonozume> https://gist.github.com/Kemonozume/ec97368db35661fe777db24c377cba18 , i added the error message in line 13. Not sure why its failing |
20:15:25 | FromGitter | <Kemonozume> since im using the tutorial from the docs as template |
20:15:37 | zachcarter | dom96: so I’ve played around with a lot of stuff with nginx. it runs locally fine on digital ocean but not with nginx |
20:15:41 | zachcarter | runs fine on my machine with nginx |
20:17:38 | FromGitter | <TiberiumPY> Yay I fixed issue with nimble on android ), ⏎ was a one line change |
20:18:02 | FromGitter | <TiberiumPY> in ospaths changed /tmp/ to |
20:18:24 | FromGitter | <TiberiumPY> /data/data/com.termux/files/tmp |
20:18:50 | FromGitter | <TiberiumPY> so native nim compiler on android with just a few hacks |
20:20:37 | FromGitter | <stisa> @Kemonozume I think you need the generic param in TickerFunc too, try `s: Ticker[T]` instead of `s: Ticker` |
20:20:40 | PMunch | TiberiumPY, what? |
20:21:00 | FromGitter | <TiberiumPY> ah, no hacks, pr was merged |
20:21:17 | FromGitter | <TiberiumPY> i'll check on latest devel now |
20:22:19 | FromGitter | <TiberiumPY> PMunch: there's Termux for android - linux like environment (native and no root required) |
20:22:23 | zachcarter | man nginx makes my program crash |
20:22:25 | zachcarter | so strange |
20:22:36 | PMunch | Yeah I know, I have Termux installed |
20:22:49 | PMunch | But I would never have expected the Nim compiler to run on it :P |
20:23:30 | FromGitter | <Kemonozume> @stisa i tried that but it doesn't recognize T since i can't add the generic Identifier infront of the proc. Usually it would be `proc nameT (s: Ticker[T])` but `proc T (s: Ticker[T])` doesn't work either. |
20:24:48 | FromGitter | <TiberiumPY> PMunch: it's still the same ARM |
20:25:14 | PMunch | Well yeah |
20:25:22 | PMunch | But it just feels wrong :P |
20:25:44 | dom96 | zachcarter: what's the error? |
20:26:07 | zachcarter | 502 bad gateway |
20:26:09 | zachcarter | nim crashes with |
20:26:11 | PMunch | Hmm, would be interesting to see if you could build an Android app on Android with it |
20:26:13 | zachcarter | Error: unhandled exception: key not found: 5 |
20:26:14 | zachcarter | respondOnReady's lead up to read of failed Future |
20:26:24 | PMunch | I've written Android apps in Nim before |
20:26:43 | PMunch | Another thing I would like to see is native UI Android apps in Nim |
20:26:57 | zachcarter | https://gist.github.com/zacharycarter/c133a97e0188a5f2cf10aa12a0e82582 |
20:26:59 | zachcarter | is my nginx config |
20:28:15 | FromGitter | <TiberiumPY> PMunch: https://github.com/nim-lang/Nim/pull/5646#issuecomment-290931873 for using nim via termux. so still some hacks are required |
20:28:27 | FromGitter | <TiberiumPY> (But you can clone from devel) |
20:29:01 | TheLemonMan | the compiler looks pretty well documented and well written, everything is just a grep away |
20:30:42 | * | Arrrr quit (Quit: Leaving.) |
20:30:49 | FromGitter | <Varriount> @Kemonozume You need to add a generic parameter to TickerFunc type |
20:31:01 | PMunch | TiberiumPY, cool :) |
20:31:28 | TheLemonMan | the only thing I miss right now is ctags |
20:31:39 | FromGitter | <stisa> @Kemonozume I was thinking more ``TickerFunc*[T] = proc (s: Ticker[T]) : Future[void]`` , but it crashes the compiler for me |
20:32:59 | PMunch | TheLemonMan, nimsuggest? |
20:33:25 | zachcarter | dom96: I think I’m just going to open port 5000 for now |
20:34:13 | dom96 | zachcarter: can you paste the full error? |
20:34:16 | zachcarter | sure |
20:34:40 | zachcarter | https://gist.github.com/zacharycarter/82156f99bd6d4a4740dc9a7b665080fe |
20:34:45 | zachcarter | first request is hitting on port 5000 |
20:34:49 | zachcarter | second is port 80 |
20:35:02 | zachcarter | btw this works on osx with nginx on port 80 |
20:36:14 | zachcarter | 2017/04/23 20:29:41 [error] 15829#15829: *3 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: 162.243.192.65, request: "POST /compile HTTP/1.1" |
20:36:15 | zachcarter | , upstream: "http://127.0.0.1:5000/compile", host: "localhost" |
20:36:17 | zachcarter | are in my nginx logs |
20:37:33 | libman | It's a common inconvenience to switch between the stable and nightly version of nim. Would it be a good idea to formally have a nim binary with a version (and possibly architecture, etc) in the filename and `nim` merely point at the chosen version? |
20:37:38 | * | gokr joined #nim |
20:39:04 | dom96 | zachcarter: weird, try -d:upcoming or whatever the flag for upcoming async is |
20:39:13 | zachcarter | okay |
20:39:24 | demi- | libman: that doesn't sound like a good solution tbh, not long-term |
20:39:42 | libman | Advantages of that would include: (1) nimble could then automatically switch from `nim` at version 0.16.0 to `nim-v0.16.1-blah` if the nimble file requires it. |
20:39:45 | dom96 | zachcarter: what version of Nim are you using? |
20:39:53 | zachcarter | devel |
20:40:01 | dom96 | libman: choosenim will handle this |
20:40:27 | zachcarter | Nim Compiler Version 0.16.1 (2017-04-23) [Linux: amd64] |
20:40:28 | zachcarter | Copyright (c) 2006-2017 by Andreas Rumpf |
20:40:29 | zachcarter | git hash: 34e253bf34b7e407792cebb9be7872c9daf572f6 |
20:40:29 | zachcarter | active boot switches: -d:release |
20:40:30 | demi- | dom96: is that going to be a virtualenv-esque thing for nim? |
20:40:42 | dom96 | demi-: yes, like rustup |
20:40:46 | demi- | nice |
20:40:51 | libman | (2) encouraging people to keep multiple versions would make it easier to submit meaningful bug reports about what version(s) are affected. |
20:42:09 | libman | (3) Once we (or possibly me) does start providing automated nightly builds, installing a new version would be as simple as `curl`ing a file into your $PATH. |
20:42:18 | zachcarter | same result with upcoming define |
20:44:51 | dom96 | I think that the reason this happens is because the socket has already been closed |
20:44:55 | dom96 | and you're closing it again |
20:45:03 | zachcarter | mmmm okay |
20:45:34 | FromGitter | <Kemonozume> @stisa thanks, removing the TickerFunc and just putting the proc inside the Type worked |
20:46:08 | zachcarter | okay yeah if I don’t close the socket it doesn’t crash |
20:46:11 | zachcarter | I just get a 502 error |
20:46:26 | dom96 | as a quick workaround you can just put the 'close' in a try except :) |
20:46:42 | zachcarter | okay |
20:46:47 | zachcarter | I’ll give that a shot |
20:47:55 | zachcarter | well that too prevents the crash but not the 502 |
20:48:08 | zachcarter | so weird this works on osx beind the proxy and everything locally but not on this stupid linux box |
20:49:32 | * | bjz joined #nim |
20:54:17 | dom96 | what's the 502? |
20:54:28 | dom96 | is it the nginx 502 or a jester one? |
20:54:30 | Xe | gateway failure |
20:54:32 | Xe | usually nginx |
20:54:57 | dom96 | or an exception caught by jester |
20:55:19 | demi- | yeah i noticed that when playing with jester earlier, i was getting 502s when not providing a response to a request |
20:55:55 | zachcarter | nginx |
20:55:56 | zachcarter | 502 |
20:57:07 | zachcarter | jester throws an error |
20:57:17 | zachcarter | ERROR: Could not send response |
20:58:24 | zachcarter | but only crashes if i have the close there |
21:01:49 | dom96 | hrm, this raw sending of data must be buggy |
21:01:55 | dom96 | It's definitely less used |
21:02:41 | zachcarter | anything I can do as a work around? |
21:02:46 | dom96 | yeah, I think I have an idea |
21:02:58 | zachcarter | sweet :D |
21:05:18 | dom96 | try something like this instead: https://gist.github.com/dom96/128b2dd8723f0f6b709086fe20611dba |
21:05:25 | zachcarter | on it |
21:05:49 | dom96 | Probably need to write: resp Http200, await ... |
21:05:54 | dom96 | or whatever |
21:06:05 | dom96 | But i'm sure you can figure it out :) |
21:09:19 | zachcarter | :) trying haha |
21:10:23 | zachcarter | should that asyncCheck be a return instead? |
21:10:38 | zachcarter | I think I got it |
21:10:57 | zachcarter | https://gist.github.com/zacharycarter/898f261d544c8aceafa342c5852e7352 |
21:13:41 | zachcarter | checkt it out - curl -X POST \ |
21:13:41 | zachcarter | http://162.243.192.65:80/compile \ |
21:13:42 | zachcarter | -F 'code=echo "Hello Nim!"' |
21:13:51 | zachcarter | sorry |
21:14:02 | zachcarter | curl -X POST http://162.243.192.65:80/compile -F 'code=echo "Hello Nim!"' |
21:14:10 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:17:31 | zachcarter | dto: if you’re around ^ |
21:21:09 | dom96 | zachcarter: cool, it works? |
21:21:12 | zachcarter | yup |
21:21:24 | zachcarter | feel free to hit it |
21:21:49 | dom96 | nice :D |
21:22:08 | zachcarter | thank you for the help! |
21:22:31 | zachcarter | now I can tell my co-worker to f off :P |
21:23:15 | dom96 | no problem, why are you going to tell your co-worker that? |
21:23:29 | zachcarter | oh because he was saying Nim doesn’t have a playground |
21:23:30 | zachcarter | it needs one |
21:23:49 | zachcarter | I’m joking anyway I won’t actually tell them that |
21:24:34 | zachcarter | btw another thing they mentioned, they liked crystals http server example at the top of the page |
21:25:13 | zachcarter | I could try making a front end for this thing with karak :P |
21:25:29 | zachcarter | err karax sorry |
21:27:51 | dom96 | That would be cool |
21:28:05 | dom96 | It would make Araq proud |
21:28:28 | zachcarter | I’m trying to get the examples to compile but I can’t, i’ll have to ping Araq |
21:28:42 | zachcarter | might be my version of nim |
21:29:05 | dom96 | For the frontend I suggest ace editor + semantic UI |
21:29:11 | dom96 | (or spectre css) |
21:29:57 | zachcarter | ooo okay cool I’ll check this out thank you |
21:30:48 | dom96 | hrm, not sure if ace supports Nim though |
21:33:11 | * | PMunch quit (Quit: leaving) |
21:33:15 | zachcarter | okay I got karax working |
21:33:48 | * | Nopply joined #nim |
21:35:44 | zachcarter | going to give spectre a shot |
21:36:31 | * | Nopply quit (Client Quit) |
21:36:56 | * | Nopply joined #nim |
21:42:02 | * | nsf quit (Quit: WeeChat 1.7) |
21:50:43 | * | Trustable quit (Remote host closed the connection) |
21:52:04 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:52:11 | zachcarter | I can’t get karax to work outside of karax :P |
21:56:44 | zachcarter | if you’re around Araq^ |
21:59:36 | * | deech` joined #nim |
22:00:13 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:01:15 | deech` | Hi all, had a quick question about numerical types in Nim. Is there one of "unlimited" size? For instance if I wanted to calculate `factorial(1000000)`. Understandably it will be boxed and inefficient. |
22:04:12 | FromGitter | <stisa> deech` I don't think there's a built-in type for that, but there are probably big ints libraries in nimble |
22:11:54 | * | bjz joined #nim |
22:22:26 | FromGitter | <TiberiumPY> deech: there's bigints library |
22:22:55 | krux02 | I am not sure if there is a type for it, but there is always the option to wrap gmp |
22:25:21 | FromGitter | <TiberiumPY> https://github.com/def-/nim-bigints |
22:27:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:32:08 | FromGitter | <TiberiumPY> But it's |
22:38:31 | * | couven92 quit (Quit: Client Disconnecting) |
22:46:01 | * | krux02 quit (Disconnected by services) |
22:46:01 | * | krux02- joined #nim |
22:46:04 | * | krux02- is now known as krux02 |
22:46:21 | * | krux02_ joined #nim |
22:48:25 | * | gokr quit (Quit: Leaving.) |
23:06:50 | zachcarter | is there any way to execute javascript from nim? |
23:06:56 | zachcarter | what I mean by that is |
23:07:04 | zachcarter | can I write some javascript in a nim file |
23:07:10 | zachcarter | and compile and execute it using nim? |
23:09:03 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
23:17:10 | zachcarter | hrm what I”m really looking for is some kind of domloaded hook |
23:28:45 | zachcarter | figured it out |
23:49:10 | libman | Amazon thinks Nim is a Lisp - https://www.amazon.com/gp/new-releases/books/3981/ :P |
23:49:49 | libman | It also thinks it's OK to bill you $100 for Amazon Prime membership you don't remember ordering, so be careful. |
23:49:59 | libman | (Very common complaint.) |
23:50:05 | * | chemist69 quit (Ping timeout: 240 seconds) |
23:52:59 | * | chemist69 joined #nim |