00:05:37 | dom96 | mahmudov: it will. It supports package names and URLs just like the `install` command |
00:05:48 | dom96 | Yes, names can conflict. |
00:06:19 | dom96 | But Nimble can't help with that |
00:15:33 | arnaud1 | echo accepts a vararg with many values of different types of which all support the `$` proc, how can I do that with my procs? |
00:16:44 | dom96 | Use the varargs[string, `$`] type |
00:17:25 | arnaud1 | Specifically I have a variant object type Item and two procs, one takes Type and returns an Item, and the other takes a Function and also returns an Item, I just need the Item result, I don't care what the original type was |
00:17:44 | arnaud1 | dom96: What does that syntac mean? |
00:17:50 | arnaud1 | *syntax |
00:18:29 | dom96 | Take a variable number of parameters and convert them to a string using the `$` operator |
00:31:17 | * | PMunch quit (Quit: leaving) |
00:42:54 | * | nattefrost quit (Remote host closed the connection) |
00:43:05 | * | def-pri-pub quit (Quit: leaving) |
00:47:02 | * | Nobabs27 joined #nim |
01:10:25 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:11:04 | * | Nobabs27 quit (Quit: Leaving) |
01:23:58 | * | chemist69 joined #nim |
01:28:24 | * | endragor joined #nim |
01:32:27 | * | endragor quit (Ping timeout: 240 seconds) |
01:41:19 | * | arnetheduck joined #nim |
02:54:08 | * | mahsav joined #nim |
03:07:18 | * | dddddd quit (Remote host closed the connection) |
03:26:57 | * | arnetheduck quit (Ping timeout: 248 seconds) |
03:38:36 | * | mahmudov quit (Quit: Leaving) |
03:40:04 | * | mahmudov joined #nim |
04:00:25 | * | xInferno joined #nim |
04:00:30 | * | xInferno left #nim ("WeeChat 1.9") |
04:25:40 | * | pilne quit (Quit: Quitting!) |
04:46:54 | * | vlad1777d joined #nim |
05:02:25 | * | arnaud1 quit (Ping timeout: 248 seconds) |
05:04:37 | * | mahmudov quit (Remote host closed the connection) |
05:32:14 | * | haha_ joined #nim |
05:51:48 | FromGitter | <dandevelop> has anyone here used "nimble develop" ? |
05:57:14 | FromGitter | <adandersen> was Nim in Action recently re-released? On the Manning and Amazon page it shows the book as having an August 2017 release date, wasn't it released back in 2016? |
06:01:52 | FromGitter | <adandersen> It looks like a reprinting |
06:13:53 | FromGitter | <dandevelop> @adandersen it looks like the final version of the book. I bought it a few months ago but I am not sure what the changes are in the final version. Maybe @dom96 can help with this. |
06:15:03 | FromGitter | <adandersen> ah, thanks, i was just curious. I was going to buy it anyway, which I just did. It doesn't mention any updates is why i was wondering, just a has a date change |
06:17:17 | * | haha_ quit (Quit: haha_) |
06:17:47 | * | gmpreussner quit (Ping timeout: 260 seconds) |
06:18:36 | FromGitter | <adandersen> im excited to learn nim better :) |
06:19:44 | FromGitter | <dandevelop> Yep, the book is good and helps with this :) |
06:20:16 | * | yglukhov joined #nim |
06:20:47 | FromGitter | <dandevelop> If anyone is using nimble develop I would really appreciate any input on this: https://github.com/nim-lang/nimble/issues/395 |
06:24:31 | * | yglukhov quit (Ping timeout: 248 seconds) |
06:32:11 | * | ShalokShalom_ joined #nim |
06:35:41 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
06:37:12 | * | ShalokShalom_ is now known as ShalokShalom |
06:50:24 | * | vlad1777d quit (Ping timeout: 240 seconds) |
07:09:56 | * | couven92 joined #nim |
07:26:35 | * | nsf joined #nim |
07:38:38 | * | Yardanico joined #nim |
07:53:35 | * | Yardanico quit (Ping timeout: 248 seconds) |
08:03:21 | * | endragor joined #nim |
08:19:40 | * | Vladar joined #nim |
08:23:02 | * | yglukhov joined #nim |
08:27:43 | * | yglukhov quit (Ping timeout: 248 seconds) |
08:29:01 | * | chemist69 quit (Ping timeout: 246 seconds) |
08:33:20 | * | Yardanico joined #nim |
08:43:37 | * | chemist69 joined #nim |
08:53:53 | * | haha_ joined #nim |
08:58:00 | * | Yardanico quit (Ping timeout: 255 seconds) |
09:00:20 | * | Yardanico joined #nim |
09:05:18 | * | haha_ quit (Quit: haha_) |
09:12:29 | * | haha_ joined #nim |
09:16:34 | * | xet7 joined #nim |
09:17:32 | * | arnetheduck joined #nim |
09:17:59 | couven92 | just out of interest, is there any particular reason why niminst hardcodes --cc:gcc when generating csources? |
09:18:37 | couven92 | Araq? ^ |
09:40:53 | * | Yardanico_ joined #nim |
09:48:48 | * | gmpreussner joined #nim |
09:54:37 | * | Yardanico_ quit (Quit: Leaving) |
09:54:43 | * | Yardanico quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
09:54:59 | * | Yardanico joined #nim |
10:16:00 | * | yglukhov joined #nim |
10:19:33 | * | BitPuffin|osx quit (Remote host closed the connection) |
10:19:51 | * | BitPuffin|osx joined #nim |
10:23:10 | * | yglukhov quit (Remote host closed the connection) |
10:26:50 | Yardanico | I didn't knew that you can do things like while (let newPos = data.parseUntil(token, ',', curPos+1); newPos != 0): do stuff |
10:55:02 | * | nsf quit (Quit: WeeChat 1.9) |
11:04:47 | * | PMunch joined #nim |
11:06:17 | dom96 | adandersen: The printed edition was recently released together with a final ebook. |
11:09:51 | dom96 | couven92: https://github.com/nim-lang/nimble/issues/392#issuecomment-322278024 |
11:10:04 | dom96 | dandevelop: see my answer to your issue :) |
11:13:13 | federico3 | dom96: https://nimble.directory/pkg/jester looks so much better :) |
11:14:27 | dom96 | :D |
11:14:57 | Yardanico | hmm |
11:15:09 | Yardanico | it seems to sometimes make broken links |
11:15:10 | Yardanico | for example |
11:15:15 | Yardanico | on the main page - https://nimble.directory/pkg/serial.nim |
11:15:23 | Yardanico | but valid url is https://nimble.directory/pkg/serial |
11:15:36 | Yardanico | the same - https://nimble.directory/pkg/qex |
11:15:59 | dom96 | There is much work to be done :) |
11:16:14 | dom96 | You also need to badly cache the github trends |
11:16:20 | dom96 | The front page takes far too long to load |
11:16:27 | dom96 | oh and just got a 502 |
11:16:50 | Yardanico | well it looks very good |
11:16:57 | Yardanico | maybe in the future we may have a proper package index? |
11:17:02 | Yardanico | based on this website :) |
11:17:20 | Yardanico | because packages.json will be bigger and bigger |
11:17:31 | dom96 | yep, that's the plan |
11:18:04 | Yardanico | I like this website |
11:19:23 | dom96 | Glad you think it looks good :) |
11:19:39 | dom96 | Wouldn't be possible without federico3's hard work on the backend of course. |
11:22:59 | dom96 | federico3: Shall we create issues on GitHub for the things we find? |
11:30:34 | federico3 | dom96: yup, go ahead. Did you remove the "new packages" list? |
11:31:43 | dom96 | federico3: Yeah, but you just copy and paste what I have for the "most queried" list |
11:31:44 | * | dddddd joined #nim |
11:32:01 | dom96 | federico3: Are you going to be working on this today? |
11:33:33 | federico3 | dom96: yes - ping me to get a lock on any file :) |
11:34:13 | dom96 | federico3: okay, cool. I'll be working on other things today, but let me know when you make progress :D |
11:37:11 | * | arnetheduck quit (Ping timeout: 255 seconds) |
11:42:38 | watzon | What's the site that allows you to search Nimble? |
11:44:29 | * | gangstacat joined #nim |
11:46:51 | Yardanico | watzon, nimble.directory and another website.. forgot it's link, one sec |
11:49:10 | watzon | Yardanico: that works! Thanks :) |
11:54:46 | * | arnetheduck joined #nim |
11:57:00 | * | PMunch quit (Quit: leaving) |
12:05:21 | * | couven92 quit (Ping timeout: 240 seconds) |
12:05:21 | Yardanico | watzon, you can also search on github |
12:05:28 | Yardanico | language:nim your query |
12:13:31 | * | cspar_ joined #nim |
12:15:05 | * | cspar quit (Ping timeout: 240 seconds) |
12:15:33 | Yardanico | watzon, ah! found it! http://nimism.co/ |
12:15:37 | Yardanico | but it's not maintained AFAIK |
12:15:41 | Yardanico | but works |
12:16:03 | watzon | Yeah that's the one that I remember finding before |
12:16:14 | watzon | nimble.directory is definitely better |
12:16:24 | Yardanico | well nimble.directory is more official :) |
12:17:04 | FromGitter | <zacharycarter> I dunno I like nimism's minimal design |
12:17:07 | FromGitter | <zacharycarter> but apparently it doesn't work? |
12:17:39 | Yardanico | it works |
12:17:41 | Yardanico | just start typing |
12:17:52 | Yardanico | for example "pyt" |
12:17:58 | Yardanico | I think it works after 3 letters typed |
12:18:39 | Yardanico | also this search works by tags |
12:20:54 | Yardanico | BTW guys, we have two unofficial async libraries based on libuv |
12:21:25 | Yardanico | https://github.com/zielmicha/reactor.nim and https://github.com/tulayang/nimnode |
12:21:50 | * | RelaxBox joined #nim |
12:34:25 | * | nsf joined #nim |
12:38:33 | Yardanico | wat? https://gist.github.com/zacharycarter/7d000d264ff01461199b43c451b4816f |
12:38:43 | Yardanico | LOL |
12:38:52 | Yardanico | I forgot march :) |
12:38:58 | Yardanico | omgf |
12:41:18 | * | arnaud1 joined #nim |
12:41:25 | * | gokr joined #nim |
12:43:27 | FromGitter | <zacharycarter> ugh I really need to fix the playground so it stops posting gists as me lol |
12:43:33 | FromGitter | <zacharycarter> I think I'll work on that today |
12:51:44 | dom96 | lol, yeah |
13:01:06 | Yardanico | also guys, did you heard of NectarJS? it's a (!) a SAAS compiler ( a CAAS, Compiler As A Service) |
13:01:26 | Yardanico | so you send your code to their server, their compiler compile it to native (from JS), and sends you binay |
13:01:29 | Yardanico | *binary |
13:02:22 | Yardanico | it seems a bit strange anyways |
13:04:34 | Yardanico | https://ksr-ugc.imgix.net/assets/015/514/151/2387a093023507c7de29f534b8dade90_original.gif |
13:04:57 | Yardanico | https://www.kickstarter.com/projects/adrien-thierry/nectarjs-compile-javascript-for-and-from-any-devic they cancelled kickstarter because they want to build a community first |
13:05:16 | Yardanico | but one of this terminal examples shows that nectarjs compiled js code is FASTER than C |
13:06:08 | Yardanico | oh wait, they compile C version with -O7 |
13:06:09 | Yardanico | lol |
13:06:29 | * | couven92 joined #nim |
13:06:55 | federico3 | javascript? meh |
13:07:34 | Yardanico | they have a server-based JS to (any target) compiler |
13:07:44 | Yardanico | any target - I mean windows/linux/wasm/some arduino |
13:08:11 | Yardanico | is there any popular server-based compilers? hmm |
13:13:42 | * | mahmudov joined #nim |
13:30:57 | * | arnaud1 quit (Ping timeout: 240 seconds) |
13:33:45 | * | arnaud1 joined #nim |
13:37:05 | RelaxBox | compiler-as-a-service seems like a pretty awful idea |
13:38:26 | RelaxBox | and I can't imagine how they'd handle non-pure javascript (i.e., ffi) |
13:39:30 | * | handlex joined #nim |
13:42:49 | Yardanico | RelaxBox, they don't handle it |
13:42:57 | Yardanico | they don't support big libraries I think |
13:43:17 | Yardanico | but I don't know |
13:43:21 | Yardanico | also it wouldn't be free |
13:44:00 | * | PMunch joined #nim |
13:50:36 | * | handlex quit (Quit: handlex) |
13:58:50 | * | yglukhov joined #nim |
14:02:32 | RelaxBox | no ffi seems like a dealbreaker for any compiler meant for the backend |
14:02:54 | RelaxBox | e.g. no zmq, lots of compression libraries, ssl |
14:05:29 | FromGitter | <zacharycarter> https://gist.github.com/anonymous/1ec64277b05703723575c5bd60d71e80 |
14:05:30 | FromGitter | <zacharycarter> yay! |
14:05:31 | FromGitter | <zacharycarter> anonymous gists now |
14:06:40 | Yardanico | zacharycarter: with your token? yay! |
14:06:44 | Yardanico | I mean good |
14:06:52 | Yardanico | so no one would exploit your account |
14:06:56 | * | John__ joined #nim |
14:07:29 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
14:08:58 | arnaud1 | Is there a general syntax for generics of types that can be converted to other types with a function like with varargs? |
14:09:33 | arnaud1 | for example, echo uses varargs[string, `$`], and I managed to use varargs[Item, toItem] |
14:09:54 | * | RelaxBox quit (Ping timeout: 240 seconds) |
14:10:11 | arnaud1 | but can I use something like table[string, [string, `$]] ? |
14:10:26 | Yardanico | arnaud1, table doesn't support that |
14:11:34 | FromGitter | <zacharycarter> Yardanico it was using my token before |
14:11:42 | Yardanico | well I know |
14:11:42 | FromGitter | <zacharycarter> now I've created an actual oauth app |
14:11:45 | Yardanico | ah |
14:11:47 | Yardanico | ok then |
14:13:01 | arnaud1 | Yardanico: How can I achieve the same effect with tables? |
14:14:33 | arnaud1 | Maybe i could use generics, but that limits me to use the same type for all elements |
14:16:47 | arnaud1 | and i want to use mixed types, all of which can be converted to a common type |
14:17:20 | Yardanico | I don't know honestly |
14:17:50 | Yardanico | also you can't use mixed types in a table AFAIK, e.g. {"1": 1, "2": "hello|}.toTable() wouldn't work |
14:18:08 | Yardanico | {"1": 1, "2": "hello"}.toTable() |
14:20:23 | arnaud1 | I know i cant use mixed types, I want a table of one single type Item, but I want to accept many entries of different types, and at some point convert all of them with a proc toItem |
14:20:53 | Yardanico | you can create converters, but I doubt this is the best way |
14:21:15 | Yardanico | converters allow to make implicit type conversions |
14:22:23 | * | RelaxBox joined #nim |
14:22:24 | * | John__ quit (Ping timeout: 240 seconds) |
14:27:15 | Yardanico | arnaud1, maybe someone would answer here, but you can also make a post on forum |
14:27:21 | Yardanico | https://forum.nim-lang.org/ |
14:29:52 | dom96 | arnaud1: you might be able to create a converter for this |
14:30:21 | dom96 | https://nim-lang.org/docs/manual.html#converters |
14:30:25 | Yardanico | yeah, a couple of converters |
14:30:58 | * | couven92 quit (Ping timeout: 255 seconds) |
14:32:01 | Yardanico | hmm, maybe no |
14:33:13 | * | gokr quit (Ping timeout: 255 seconds) |
14:42:41 | * | arnaud1 quit (Ping timeout: 248 seconds) |
14:48:58 | * | RelaxBox quit (Ping timeout: 255 seconds) |
14:55:52 | * | PMunch quit (Quit: leaving) |
15:12:36 | federico3 | shouldn't we check if n belongs to L? https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/lists.nim#L262 |
15:18:46 | * | couven92 joined #nim |
15:29:01 | * | arnetheduck quit (Ping timeout: 240 seconds) |
15:40:08 | Gertm | Can I marshal an object to json easily? |
15:40:35 | FromGitter | <zacharycarter> yes |
15:40:50 | FromGitter | <zacharycarter> https://nim-lang.org/docs/json.html |
15:40:56 | Gertm | I'm trying the %* operator, but it's giving me errors. |
15:41:40 | * | gokr joined #nim |
15:42:02 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=8f974d521f7a8e466f8c420eec415373 |
15:46:06 | Gertm | Ok I see what I did wrong, thanks. |
15:46:09 | FromGitter | <zacharycarter> np |
15:47:03 | Yardanico | Gertm, but be aware that marshal can change json to something else in the future |
15:47:13 | Gertm | Good to know! |
15:47:24 | FromGitter | <zacharycarter> erm not the %* macro |
15:47:27 | FromGitter | <zacharycarter> that's from the json module |
15:47:36 | FromGitter | <zacharycarter> if you're using the marshall module that's true |
15:47:47 | FromGitter | <zacharycarter> but if you're not using the marshall module you don't need to worry about that |
15:55:50 | Gertm | https://play.nim-lang.org/?gist=ecb28d40813d56368982a993ad9a8e92 <- this doesn't compile. Am I doing something wrong? Expecting too much? |
15:56:05 | Gertm | (playing with Nim for the first time, getting a feel for the language) |
15:57:24 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=0aabfa2231bef51d8a21aa0125f90729 |
15:57:34 | FromGitter | <zacharycarter> Gertm ^ |
15:57:54 | FromGitter | <zacharycarter> you had the fields mixed up on the MyObj2 creation line |
15:58:19 | Gertm | That'll teach me to name stuff clearly! |
15:58:20 | Gertm | Thanks. |
15:58:31 | FromGitter | <zacharycarter> no problem |
16:12:49 | * | arnaud1 joined #nim |
16:21:03 | * | endragor quit (Remote host closed the connection) |
16:22:40 | * | ludocode quit (Disconnected by services) |
16:22:41 | * | ludocode_ joined #nim |
16:26:11 | * | BitPuffin|osx joined #nim |
16:28:47 | * | yglukhov quit (Remote host closed the connection) |
16:29:49 | * | mahtob joined #nim |
16:30:13 | * | gokr quit (Ping timeout: 255 seconds) |
16:31:44 | * | yglukhov joined #nim |
16:32:01 | * | mahmudov quit (Ping timeout: 246 seconds) |
16:33:51 | * | sz0 joined #nim |
16:34:17 | * | yglukhov quit (Remote host closed the connection) |
16:41:15 | * | yglukhov joined #nim |
16:43:35 | * | arnaud1 quit (Ping timeout: 240 seconds) |
16:45:13 | * | pilne joined #nim |
16:46:32 | * | yglukhov quit (Remote host closed the connection) |
16:58:07 | * | kunev quit (Ping timeout: 248 seconds) |
17:00:26 | * | kunev joined #nim |
17:01:19 | * | yglukhov joined #nim |
17:07:45 | * | Matthias247 joined #nim |
17:09:53 | * | yglukhov quit (Remote host closed the connection) |
17:12:10 | * | endragor joined #nim |
17:22:33 | FromGitter | <zacharycarter> I need to figure out how to read a file w/ webassembly |
17:22:36 | FromGitter | <zacharycarter> I'm thinking sdl? |
17:27:45 | FromGitter | <zacharycarter> Anyone interested in joining a slack related to gamedev, with a channle for nim game dev, please PM me |
17:27:48 | FromGitter | <zacharycarter> channel* |
17:27:54 | * | Trustable joined #nim |
17:29:08 | dom96 | how many users does this Slack have? |
17:30:28 | FromGitter | <zacharycarter> it's pretty new so not that many |
17:30:32 | FromGitter | <zacharycarter> a lot of Common Lispers atm |
17:30:43 | FromGitter | <zacharycarter> but I've been asked to invite Nim users so I'm just putting it out there |
17:37:00 | * | endragor quit (Remote host closed the connection) |
17:41:34 | * | endragor joined #nim |
17:46:18 | * | endragor quit (Ping timeout: 255 seconds) |
17:52:38 | FromGitter | <dandevelop> Hey @dom96 thanks for replying here: https://github.com/nim-lang/nimble/issues/395 |
17:55:48 | * | haha_ quit (Quit: haha_) |
17:57:48 | * | def-pri-pub joined #nim |
17:58:23 | * | Yardanico quit (Remote host closed the connection) |
17:58:26 | * | kafke joined #nim |
17:59:08 | FromGitter | <zacharycarter> bleh can't figure out a good way to read text files with sdl2 / rwops |
18:00:38 | * | bee123 joined #nim |
18:02:08 | * | haha_ joined #nim |
18:03:44 | def-pri-pub | zacharycarter: hiya, I just posted a response regarding throwing errors |
18:04:04 | bee123 | Could anybody help me with this? I am trying to get a ref type from an instance of the base type. Code here: https://pastebin.com/4LG7Qc3b |
18:04:11 | def-pri-pub | I'd also skill the SDL2 rwops and stick to Nim's `system` module for reading a text file. |
18:06:30 | def-pri-pub | skip* (not skill) |
18:07:24 | FromGitter | <zacharycarter> def-pri-pub: cool will take a look, also this rwops is only for webassembly |
18:08:59 | FromGitter | <zacharycarter> bee123: something like |
18:09:07 | FromGitter | <zacharycarter> ```proc box[T](x: T): ref T = ⏎ new(result); result[] = x``` [https://gitter.im/nim-lang/Nim?at=5999d043bc46472974a4096d] |
18:09:09 | FromGitter | <zacharycarter> ? |
18:10:00 | FromGitter | <zacharycarter> def-pri-pub I don't think system module can work for webassembly :/ |
18:10:25 | * | yglukhov joined #nim |
18:11:37 | FromGitter | <zacharycarter> @yglukhov are you currently handling this situation? |
18:11:45 | * | def-pri-pub quit (Ping timeout: 248 seconds) |
18:14:11 | bee123 | zacharycarter: thanks I'll give it a go! |
18:14:29 | FromGitter | <zacharycarter> bee123: np I think that's what you're after |
18:14:46 | FromGitter | <zacharycarter> get a ref object from a normal object |
18:14:54 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:16:43 | ShalokShalom | hi there |
18:16:47 | FromGitter | <zacharycarter> o/ |
18:16:57 | ShalokShalom | it might be usable to add nimqml to this list: https://nim-lang.org/docs/lib.html#wrappers-gui-libraries |
18:17:08 | ShalokShalom | and is somebody here from the core team? |
18:17:39 | ShalokShalom | i want to get, how is nim`s implementation about the different compiler so bond to the core? |
18:18:33 | ShalokShalom | i mean, in Haxe is it compareable easy, to hack an additional language to it |
18:18:40 | ShalokShalom | why is this so hard in Nim? |
18:18:58 | * | def-pri-pub joined #nim |
18:18:58 | * | def-pri-pub quit (Changing host) |
18:18:58 | * | def-pri-pub joined #nim |
18:19:05 | ShalokShalom | Nim use a nice syntax, by the way :D |
18:19:11 | FromGitter | <zacharycarter> I don't really understand your question |
18:19:22 | FromGitter | <zacharycarter> what do you mean by "Hack an additional language to it" |
18:19:26 | FromGitter | <zacharycarter> ? |
18:19:33 | FromGitter | <zacharycarter> I'm not a core team member btw, just a user |
18:19:50 | dom96 | Haxe has been developed as a "compile to any language" language |
18:19:54 | dom96 | so that's probably why |
18:20:11 | dom96 | That's not Nim's aim |
18:20:23 | dom96 | What language do you want to "hack" into Nim? |
18:27:05 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
18:29:27 | * | def-pri-pub joined #nim |
18:29:27 | * | def-pri-pub quit (Changing host) |
18:29:27 | * | def-pri-pub joined #nim |
18:31:21 | * | def-pri-pub quit (Client Quit) |
18:32:36 | FromGitter | <zacharycarter> welp I'm stuck |
18:32:39 | ShalokShalom | dom96: Into the ErlangVM |
18:32:50 | ShalokShalom | So either Erlang itself or Elixir |
18:33:01 | ShalokShalom | or LFE, something like that |
18:34:43 | * | PMunch joined #nim |
18:37:38 | FromGitter | <zacharycarter> nm I'm stupid def-pri-pub: I just can't use os module |
18:53:05 | subsetpark | ha, only nim does someone come into channel and say, 'nim is pretty cool, but why can't i compile it to erlang?' |
18:53:34 | * | bee123 quit (Ping timeout: 260 seconds) |
18:56:23 | ShalokShalom | subsetpark: I am a perfectionist |
18:56:38 | ShalokShalom | And German tutorials are lacking too :D |
18:56:43 | ShalokShalom | ;) |
19:00:20 | FromGitter | <dandevelop> I have a task in a nimble file that builds my executable. Is there any way to run the executable only if the previous exec (the build process) did not fail? |
19:04:02 | * | haha_ quit (Quit: haha_) |
19:04:02 | * | xet7 quit (Ping timeout: 255 seconds) |
19:05:59 | * | yglukhov joined #nim |
19:06:53 | * | haha_ joined #nim |
19:14:50 | * | endragor joined #nim |
19:15:00 | dom96 | dandevelop: apparently not :\ please submit this as an issue on the Nim repo (it's Nim's domain) |
19:15:43 | dom96 | ShalokShalom: What's your motivation for that? What feature does the Erlang VM have that you want? |
19:16:25 | dom96 | dandevelop: hrm, that said, looking at the code: https://github.com/nim-lang/Nim/blob/master/lib/system/nimscript.nim#L202 |
19:16:32 | dom96 | It seems like it throws an exception when the process fails. |
19:16:55 | FromGitter | <dandevelop> Yes, that's also what I noticed. Not sure how to catch that exception though |
19:17:05 | dom96 | For your use case you shouldn't need to |
19:17:15 | dom96 | But you can just as you would in ordinary Nim code |
19:17:17 | dom96 | With a try statement |
19:17:34 | dom96 | Remember: the code in .nimble files is valid Nim code. |
19:17:50 | dom96 | (Except that it cannot access the FFI and is mostly limited to https://nim-lang.org/docs/nimscript.html) |
19:18:53 | * | endragor quit (Ping timeout: 240 seconds) |
19:24:35 | FromGitter | <dandevelop> @dom96 so that means I can not use getCurrentExceptionMsg() in .nimble files, right? |
19:24:59 | dom96 | No, you should be able to. |
19:25:25 | dom96 | You can do: try: ... except foo as Exception: echo foo.msg |
19:25:27 | dom96 | Nowadays btw |
19:27:21 | FromGitter | <dandevelop> Do I need to declare foo somwhere? I tried this: |
19:27:25 | FromGitter | <dandevelop> except foo as Exception: ⏎ ⏎ ```echo("Build failed. Can not run executable" & foo.msg)``` [https://gitter.im/nim-lang/Nim?at=5999e29d76a757f808c6112f] |
19:27:39 | FromGitter | <dandevelop> and I get: |
19:27:40 | FromGitter | <dandevelop> Error: undeclared identifier: 'foo'. |
19:32:24 | * | haha_ quit (Quit: haha_) |
19:33:07 | * | haha_ joined #nim |
19:38:01 | * | yglukhov quit (Remote host closed the connection) |
19:39:43 | dom96 | paste your code |
19:42:42 | FromGitter | <dandevelop> try: ⏎ ⏎ ```echo("Build failed. Can not run executable: " & foo.msg)``` [https://gitter.im/nim-lang/Nim?at=5999e631ee5c9a4c5fdfd32f] |
19:44:28 | FromGitter | <zacharycarter> grr can't get wasm / emscripten to work with sdl2 |
19:50:47 | FromGitter | <zacharycarter> got it working I think |
19:52:44 | * | Vladar quit (Quit: Leaving) |
19:53:34 | * | gokr joined #nim |
19:55:11 | FromGitter | <zacharycarter> browser seems to freeze :/ |
19:57:24 | * | haha_ quit (Quit: haha_) |
20:00:05 | * | xet7 joined #nim |
20:00:11 | dom96 | dandevelop: I assume you're indenting things correctly? |
20:00:35 | FromGitter | <dandevelop> Yep, this is just displayed differently by Gitter |
20:00:59 | dom96 | oh well, I guess nimscript doesn't support this :/ |
20:01:32 | dom96 | use the old fashioned way |
20:02:04 | dom96 | oh wait, try "Exception as foo" |
20:02:04 | ShalokShalom | dom96: concurrency of course |
20:02:09 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
20:02:42 | FromGitter | <dandevelop> @dom96 maybe the syntax should be like this? https://github.com/nim-lang/Nim/blob/c245cfc1fd4143553bcce99669a85f093e4b88a7/tests/js/ttryexceptnewsyntax.nim#L12 |
20:03:02 | FromGitter | <dandevelop> So except Exception as foo: instead of except foo as Exception: |
20:03:59 | dom96 | yes |
20:04:35 | FromGitter | <dandevelop> @dom96 now I get a template/generic instantiation from here ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
20:05:25 | FromGitter | <dandevelop> It seems related to the Exception as foo: part. If I remove that then it doesn't complain |
20:10:11 | FromGitter | <dandevelop> I opened an issue here: https://github.com/nim-lang/Nim/issues/6262 |
20:11:21 | * | arnaud1 joined #nim |
20:11:47 | Jipok[m] | I did a job that turned out to be useless |
20:11:52 | Jipok[m] | https://github.com/Jipok/Nim-SDL2-and-Emscripten |
20:11:57 | Jipok[m] | Do I need to add a post on the forum? |
20:13:17 | FromGitter | <Yardanico> forum/twitter/reddit |
20:13:19 | FromGitter | <Yardanico> would do it :) |
20:14:19 | FromGitter | <Yardanico> Jipok: you also left some russian comments in sdl.nim :) |
20:14:46 | Jipok[m] | ops |
20:15:36 | Jipok[m] | fixed |
20:15:48 | FromGitter | <Yardanico> Jipok: what's the size of files? |
20:16:01 | FromGitter | <Yardanico> because you said in readme that it was too high |
20:16:25 | Jipok[m] | Check the examples |
20:16:55 | Jipok[m] | An average of 3 mb |
20:17:03 | FromGitter | <Yardanico> it's actually very low if you didn't knew :) |
20:18:02 | FromGitter | <zacharycarter> I'm about to start adding a webassembly backend to zengine |
20:18:11 | Jipok[m] | It is not productive. Really there should not be more than 300 kb |
20:18:16 | FromGitter | <Yardanico> wat? |
20:18:19 | FromGitter | <Yardanico> are you sure? |
20:18:20 | FromGitter | <Yardanico> lol |
20:18:27 | FromGitter | <Yardanico> sdl2 libraries + libpng + some other things |
20:18:37 | FromGitter | <Yardanico> check the size of sdl2 dlls on windows |
20:19:08 | Jipok[m] | I'm going to add an example with sdl1. You will see the difference |
20:19:25 | FromGitter | <Yardanico> well SDL1 is older |
20:19:32 | FromGitter | <Yardanico> and that's why it has less size |
20:19:32 | Jipok[m] | but this shouldn't use libpng |
20:19:46 | FromGitter | <Yardanico> it should |
20:20:28 | Jipok[m] | no |
20:20:33 | dom96 | dandevelop: yeah, definitely a bug, thanks for reporting. |
20:20:43 | FromGitter | <Yardanico> Jipok: why not? |
20:20:52 | Jipok[m] | look at sdl1 for emscripten |
20:20:53 | Jipok[m] | https://github.com/kripken/emscripten/blob/1.37.18/src/library_sdl.js |
20:21:25 | FromGitter | <Yardanico> look at sdl image dependencies (for example on arch) - https://www.archlinux.org/packages/extra/i686/sdl_image/ |
20:21:40 | FromGitter | <Yardanico> SDL image depends on libjpeg, libpng, libtiff |
20:21:45 | FromGitter | <Yardanico> also on zlibv |
20:21:46 | FromGitter | <Yardanico> *zlib |
20:22:11 | FromGitter | <Yardanico> ah sorry wrong link |
20:22:11 | FromGitter | <Yardanico> https://www.archlinux.org/packages/extra/i686/sdl2_image/ |
20:22:23 | FromGitter | <Yardanico> Dependencies (6) ⏎ libjpeg (libjpeg-turbo ) ⏎ libpng ⏎ libtiff ⏎ libwebp [https://gitter.im/nim-lang/Nim?at=5999ef7f578b44a046cdf20b] |
20:22:40 | FromGitter | <Yardanico> even SDL2 itself is more than 300kb |
20:22:40 | Jipok[m] | Hey, but browsers already use it all. And through simple js functions one can do all the same. |
20:22:46 | FromGitter | <Yardanico> no |
20:22:53 | FromGitter | <Yardanico> you can't use libpng from the browser |
20:23:13 | FromGitter | <Yardanico> it would be considered as a security vulnerability if you could do it |
20:24:15 | Jipok[m] | But in the end you just need to load the png picture, and you can do it without 3 mb code. |
20:24:43 | FromGitter | <Yardanico> Well code doesn't know if you will load only png pictures |
20:25:12 | FromGitter | <Yardanico> Really, make a SDL2 Windows build with all sdl libraries |
20:25:19 | FromGitter | <Yardanico> And you'll see how much it is |
20:25:44 | FromGitter | <Yardanico> 3mb is almost nothing for a game in the browser nowadays |
20:25:59 | * | Yardanico joined #nim |
20:26:11 | Jipok[m] | ok |
20:26:45 | FromGitter | <Yardanico> Mobile games are even 30-50 mb :) |
20:26:46 | FromGitter | <zacharycarter> this is with sdl2 |
20:26:49 | FromGitter | <zacharycarter> ^ |
20:26:52 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/FUWF/Screen-Shot-2017-08-20-at-4.26.33-PM.png) |
20:27:07 | FromGitter | <zacharycarter> preeety tiny |
20:27:13 | FromGitter | <Yardanico> 600kb? |
20:27:19 | FromGitter | <Yardanico> Nice |
20:27:34 | FromGitter | <Yardanico> Are you porting zengine? |
20:27:40 | FromGitter | <zacharycarter> adding a webassembly backend yeah |
20:27:41 | FromGitter | <zacharycarter> that's the plan |
20:27:49 | FromGitter | <zacharycarter> just at the beginning stages thus far |
20:27:54 | Yardanico | wow, nice |
20:28:22 | Yardanico | it's always good to have a game engine written mostly in Nim :) |
20:29:33 | Jipok[m] | zacharycarter: How much information from my repository can be useful? |
20:29:38 | Jipok[m] | Is it worth adding to the forum? |
20:30:18 | Jipok[m] | I just did not find almost anything on this topic and decided to lay out at least something |
20:31:05 | Yardanico | well it's always good to share projects on the forum |
20:35:05 | FromGitter | <zacharycarter> Jipok[m] - I'm going to run to the store and then I'll have a look |
20:35:25 | FromGitter | <zacharycarter> I wish I had found this 30 mins ago :P but it looks like it'd be worth sharing! I just think that webassembly and straight up emscripten are a bit different |
20:35:36 | FromGitter | <zacharycarter> I think webassembly is a newer binary format that emscripten supports |
20:37:51 | * | Yardanico quit (Ping timeout: 248 seconds) |
20:38:31 | * | yglukhov joined #nim |
20:43:36 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:51:39 | FromGitter | <zacharycarter> Jipok[m]: I imagine you're compiling to asm.js in your examples? |
20:52:47 | * | gangstacat quit (Quit: Leaving) |
20:52:59 | Jipok[m] | yes |
20:53:20 | FromGitter | <zacharycarter> it'd be interesting to see how it compares when compiling to wasm |
20:53:22 | FromGitter | <zacharycarter> in terms of size |
20:53:41 | FromGitter | <zacharycarter> if my naive example is any indication, there could be quite a few gainz |
20:54:42 | Jipok[m] | wasm_ex208_framerate: 2,3 mb |
20:54:55 | Jipok[m] | ex208_framerate: 3,3 mb |
20:55:28 | * | Yardanico joined #nim |
20:56:23 | FromGitter | <zacharycarter> pretty good |
20:56:46 | Jipok[m] | https://github.com/Jipok/Nim-SDL2-and-Emscripten/blob/master/nim.cfg#L3 |
20:57:02 | Jipok[m] | Not just examples. This is the default setting |
20:57:22 | FromGitter | <zacharycarter> gotcha |
20:57:27 | * | mahtob quit (Ping timeout: 240 seconds) |
21:02:21 | * | ofelas quit (Quit: shutdown -h now) |
21:11:39 | * | ShalokShalom quit (Remote host closed the connection) |
21:25:49 | * | nsf quit (Quit: WeeChat 1.9) |
21:33:20 | * | Trustable quit (Remote host closed the connection) |
21:37:54 | * | PMunch quit (Quit: leaving) |
21:50:52 | * | rauss joined #nim |
21:59:29 | * | rauss quit (Quit: WeeChat 1.9) |
21:59:51 | * | rauss joined #nim |
22:08:37 | * | vivus joined #nim |
22:18:46 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:25:37 | * | Yardanico quit (Read error: Connection reset by peer) |
22:34:07 | * | Jesin joined #nim |
22:41:27 | * | yglukhov joined #nim |
22:45:53 | * | yglukhov quit (Ping timeout: 248 seconds) |
22:46:12 | * | mahtob joined #nim |
23:19:16 | * | Jesin quit (Quit: Leaving) |
23:24:57 | * | xaxisx joined #nim |
23:25:26 | * | couven92 quit (Quit: Client Disconnecting) |
23:37:38 | * | jinshil joined #nim |
23:45:04 | * | cspar__ joined #nim |
23:48:15 | * | cspar_ quit (Ping timeout: 248 seconds) |
23:55:44 | FromGitter | <zacharycarter> getting there with wasm |
23:55:48 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/O48j/Screen-Shot-2017-08-20-at-7.55.25-PM.png) |
23:56:02 | FromGitter | <zacharycarter> and gles |