<< 20-08-2016 >>

00:00:07*minus joined #nim
00:00:30*Flox42 quit (Remote host closed the connection)
00:00:31*M-max quit (Read error: Connection reset by peer)
00:00:31*M-Quora quit (Remote host closed the connection)
00:01:08*niv joined #nim
00:04:41*SianaGearz joined #nim
00:04:41*SianaGearz quit (Changing host)
00:04:41*SianaGearz joined #nim
00:04:54*bjz joined #nim
00:06:08*Flox42 joined #nim
00:11:48*gokr joined #nim
00:16:07*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:16:44*yglukhov joined #nim
00:20:55*couven92 joined #nim
00:21:03*yglukhov quit (Ping timeout: 240 seconds)
00:24:02*fredrik92 quit (Ping timeout: 258 seconds)
00:25:03*libman quit (Ping timeout: 265 seconds)
00:35:48*mcc joined #nim
00:39:51*libman joined #nim
00:58:52*gokr quit (Ping timeout: 240 seconds)
01:03:35*gokr joined #nim
01:08:39*elrood quit (Quit: Leaving)
01:14:02*brson quit (Quit: leaving)
01:18:57*couven92 quit (Quit: Shutting down...)
01:25:34*irrequietus quit (Read error: Connection reset by peer)
01:25:53*irrequietus joined #nim
01:31:14*endragor joined #nim
01:33:11*irrequietus quit ()
01:35:42*endragor quit (Ping timeout: 265 seconds)
01:37:55*bjz joined #nim
01:42:09*chemist69 quit (Disconnected by services)
01:42:09*chemist69_ joined #nim
01:46:53*der-landgraf quit (Quit: WeeChat 1.5)
01:47:04*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:48:36*bjz joined #nim
02:05:10*ftsf_ joined #nim
02:07:22mccso i write a function like proc model() = return [1,2,3,4,5,6] ... and it says "no return type declared" is that not something nim can figure out the type of?
02:08:06mcclike, i feel like it does no, because if i give it the "wrong" type it says app.nim(25, 12) Error: type mismatch: got (Array constructor[0..23, float]) but expected 'array[int, float]'
02:11:33ftsf_you need to specify the return type with :
02:11:52ftsf_proc model(): array[6,int] = ...
02:13:33ftsf_maybe it should be able to figure it out itself, but i don't think it can so far
02:14:12*gokr quit (Ping timeout: 250 seconds)
02:14:50*Goba_ joined #nim
02:17:10mccok
02:18:27*hooo quit (Ping timeout: 264 seconds)
02:18:48*yglukhov joined #nim
02:23:28*yglukhov quit (Ping timeout: 265 seconds)
02:25:03libmanCan I read the nim compiler's --out argument from my code at compile time?
02:26:17libmanI want my program to work slightly differently when evoked under different names (which is quite common in Unix, with different names `ln`ed to the same executable).
02:27:00libmangetAppFilename() resolves symlinks, so that approach didn't work.
02:30:39libmanErr, ignore the last line, paramStr(0) works fine.
02:30:44*M-Quora joined #nim
02:30:52*M-max joined #nim
02:34:40ftsf_libman, did you solve your problem?
02:35:25libmanStill curious about the approach of generating different code based on nim compiler's --out: value.
02:36:20ftsf_hmm sounds like you want it to behave the same regardless of the --out but behave differently depending on the filename it's executed by?
02:36:25ftsf_from what you said
02:37:51mccHmm
02:37:55mccBehold, a webgl app written in Nim https://data.runhello.com/j/dry/2/
02:38:23libmanWell, there are two options: *1* different behavior at run-time based on symlink used to execute, which is the no-brainer method I went with, or *2* figure out if/how to access nim compiler's settings at compile time, which I'm still curious about.
02:38:59libmanLike how C has special preprocessor constants like __FILE__ (for the source file, not the output executable, which is what I'm looking for)
02:39:22*beatmox quit (Ping timeout: 244 seconds)
02:40:54*beatmox joined #nim
02:42:51ftsf_libman, what about just using a define and when? i know it's not the output file but should do the trick
02:43:05libmanYup, I just found that a second ago.
02:43:07ftsf_mcc, \o/
02:43:25ftsf_mcc, easy to do?
02:43:27mccftsf_ :D i will probably post something on the nim forum this weekend about how i did it
02:43:45ftsf_i'd be keen to rewrite my webgl app in nim, js is a mess
02:43:56mccftsf_: Uh... well... I spent a month writing the binding script to expose the WebGL API to Nim...
02:44:03ftsf_heh, i see
02:44:05mccftsf_: But once I did that it was pretty easy! ^_^;
02:44:07ftsf_=)
02:44:53ftsf_gonna put the bindings on github/nimble?
02:45:49mccMy goal is to reach a point where I can write a single nim app and compile it to both sdl+opengl and js+webgl
02:46:24ftsf_mcc, sounds nice =)
02:46:28mccftsf_: I'm planning to put the binding script on npm, maybe as soon as this weekend
02:46:33libmanNope, `when defined` is just for booleans...
02:46:49libmanmcc: very cool! :D
02:47:03mccftsf_: if people would actually use it that would be an incentive to do it sooner rather than later :)
02:48:26ftsf_mcc, i'd be keen
02:48:41mccif whatever opengl bindings i write wind up being useful i'll likely put them on nimble
02:49:19mccalthough i don't know if that would mean winding up with a nimble module that requires you to set up a build script which invokes an npm script...
02:49:57mccftsf_: OK, i'll try to remember to ping you when I have something together!
02:50:08ftsf_cheers =)
02:50:18ftsf_what does the npm do?
02:53:06mccftsf_: Here is the source I have so far, but it isn't in a very useful state (the binding script is intertwined with the webgl code) https://bitbucket.org/runhello/nim-webgl-test/src
02:53:27libmanHmm, found compileOption...
02:54:06mccftsf_: The way I created bindings was to generate them from typescript... this used the typescript compiler API, so it is itself written in typescript... so if i wanted to distribute the bindings tool, the most sensible way to do so would be through the npm package manager for javascript
02:55:11*ftsf_ looks up typescript
02:55:52ftsf_ahh nice
02:55:53mcctypescript is very nice actually
02:56:02mccit fixes most of the problems i have with javascript
02:56:32ftsf_yeah, typelessness is hard
02:57:08mcci do not mind typelessness a lot of the time. but javascript is such a sloppy language
02:57:21mcci feel like i need types in js a lot more than i need them in python or lua
02:58:17mcci would actually probably just write my webgl stuff in that
02:58:17mccbut
02:58:21mcclike i said, i want to run on desktop too
02:58:27ftsf_mmm, the bigger the project gets the more you need types
02:58:56mccbut i could imagine a project which is a mix of nim and typescript working really well
03:17:45*User quit (Quit: Leaving)
03:17:54*ftsf_ quit (Ping timeout: 250 seconds)
03:20:58*yglukhov joined #nim
03:25:24*yglukhov quit (Ping timeout: 258 seconds)
03:31:53*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
03:32:56*bjz joined #nim
03:46:29*chemist69_ quit (Ping timeout: 258 seconds)
03:50:52*chemist69 joined #nim
03:52:50libmanI always thought Nim was everything that TypeScript was intended to be and more...
03:53:37libmanDidn't figure out how to access (into a const) compiler --out option (no big deal, just curious).
03:57:56*libman quit (Remote host closed the connection)
05:22:42*ftsf_ joined #nim
05:22:51*yglukhov joined #nim
05:27:42*yglukhov quit (Ping timeout: 265 seconds)
05:51:56*Demon_Fox quit (Ping timeout: 244 seconds)
05:55:17*chemist69 quit (Ping timeout: 258 seconds)
05:57:36*chemist69 joined #nim
05:58:20*GustavoLapasta joined #nim
06:05:38*bjz quit (Ping timeout: 258 seconds)
06:10:47*bjz joined #nim
06:17:39*fastrom joined #nim
06:22:18*xet7 joined #nim
06:44:42*yglukhov joined #nim
06:48:12*Senketsu_ joined #nim
06:49:42*yglukhov quit (Ping timeout: 276 seconds)
06:50:05*asdf__ joined #nim
06:52:07*euantor_ joined #nim
06:53:15*Sergio965_ joined #nim
06:53:53*Flox421 joined #nim
06:54:37*Flox42 quit (*.net *.split)
06:54:37*xet7_ quit (*.net *.split)
06:54:37*euantor quit (*.net *.split)
06:54:38*Senketsu quit (*.net *.split)
06:54:38*Gonzih quit (*.net *.split)
06:54:39*Sergio965 quit (*.net *.split)
06:54:39*reactormonk quit (*.net *.split)
06:54:39*asdf quit (*.net *.split)
06:54:43*euantor_ is now known as euantor
06:56:57*yglukhov joined #nim
07:02:03*yglukhov quit (Ping timeout: 276 seconds)
07:08:33*themagician quit (Ping timeout: 276 seconds)
07:14:09*themagician joined #nim
07:17:08*desophos quit (Read error: Connection reset by peer)
07:22:13*Demon_Fox joined #nim
07:32:08*reactormonk joined #nim
07:32:22*Gonzih joined #nim
07:32:48*yglukhov joined #nim
07:35:23*GustavoLapasta quit (Read error: Connection reset by peer)
07:37:24*mcc quit (Quit: Connection closed for inactivity)
08:11:42*themagician quit (Ping timeout: 258 seconds)
08:16:06*rbergmair joined #nim
08:16:54*themagician joined #nim
08:18:42chemist69mcc: concerning your earlier question of automatic return type detection: there is the `auto` keyword: proc model(): auto = return [1,2,3,4,5,6]
08:23:50*gokr joined #nim
08:31:04*SianaGearz quit (Ping timeout: 244 seconds)
08:31:46*SianaGearz joined #nim
08:31:46*SianaGearz quit (Changing host)
08:31:46*SianaGearz joined #nim
08:38:58*beatmox quit (Ping timeout: 244 seconds)
08:47:30*beatmox joined #nim
09:00:24*xet7 quit (Quit: Leaving)
09:04:51*namnguyen quit (Ping timeout: 250 seconds)
09:16:59*namnguyen joined #nim
09:19:18*kingofoz quit (Ping timeout: 250 seconds)
09:19:33*kingofoz joined #nim
09:23:42*Demon_Fox quit (Quit: Leaving)
09:38:03*Matthias247 joined #nim
09:40:09*xet7b joined #nim
09:43:08*elrood joined #nim
09:58:50dom96Calinou: Go for it. I think you're right, but it might just be a case of replacing the logo in the white background version with this one: https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-crown.png
10:01:38*nsf quit (Quit: WeeChat 1.5)
10:09:45Calinouok :)
10:13:37dom96Also, if you're going to create a new design it would be great if you did the same for the NimForum
10:20:13dom96they don't have to be the same, in fact, it might actually be better if they aren't
10:24:07Calinoudom96: yeah, I started doing a Jekyll prototype (for experimenting with HTML/SCSS)
10:29:07*rbergmair quit (Quit: Leaving.)
10:31:40*asdf__ is now known as asdf
10:40:27*Matthias247 quit (Read error: Connection reset by peer)
10:41:05*Trustable joined #nim
10:50:01*fredrik92 joined #nim
11:06:00*arnetheduck quit (Remote host closed the connection)
11:13:23*Mat4 joined #nim
11:14:36*xet7 joined #nim
11:20:23Mat4hello, can someone please explain to me what 'typelessness' may be and why it is hard to handle ?
11:48:09*arnetheduck joined #nim
11:49:31*stisa joined #nim
11:54:02elroodnot really nim-related, and probably not better than you could explain it to yourself after a bit of googling and common sense. depending on context, most likeyl a language without a type system. think assembly, you never know if data at a memory address is a byte, word, some kind of object, list, etc.
11:54:43elroodyou'll be able to figure out why that's hard to handle on your own, i bet
11:56:50*stisa quit (Ping timeout: 264 seconds)
11:58:14elroodin case that's some kind of homework question you're too lazy to do yourself, shame on you ;)
12:01:00*kunev quit (Ping timeout: 244 seconds)
12:02:22*kunev joined #nim
12:06:34Calinoudom96: here's my first mockup so far (not finished, only top is present): https://lut.im/a19CprN6L9/1wgCDQ00xUhVX5ej.png
12:07:10dom96nice, so you are going for the dark design again :)
12:07:20Calinouwe can have parts of the site as dark, other parts as light
12:07:32Calinoukind of like https://www.gnu.org/software/guix/
12:07:53dom96sure, I love it :D
12:08:45dom96Calinou: Want me to create a new repo in nim-lang/website on github and add you as a contributor?
12:09:09Calinouyou mean, create https://github.com/nim-lang/website ?
12:09:14dom96yeah
12:09:36*stisa joined #nim
12:09:50Calinouright… note that I've barely ever programmed in Nim (I have basic C++ experience, and intermediate Python/PHP knowledge), so to make something based on existing code will require more work
12:10:17dom96no worries, I can help with that.
12:10:26dom96Feel free to commit HTML/CSS/images
12:10:33Calinouyeah, it's a Jekyll site right now
12:10:35dom96or even your full jekyll project
12:10:40Calinouyeah I can upload t hat
12:10:41Calinouthat*
12:10:44dom96we can convert it to the infamous `nimweb` later
12:12:09dom96Calinou: what's your github nick? same as your IRC?
12:12:14Calinouyes
12:12:52*yglukhov quit (Remote host closed the connection)
12:13:54dom96Invited you to join
12:14:57Calinoudom96: ok, should I take take of initial commit?
12:15:16dom96Calinou: sure
12:15:23CalinouI can push the Jekyll prototype to the gh-pages branch, so that people can visit http://nim.github.io/website/ perhaps
12:15:31Calinou(with "noindex, nofollow" in HTML so that robots don't index it)
12:15:41dom96I really like what you wrote in your current design as well.
12:15:45Calinouso that people can get a preview, but it doesn't impact SEO until it's ready
12:15:48dom96Sells the language pretty well :)
12:16:22dom96hrm, I wouldn't do that. Somebody might submit the link to Reddit/HN with "Look at the new Nim website"
12:16:26dom96before it's actually ready
12:16:30Calinouah
12:16:47Calinouok, I'll just push it in a jekyll_prototype folder in master branch
12:16:54CalinouI'll work on it a bit more first
12:16:57dom96sure
12:17:13dom96cloning it shouldn't be too difficult if someone wants a preview
12:20:08*bjz_ joined #nim
12:21:13dom96Calinou: I'm not sure what your plans are but I think it would be cool to have those sorts of guix panels of differing colours, one such panel might include information about our bountysource campaign for example (which I would love to have on the front page, even if it's "below the fold")
12:21:34*bjz quit (Ping timeout: 250 seconds)
12:23:04Calinoudom96: I thought about putting a quick overview of the language below the fold, Bountysource campaign could be mentioned somewhere at the top (need to see how)
12:23:27dom96okay
12:23:27Calinouneed to find a place to put news posts (excerpts) too, ideally they should be visible without scrolling
12:23:33Calinoulike on https://godotengine.org/
12:23:50*nsf joined #nim
12:24:12dom96sounds good.
12:24:37dom96Although the news posts on godot's site are barely above the fold on my MBP :)
12:24:52Calinoualso, what kind of browser support should we target? is IE11+ fine? note that I don't have any IE9 or IE10 machines to test, only IE11 and Edge
12:25:17*dom96 checks analytics
12:25:48CalinouI have no old PCs, thus no IE10 :P
12:27:21dom96According to analytics ~1.5% of our users are on IE, of which 78% are using IE11
12:27:26dom96so IE11+ sounds fine
12:27:51elroodonce you're at it anyways, you could make the site theme user-selectable, so that we don't run into light/dark-controversies
12:28:16Calinouelrood: yeah, like http://urho3d.github.io does
12:28:28Calinouwe can maintain a base stylesheet, plus a dark and light one, created using Sass
12:30:36elroodgreat. personally i'd vote for a non-js reliant site, but it's your choice
12:31:00*HogynCymraeg joined #nim
12:31:14dom96that sounds like a good idea, but it should get a lower priority than the main site.
12:32:20dom96so that we don't end up in a situation where we only have 50% of the website designed in a dark&light theme and no time to do the rest.
12:32:25Calinouelrood: theme chooser requires JavaScript IIRC
12:32:44dom96The site should at least be usable without JS
12:32:50Calinouyeah, that should be possible
12:33:01CalinouI'm using the Pure CSS framework, which is pretty lightweight, and works without any JavaScript or jQuery
12:33:05HogynCymraegHi everyone. I'm learning nim and am trying to figure out the best way to run a webserver in a different process so that it minimally impacts the main process. I will need some kind of IPC mechanism between them. Thoughts?
12:33:14dom96And if you want to be super leet, ensure it works in Lynx/elinks ;)
12:33:48dom96HogynCymraeg: maybe this could help? https://github.com/dom96/nim-jsonrpc
12:35:02HogynCymraegdom96: thanks. I'll check it out now. BTW: Bought NIA last week. Excellent job!
12:35:14dom96HogynCymraeg: Yay, thanks! :)
12:35:30dom96I should really get off IRC and get back to work on it.
12:35:38elroodCalinou, check out link rel="alternate stylesheet" type="text/css" if you like. and have fun designing
12:35:40dom96bbl :)
12:36:16Calinouelrood: thanks :) I'll check that
12:38:26HogynCymraegdom96: the rpc server isn't quite what I'm thinking. I'm basically trying to run a webserver in parallel to an SDL program to inspect it. Using asyncdispatch.poll seems too slow. In node, i'd use child_process and send/on for ipc.
12:40:37euantorCalinou: that design draft looks great, nice work!
12:40:45Calinouthanks :D
12:43:38Calinoudom96: also, how can we integrate Sass (SCSS) into a Nim website? do we call a task runner like Gulp separately?
12:44:32euantorI think that's the best way, yeah.
12:51:19*xet7 quit (Quit: Leaving)
12:51:52*xet7 joined #nim
12:54:20*brechtm joined #nim
12:57:10cheatfateHogynCymraeg, and what is slow in asyncdispatch.poll() ?
12:57:23*Mat4 quit (Quit: Leaving.)
12:59:11*brechtm quit (Remote host closed the connection)
13:02:25HogynCymraegcheatfate: turns out the default 500ms parameter ;-) Tried with a low value and it's much faster
13:02:56cheatfateHogynCymraeg, if you got 500ms then you doing something wrong...
13:03:41HogynCymraegI thought that was the default value for poll?
13:04:05cheatfateHogynCymraeg, yep, but if you fall into 500ms timeouts then your approach is looks wrong
13:04:34HogynCymraeghmmm interesting.
13:05:11cheatfateHogynCymraeg, how you transfer your data between processes?
13:05:15cheatfatewhat mechanism you are using?
13:05:30HogynCymraegI had an infinite loop with a poll and incrementing a variable. That variable went up very slowly. Set poll to a low timeout value and it went really fast
13:05:54HogynCymraegIn this code, it's all in main process. I was enquiring how best to move it out of main
13:06:34cheatfateHogynCymraeg, if you decrease timeout you will get more CPU extensive loop... and this is not the way you are looking for
13:07:42cheatfatetry to use pipes/unix sockets/sockets/files to transfer data
13:07:46cheatfateit will be faster
13:08:25HogynCymraegok thanks :-)
13:08:50Calinouhttps://lut.im/SP57HSNX06/dd3Z4uUrj8idhUaG.png - some progress
13:09:04Calinounot entirely sure on how to present news
13:09:14Calinou(I should copy-paste existing news so that it feels "more" real for testing, I know)
13:10:23stisaHogynCymr: maybe you could use osproc http://nim-lang.org/docs/osproc.html ?
13:11:06*SianaGearz quit (Ping timeout: 244 seconds)
13:11:16cheatfateCalinou, nice, i like it
13:12:32*mcc joined #nim
13:12:44HogynCymraegstisa: Cool. That looks close to what I want. How do you send messages between procs with that?
13:13:20*yglukhov joined #nim
13:13:46HogynCymraegstisa: ah, looks like stdin/stdout streaming. Cool
13:14:31stisaHaven't used it, but I guess inputStream can use write procs from http://nim-lang.org/docs/streams.html , and you can check for pending data with hasData
13:16:33*kingofoz quit (Read error: Connection reset by peer)
13:17:38*yglukhov quit (Ping timeout: 250 seconds)
13:18:12*kingofoz joined #nim
13:19:09*SianaGearz joined #nim
13:21:22*HogynCymraeg quit (Ping timeout: 250 seconds)
13:22:24*Goba_ left #nim ("Leaving")
13:26:43mccIs there some way for a nim function or a function signature to take "something iterable"?
13:26:57mccFor example, a function that could take either an array[5, int] or a seq[int]?
13:27:09euantoropenarray[int]
13:27:21mccCool
13:27:36euantorhttp://nim-lang.org/docs/manual.html#types-open-arrays
13:31:59chemist69mcc: concerning your earlier question of automatic return type detection: there is the `auto` keyword: `proc model(): auto = return [1,2,3,4,5,6]`
13:32:17mccoh, i see
13:38:07dom96Calinou: Starting to look quite similar to https://haskell-lang.org/
13:38:21dom96not that that's a bad thing
13:39:33*xet7b quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
13:46:49*HogynCymraeg joined #nim
13:46:49*HogynCymraeg quit (Client Quit)
13:59:47*GustavoLapasta joined #nim
14:12:21*bjz joined #nim
14:13:37*bjz_ quit (Ping timeout: 244 seconds)
14:18:52mccDoes Nim have anything like Java "interfaces"? Or some sort of structural type that corresponds to "any type that supports these operations"?
14:22:46mccI'm trying to write FFI declarations and at some point I need to write an {.importc.} class that takes as one argument, for example, "any type that has the method index()".
14:23:27dom96look up concepts
14:23:43mccthanks
14:24:03*rbergmair joined #nim
14:25:52Araqhey, I'm back
14:25:55Araqwhat did I miss?
14:26:26dom96Araq: Calinou is working on a redesign: https://lut.im/SP57HSNX06/dd3Z4uUrj8idhUaG.png
14:26:42*yglukhov joined #nim
14:29:33Araqyummy, I like it
14:30:14ftsf\o/
14:30:50mccSo when I look at a generated .js file from Nim , I notice it declares Int8Array and a bunch of stuff even if the Nim file is empty... does Nim ever use Int8Array etc internally?
14:31:14Araqmcc: yes the codegen sometimes emits it
14:31:16mccBecause I am now writing WebGL with Nim, and I had to go to a bunch of awkward effort to create Int8Arrays, Float32Arrays etc
14:31:24Araqask yglukhov about the details
14:31:29*chemist69 quit (Ping timeout: 260 seconds)
14:32:15mccAraq: OK. is there a way to force it to be emitted? Like, if I would like to have something that is typed as an openArray[float] but is being codegened as a Float32Array.
14:32:31mccSo that I could just pass this stuff around instead of using base Nim types and then converting them to TypedArrays
14:32:31mccOK
14:33:01dom96mcc: don't think so
14:33:28*chemist69 joined #nim
14:35:06mccOn a related note, when I generate js from nim, the code seems to be dominated by functions like rawwritestacktrace() and something that looks like stashing and clearing stack information at the start and end of each function, like : e_13410 = {m_type: NTI3440, parent: null, name: null, message: null, trace: null
14:35:20mccWhat is that for? Is that just to recapture Nim's exception semantics.../
14:38:04Araqit's just debugging convenience.
14:38:07Araqor used to be.
14:38:21AraqNim produced its own stack traces that map to Nim source code.
14:39:01Araqthat stuff predates source maps and source maps are kind of hard to retrofit into the code generator
14:39:09Araqit's all gone with -d:release
14:39:18Araqor stackTrace:off
14:40:16mccok cool
14:46:50yglukhovmcc: typed arrays are emitted for nim's arrays.
14:47:28mccOh! Interesting. Just fixed sized arrays, or also openArrays and seqs?
14:47:32yglukhove.g. var myVertexData: array[120, GLfloat]
14:47:48yglukhovonly fixed size for now.
14:47:51*Mat4 joined #nim
14:50:31mccyglukhov: So like I said, I've been trying to write WebGL in Nim-- I made this last night: https://data.runhello.com/j/dry/2/ I'm doing this in a slightly odd way, I didn't find the WebGL stuff in the DOM module so I made a script that generates nim bindings from TypeScript and I'm basically writing against the typings in the Nim standard library
14:50:43mcci'm sorry i mean the TypeScript standard library
14:51:18mccAre there existing projects that do WebGL with Nim, am I reinventing any wheels?
14:53:58*Mat4 left #nim (#nim)
14:54:48stisaWell I have one, but it's really rough: https://github.com/stisa/webgl
14:56:09yglukhovmcc, you might want to have a look at nimx and rod.
14:56:09mccstisa: neat :O i *think* the script generated bindings can do everything that can... except the matrix stuff. hm.
14:56:35yglukhovhttps://github.com/yglukhov/nimx, https://github.com/yglukhov/rod
14:57:08stisamcc: btw I ported over your example to see if it would work, hope you don't mind: http://stisa.space/webgl/ex3.html
14:57:30Araqlet a and b be positive integers such that a*b+1 divides a² + b²
14:57:55mccstisa: heh, cool
14:57:56Araqshow that (a² + b²) / (a*b + 1) is the square of an integer.
14:58:37mccnimx is the gui framework, right? i guess it had to solve this problem internally?
14:59:47mccHere's a question... is it possible to create a Nim fixed-length array of not-known-at-compile-time size? like the equivalent of char *x = new char[someVariable]. seq is different because that's an actual dynamically growable array
15:03:46Araqno, you have to use 'seq' for that.
15:04:03Araqwhich is a single indirection just like your new char example is, so nothing to worry about.
15:12:21mccSure... so what I'm thinking about is, I'm imagining writing a patch to nim where openArray *also* uses TypedArray/ArrayBuffer when generating for javascript. Like yglukhov described happens for array[20, float].
15:12:47mccHowever, that doesn't really work openArray also encompasses seq, and a seq cannot be represented as a TypedArray because js typed arrays are of fixed size and seq is growable.
15:16:48*Ven joined #nim
15:20:23yglukhovmcc: openArray is not a type. you can't "instanciate" it. and openarray is perfectly compatible with js typed arrays as it is now. instead we could extend typed array usage to seqs.
15:24:07mccyglukhov: OK... how would you represent a seq as a js typed array? Since js typed arrays are fixed size and seq has add(). Sorry, I'm only just recently learning about WebGL :) I'm trying to figure out if you could implement something using DataViews.
15:40:49yglukhovmcc: dunno. maybe seq should have a typed array+capacity and realloc+copy typed array when len reaches capacity. basically just like seq behave in c.
15:42:10mccyeah, that would work well. you'd have to figure out some way to create an object that correctly reports its .length property however when you pass it in to a pure js function. But maybe DataView gives you that.
15:47:14*xet7 quit (Quit: Leaving)
15:51:11cheatfateAraq, welcome back :)
15:53:54*errerr joined #nim
15:54:04Araqthanks. any troll attacks that I missed? :P
15:55:43*xet7 joined #nim
15:56:37*xet7 quit (Remote host closed the connection)
15:57:41*errerr left #nim (#nim)
15:58:02elroodoccasionally trying to keep us entertained, never with much lasting effect though
15:58:05elroodwelcome back
16:00:50*minus left #nim ("WeeChat 1.5")
16:01:53Araq"Closure iterators are not supported by js backend." yglukhov: that's your favourite issue now isn't it?
16:03:36yglukhovAraq: wow, you let me choose the next fixed issue? ;)
16:04:20yglukhovAraq: no, thats not my favourite.
16:09:37mccaraq: by the way, i was meaning to ask-- what does $ in an importc do? as described in https://github.com/nim-lang/Nim/issues/4579 it seems to have SOME special behavior
16:16:51*Salewski joined #nim
16:19:20SalewskiAraq, I have just copied my IRC remarks from 12-AUG about nimsuggest problems with system.nim module to nimsuggest issue tracker.
16:20:28SalewskiMy GTK editor supports nimsuggest very good now, but the system.nim bug is a restriction. Do you have an idea, may it be very hard to fix?
16:22:08SalewskiI have looked for about two hours on the nimsuggest code, but have no idea.
16:23:37SalewskiThere are some more, less serious errors in nimsuggest, but I think reporting or fixing them makes no sense as long as the system modules bug persists.
16:26:16*nsf quit (Quit: WeeChat 1.5)
16:32:12*Vladar joined #nim
16:33:35*Matthias247 joined #nim
16:33:52AraqSalewski: what does nimsuggest report when you use --debug?
16:34:03Araqand no, I don't think it's hard :-)
16:34:53Araqmcc: proc foo() {.importc: "prefix_$1".} produces "prefix_foo"
16:35:11Araqso that you can importc within a .push environment
16:35:20Araqpretty obvious, isn't it?
16:35:22SalewskiAraq, for the reported issues at issue tracker I have used --debug option.
16:35:38Araqsorry I'm not there yet
16:35:50Araqstill 50 emails to read, I'm sure it's there somewhere
16:36:27*kulelu88 joined #nim
16:36:59SalewskiWhen it it not to hard, it may be a good idea if you inspect the reported issues. Because that is a serious restriction for all nimsuggest users.
16:38:55mccaraq: ok, i see. does $2, for example, do something?
16:39:02mccis that a param maybe?
16:39:18Araqno, it crashes the compiler
16:39:32Araqor rather produces an unhelpful error message
16:40:15mccaraq: ok thanks
16:40:45Araqnote that .codegenDecl uses it differently
16:41:57SalewskiBye...
16:42:00*Salewski left #nim (#nim)
16:50:26*stisa quit (Quit: quitting...)
16:52:34*fredrik92 quit (Ping timeout: 250 seconds)
16:56:59*GustavoLapasta quit (Quit: Leaving)
16:58:52*Sentreen quit (Ping timeout: 240 seconds)
17:08:46*Trustable quit (Quit: Leaving)
17:12:40*Sentreen joined #nim
17:14:26*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:24:38*chemist69 quit (Ping timeout: 250 seconds)
17:26:08Calinouok, here's how it looks so far: https://lut.im/8ono9e3LjW/EPEaml4Cbaclsasg.png - and scrolling down: https://lut.im/zKkVeBDopE/e9VyyEpYTfyR2sy1.png
17:26:17Calinouthere is a dedicated news archive page too: https://lut.im/qgu7Z07TxN/QuIzU6S15qtyplh8.png
17:26:36Calinoufooter is not finished, should probably have some more content, or social media icons, or something like that
17:29:53dom96nice
17:29:56dom96I love it
17:30:07*nairobi joined #nim
17:30:16Calinoudom96: I can commit the prototype to the repository, doing some cleanup before :)
17:30:36dom96Maybe a "See more..." link under "Documentation" and "Community" in the footer leading to a dedicated page for both?
17:31:16Calinoumakes sense
17:31:18dom96Calinou: feel free to commit even unfinished things
17:31:26dom96It's nice to see a history of how it developed :)
17:31:45Calinouyeah, I should do that… sadly I don't have the habit of using Git locally :P
17:32:49dom96Cool. So judging by the archive page, the main content will always be shown on a white background, right?
17:36:42dom96Some more ideas: Should we have a "Learn More" button beside the Download and Documentation buttons leading to a more in-depth look at Nim's features?
17:36:55dom96or should we extend the front page to include more information about Nim?
17:37:17elroodeasily accessible links to at least the repo, wiki and available libraries / nimble packages would be nice
17:38:34*fredrik92 joined #nim
17:38:38*fredrik92 quit (Read error: Connection reset by peer)
17:39:17dom96yeah, but I'm not sure where they could go
17:40:22dom96we need to think carefully about what pages should be linked in the nav bar.
17:40:27dom96and what those pages should contain
17:42:26*chemist69 joined #nim
17:42:29*nairobi quit (Remote host closed the connection)
17:42:33dom96Calinou: Have you tested what your design looks like on mobile yet?
17:42:49Calinousure, I make regular tests using Chromium's responsive mode
17:43:01CalinouI have a real smartphone too, I'll make sure to test it a bit on it too
17:43:11dom96awesome
17:43:17elroodthe ones mentioned could preferrably be positioned as prominently as possible, especially the wiki, imho. maybe add a general resources and about link, and you can place pretty much everything else below
17:43:59elroodthe front page itself could be kept fairly simple. in its current form it's quite overburdened with nim's feature list
17:46:25elroodCalinou, firefox's developer tools come with a very useful preview for different screen sizes. chrome most likely has something equivalent
17:48:48Calinouyes, that's what I use
17:49:04elroodas long as you make sure navigation works equally well on touch- and point-and-click-oriented devices, you should be fine
17:49:06CalinouChromium (and Chrome) have very extensive DevTools, sometimes even overkill (you can listen and replay for transitions!)
17:50:45*nairobi joined #nim
17:53:54Calinouheh, the site's news pages are quite friendly to Firefox's reader mode
17:54:47dom96Good :)
17:55:33dom96Sooo, anybody got experience analysing surveys?
17:55:42*dom96 is about to start looking at our Nim community survey
17:55:52dom96790 responses :D
17:57:09euantorYou going to make some nice graphs and stuff @dom96?
17:57:25dom96yep
17:57:38euantorWell, I don't envy the task ;)
17:59:03Calinoudom96: https://github.com/nim-lang/website - committed
17:59:50dom96Calinou: brilliant, thanks.
18:01:37dom96euantor: yeah... just downloaded the huge CSV file :\
18:02:02*nairobi quit (Ping timeout: 258 seconds)
18:02:51*nairobi joined #nim
18:03:47dom96Haven't used Excel this extensively since high school.
18:07:04*Sergio965_ quit (Max SendQ exceeded)
18:07:20*Sergio965 joined #nim
18:08:14euantorI'd need to first install Excel
18:08:20euantorOr dig out the work laptop
18:08:42euantorHow big is the file with that many answers?
18:08:46Calinouheh, here we're taught Excel at uni, I got 20/20 as grade :P
18:08:51Calinouin 1st semester
18:08:57euantorSeems like a pretty good turnout
18:09:01euantorOh, weird
18:09:04*Sergio965 quit (Max SendQ exceeded)
18:09:06dom96Looks like Google's Spreadsheets are doing a better job
18:09:11euantorWe never did anything like that at Uni
18:09:17*Sergio965 joined #nim
18:09:27euantorYou were just expected to know how to use things like Excel and Word
18:09:35euantorAnd if you didn't, then tough
18:09:38dom96Calinou: interesting, if you don't mind me asking, what Uni do you attend?
18:10:04CalinouI'm French, I attend "Métiers du Multimédia et de l'Internet" (= "Jobs of multimedia and the Internet", if I translate) at Troyes
18:10:21Calinouwe do web development, web design, graphics (Photoshop/Illusator), video editing
18:10:23Calinoua lot of things :)
18:12:11euantorCool. I always find it interesting how these things differ between countries
18:12:23euantorThey're all similar, but there are always little differences
18:12:37Calinoufor example we don't do system programming, only PHP/JavaScript
18:13:24euantorOur first year was dedicated to Java and Common Lisp, systems design and networking
18:13:48Calinouwe do some networking too, really easy though… I typically get 17/20 or 18/20 grades :)
18:14:03CalinouI tend to be more interested in system programming than other students here
18:16:05euantorA lot of the other students on my course hadn't done any programming before University, so the first 3 months were the very basics
18:16:23euantorIntroducing Java, what variables, functions, classes etc. are
18:16:32Calinouour PHP/JS teaching is pretty basic too, in 2nd semester we were taught about jQuery, but they don't really teach us how to write it, more how to read it…
18:16:43Calinouand what we had to do for evaluation in 2nd semester of PHP was: Fibonacci sequence
18:16:50Calinou(it was part of it)
18:17:07euantorIf that was the whole evaluation, that's a very easy pass :P
18:17:19Calinouthere were a few other things too, still easy
18:17:55*stisa joined #nim
18:18:27Calinouour 2nd semester networking class is about setting up an Apache web server
18:18:31Calinousudo apt-get install apache2, done! :P
18:18:55euantorSome versions of Ubuntu Server have it pre-installed, so that's even easier!
18:19:30CalinouI'm possibly the only guy at my uni using Linux most of the time :P
18:19:42Calinousome use macOS, but usually don't know the command line, the vast majority just uses Windows
18:19:51euantorThere were about 4 of us using it when I was at Uni
18:20:02euantorMost just using Ubuntu, but I usually run Fedora
18:20:23CalinouI'm on Antergos which is an Arch Linux derivative, basically it's already setup, and you can choose your desktop environment at installation
18:20:33CalinouArch is nice (recent packages) but I like saving an hour or two of setup
18:21:13CalinouFedora is pretty cool too, though it has some issues with font rendering out of the box (due to patents)
18:21:44*desophos joined #nim
18:22:20euantorYeah, so long as it can render a monospace font, I'm usually fine
18:22:31euantorI use a Mac now as I was gifted one
18:22:48Calinouheh, I know someone at my uni who *won* a 15" MBP
18:22:50Calinouso lucky
18:22:52euantorI can still get done most of what I need to
18:23:01euantorThat's pretty lucky
18:23:13Calinouhere a 15" MBP starts at €2,249…
18:23:13euantorAnyway, I'm off to eat some dinner
18:23:21euantorYeah, it's not that bad here
18:23:24Calinoumy next laptop will probably be a ThinkPad/Dell XPS or something like that (I don't play games on it anyway)
18:23:38euantorMine is a top of the line 15", was just under £2000
18:23:39Calinousomething with decent battery life is a must in 2016
18:23:50euantorMy work laptop is a ThinkPad. It's excellen
18:23:54euantor*excellent
18:24:07euantorIt's got two batteries, one which is built in and the other can be replaced
18:24:18Calinouyeah, I saw a few ThinkPads which had that, pretty handy
18:24:25Calinouapparently one of them could achieve like, 11 hours of battery life in basic use
18:24:25euantorMeaning I can remove the main battery without it turning off and replace it with a pre-charged one
18:24:37Calinougoing to eat dinner too, bye :p
18:24:38euantorIt lasts about 12 hours on one battery for me
18:24:53euantorSo long as I don't have the brightness on full and I'm not doing anything too strenuous
18:25:18Calinoumaybe I'll wait for Kaby Lake CPUs, they should bring quite better performance according to recent leaks :P
18:25:30Calinouneed more budget anyway first
18:25:34*nairobi quit (Remote host closed the connection)
18:25:43*nsf joined #nim
18:26:40*Matthias247 quit (Read error: Connection reset by peer)
18:29:14*nairobi joined #nim
18:29:50*nairobi quit (Remote host closed the connection)
18:30:15*nairobi joined #nim
18:30:36*Mat4 joined #nim
18:34:57Mat4Araq: Ping
18:35:10*arnetheduck quit (Ping timeout: 252 seconds)
18:35:15AraqMat4: pong
18:36:11Mat4good afternoon, I'm able to start working on these Rim project again
18:36:49*xet7 joined #nim
18:37:07*yglukhov quit (Remote host closed the connection)
18:37:49Mat4and want to ask about a recent syntax notation (BNF or something similar would be nice for example)
18:38:52Araqthe manual uses a notation similar to BNF
18:39:09Araqit's documented and the grammar is available
18:42:12Mat4I'm sorry, the documentation seem to have changed and I'm lost at current
18:43:49Mat4ok, the notation is given for each chapter
18:44:18Araqhttp://nim-lang.org/docs/manual.html#lexical-analysis
18:45:00Araqhttp://nim-lang.org/docs/manual.html#syntax-grammar
18:45:05Mat4thNKA
18:45:09Mat4thanks
18:47:11Araqthough it's way easier to use Nim's existing parser and call it a day :-)
18:48:04*yglukhov joined #nim
18:56:11*libman joined #nim
18:59:02Mat4will future Nim versions support the 'do' notation ?
19:00:44libmanOh god, is Nim turning into Haskell now?
19:01:38stisaMat4: Do you mean this http://nim-lang.org/docs/manual.html#procedures-do-notation ?
19:01:45Mat4yes
19:21:12*elrood quit (Ping timeout: 244 seconds)
19:23:52AraqMat4: the do notation is here to stay
19:24:40Mat4that is good
19:32:21Mat4ciao
19:32:24*Mat4 left #nim (#nim)
19:36:50libmanAraq: can a program get a compile-time const of the --out argument passed to the Nim compiler?
19:37:17*irrequietus joined #nim
19:37:19Araqhmm I don't think so. why would that be useful?
19:38:07libmanFor The Greater Glory Of Nim! :D
19:41:18libmanIt is common in the Unix world to have symlinks of a single executable, which behaves differently depending on paramStr(0).
19:42:38mcclibman: the --out argument couldn't get you that, though, could it?
19:42:41libmanAnd of course you can just have multiple different programs. But I was just curious if I can have a program compile differently depending on the target executable name.
19:43:34mcclibman: could you set your build script to also pass in the --out as a --define option?
19:47:25libmanI'm just surprised all compiler options aren't available to the program as constants. Seems like a very simple feature.
19:55:06*nairobi quit (Remote host closed the connection)
19:57:04*libman hacks something together using staticExec
20:02:34*brechtm joined #nim
20:03:20*cyraxjoe quit (Remote host closed the connection)
20:04:13*nairobi joined #nim
20:04:13*brechtm quit (Read error: Connection reset by peer)
20:04:31*brechtm joined #nim
20:04:44*cyraxjoe joined #nim
20:08:49*nairobi quit (Remote host closed the connection)
20:14:53*Mat4 joined #nim
20:16:03Mat4lines like these compile without problems:
20:16:22Mat4let test =
20:16:23Mat4 proc (s: string): string = s & " ."
20:17:55*GangstaCat joined #nim
20:19:13*cyraxjoe quit (Remote host closed the connection)
20:21:31Mat4alternatively I can exchange 'let' with 'var'
20:22:12Mat4and as it seems both statements are equivalent. Is this a bug or a feature ?
20:24:46euantorFeature
20:25:10euantorLet and var are similar, but let us immutable
20:29:51Mat4does it make any sense to you defining a variable function of static (which should be by definition immutable) behaviour ?
20:30:55euantorDoesn't make sense, but that doesn't mean that the compiler is wrong. You could reassign it to a different function later on.
20:35:38Mat4sorry I does not see in which situation that should be more useful than just defining a second function and pass a pointer at demand.
20:35:59euantorSo don't use it then?
20:36:10*gokr quit (Ping timeout: 250 seconds)
20:36:44*cyraxjoe joined #nim
20:39:41Mat4I think it should be better to handle the second variant as error
20:43:07*xet7 quit (Quit: Leaving)
20:45:09Mat4ciao
20:45:12*Mat4 left #nim (#nim)
20:48:46*Mat4 joined #nim
20:50:31Mat4here is the reason: https://gist.github.com/anonymous/1983fe58aadac20cc6a68ad089060ba8
20:50:54Mat4this compiles but lead to a stack overflow at runtime
20:51:40euantorSurely any recursive function with no terminal state would do?
20:51:46*gokr joined #nim
20:53:59*libman quit (Quit: Leaving.)
20:54:58*Ven joined #nim
20:55:18Mat4that's because test (s) is compiled as recursive call whereby it also interpreted as invocation of the previous declaration. I can envision that such ambiguity can occur frequently, in particular in larger sources
20:56:02*filwit joined #nim
20:56:19Mat4^interpreted=interpretable, invocation = call
21:00:14Mat4so it is better to forbid such possibility (similar to why it makes sense to avoid nil pointers or references)
21:00:53*Mat4 left #nim (#nim)
21:06:36*brechtm_ joined #nim
21:07:23*brechtm quit (Read error: Connection reset by peer)
21:09:17*nairobi joined #nim
21:09:57*nairobi quit (Read error: Connection reset by peer)
21:18:46*shodan45 quit (Ping timeout: 276 seconds)
21:32:53*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:41:17*Trustable joined #nim
21:43:42*Matthias247 joined #nim
21:45:20*irrequietus quit ()
21:45:36*stisa quit (Quit: quitting...)
21:45:39*irrequietus joined #nim
21:48:18*Vladar quit (Remote host closed the connection)
21:50:33*nsf quit (Quit: WeeChat 1.5)
22:00:06*cheatfate_ joined #nim
22:01:08*MyMind joined #nim
22:03:20*rbergmair quit (Ping timeout: 252 seconds)
22:03:21*delian66 quit (Ping timeout: 252 seconds)
22:03:26*rbergmair1 joined #nim
22:03:37*Sembei quit (Ping timeout: 252 seconds)
22:03:37*cheatfate quit (Ping timeout: 252 seconds)
22:03:38*Calinou quit (Ping timeout: 252 seconds)
22:03:39*ldlework quit (Ping timeout: 252 seconds)
22:04:50*delian66 joined #nim
22:04:57*Calinou joined #nim
22:08:33*ldlework joined #nim
22:23:25*SianaGearz quit (Ping timeout: 244 seconds)
22:25:20*SianaGearz joined #nim
22:27:07*Trustable quit (Remote host closed the connection)
22:28:13*gokr quit (Ping timeout: 244 seconds)
22:39:37*rbergmair1 quit (Quit: Leaving.)
22:57:47*irrequietus quit ()
23:00:28*Flox421 quit (Remote host closed the connection)
23:00:29*M-max quit (Remote host closed the connection)
23:00:29*M-Quora quit (Remote host closed the connection)
23:04:46*Flox42 joined #nim
23:13:11*Matthias247 quit (Read error: Connection reset by peer)
23:13:28*GustavoLapasta joined #nim
23:15:36*nsf joined #nim
23:28:10*brechtm_ quit (Remote host closed the connection)
23:51:49*M-max joined #nim
23:51:58*M-Quora joined #nim