00:01:44 | * | Climenty quit () |
00:15:47 | * | johnsoft quit (Ping timeout: 250 seconds) |
00:16:19 | * | Sembei quit (Ping timeout: 255 seconds) |
00:23:56 | * | johnsoft joined #nim |
00:31:18 | vikaton | anyone here good with nim-cfsml? |
00:31:44 | def- | vikaton: I tried it out at least |
00:31:58 | vikaton | Im not sure how tot set the window bg :( |
00:33:28 | fowl | vikaton, window.clear White |
00:33:39 | def- | https://github.com/BlaXpirit/nim-csfml/blob/2.2/examples/pong.nim#L168 |
00:33:44 | vikaton | I should have been more clear, set the bg to a picture |
00:33:47 | * | ddl_smurf joined #nim |
00:34:08 | vikaton | not a definite color :P |
00:34:36 | fowl | vikaton, it doesnt work like that, you just draw the sprite before everything else |
00:34:52 | fowl | covering the back of the screen |
00:35:03 | fowl | there are some options for texture repeating if it needs to do that |
00:35:58 | fowl | https://github.com/BlaXpirit/nim-csfml/blob/2.2/src/private/csfml_graphics_gen.nim#L2580 |
00:36:37 | fowl | then you set the sprite's texture width to be as big as the screen and draw it at 0,0 |
00:36:46 | fowl | sprites texture rect* |
00:38:44 | vikaton | hmm |
00:38:51 | * | kumul joined #nim |
00:39:22 | vikaton | is this how you do it? https://github.com/BlaXpirit/nim-csfml/blob/2.2/examples/shader.nim#L15 |
00:42:06 | * | renesac quit (Ping timeout: 276 seconds) |
00:43:45 | * | renesac joined #nim |
00:44:20 | * | gokr quit (Ping timeout: 246 seconds) |
00:47:13 | * | johnsoft quit (Ping timeout: 265 seconds) |
00:47:48 | * | johnsoft joined #nim |
00:49:43 | * | Kingsquee quit (Quit: Konversation terminated!) |
00:53:00 | vikaton | window.clear color(50, 200, 50) |
00:53:03 | vikaton | doesnt even work ^ |
00:53:48 | vikaton | nvm |
00:54:34 | ZZZZZZZZZ | sdl > sfml |
00:54:47 | ZZZZZZZZZ | sdl2* |
00:55:19 | vikaton | rly? |
00:56:00 | vikaton | is the sdl2 lib for Nim even active? |
00:56:45 | vikaton | https://github.com/Vladar4/sdl2-nim |
00:57:07 | ZZZZZZZZZ | https://github.com/nim-lang/sdl2 |
00:57:46 | ZZZZZZZZZ | but its preference really. |
00:58:15 | * | brson quit (Quit: leaving) |
00:58:28 | ZZZZZZZZZ | im confident about sdl2, its used by valve etc |
01:01:08 | * | renesac quit (Remote host closed the connection) |
01:01:26 | ZZZZZZZZZ | the nim wrapper is super thin, so you can just pretty much follow the sdl2 doc |
01:01:46 | vikaton | i see |
01:02:42 | ZZZZZZZZZ | if i remember correctly. |
01:03:03 | ZZZZZZZZZ | i use it mainly for opengl |
01:03:23 | ZZZZZZZZZ | windows setup + input, not so much for the rest |
01:03:37 | vikaton | If SDL has some easy way of setting a bg pic, I'm down for it :P |
01:03:54 | * | kumul quit (Ping timeout: 252 seconds) |
01:04:19 | ZZZZZZZZZ | your doing a 2d game? |
01:05:43 | * | hello12341234 joined #nim |
01:10:39 | ZZZZZZZZZ | anyway, all you would need to do is just render your background image first, then render the rest |
01:13:09 | ZZZZZZZZZ | http://programmersranch.blogspot.ca/2014/03/sdl2-animations-with-sprite-sheets.html you should be able to adapt this to nim pretty easily imo |
01:14:27 | ZZZZZZZZZ | starting from this https://github.com/nim-lang/sdl2/blob/master/examples/sdl_skeleton.nim |
01:16:05 | vikaton | hmm |
01:17:02 | ZZZZZZZZZ | doesnt show exactly what you want |
01:17:14 | ZZZZZZZZZ | but it load an image, and shows it on the screen |
01:17:41 | ZZZZZZZZZ | just make it fullscreen and you win! |
01:18:42 | ZZZZZZZZZ | im mostly using opengl directly, so for direct sdl rendering capabilities, i cant help you much more than tell you to find some tutorial or look at the doc ;P |
01:18:50 | * | boydgreenfield quit (Quit: boydgreenfield) |
01:18:57 | vikaton | hmm |
01:21:21 | vikaton | ZZZZZZZZZ: do I get the src code zip file? https://www.libsdl.org/download-2.0.php |
01:23:10 | ZZZZZZZZZ | vikaton: pretty sure you just need the dll |
01:23:35 | vikaton | so Dev libs? |
01:25:19 | ZZZZZZZZZ | your on windows or linux&? |
01:25:26 | * | CARAM__ quit () |
01:25:40 | * | CARAM__ joined #nim |
01:25:54 | vikaton | windows |
01:26:28 | Varriount | Araq: I have 64-bit pcre, ncurses, and sqlite dll's |
01:27:34 | * | vendethiel joined #nim |
01:28:29 | * | taesoo joined #nim |
01:29:41 | ZZZZZZZZZ | vikaton: you are probably using mingw right? |
01:29:47 | vikaton | yeah |
01:29:56 | * | gsingh93_ quit (Ping timeout: 252 seconds) |
01:30:32 | vikaton | ZZZZZZZZZ: BIG question, does sdl accept mp3's as audio files? |
01:31:46 | ZZZZZZZZZ | i havent used the sound with it, but with sdl_mixer you can load FLAC, MikMod, Ogg Vorbis and MP3 |
01:31:53 | ZZZZZZZZZ | you should look at the doc |
01:32:31 | ZZZZZZZZZ | http://libsdl.org/release/SDL2-devel-2.0.3-mingw.tar.gz |
01:32:37 | ZZZZZZZZZ | thats what you need |
01:32:55 | Varriount | Hi guys |
01:33:05 | ZZZZZZZZZ | setup the libs include with your mingw |
01:39:25 | vikaton | ZZZZZZZZZ: is there no way to get all the dllsin one folder like sfml? |
01:39:35 | ZZZZZZZZZ | yes |
01:39:41 | ZZZZZZZZZ | just put the dll with the exe |
01:43:46 | vikaton | i can only find one |
01:43:53 | vikaton | other are liked foo.dll.a |
01:44:39 | fowl | the addons are sold separately |
01:44:46 | fowl | er not sold |
01:47:36 | ZZZZZZZZZ | you mean sdl_mixer and gfx etc? |
01:49:10 | fowl | yeah they're all available here https://www.libsdl.org/projects/ |
01:50:57 | vikaton | Yeah ngfx |
01:51:00 | vikaton | cant find gfx |
02:00:14 | Varriount | ZZZZZZZZZ: What are you using opengl for? |
02:02:06 | ZZZZZZZZZ | at the moment, im toying with it with nim, but eventually want to make a similar game to ut2k4, but focused on dueling. |
02:02:16 | ZZZZZZZZZ | Varriout: ^ |
02:02:26 | ZZZZZZZZZ | Varriount: ^ |
02:03:37 | ZZZZZZZZZ | theres no good modern arena fps :( |
02:04:07 | ZZZZZZZZZ | theres reflex, but its basicaly CPMA, i prefer ut2k4 movement style. |
02:04:17 | ZZZZZZZZZ | and ut4 movement is shit. |
02:04:47 | ZZZZZZZZZ | vikaton: sorry, seems like you would need to compile it yourself T_T |
02:05:04 | vikaton | :[ |
02:05:10 | ZZZZZZZZZ | i just searched, and havent found a 'safe' place to download it |
02:05:13 | vikaton | 2much hassle atm |
02:06:18 | vikaton | ZZZZZZZZZ: https://github.com/AngryLawyer/rust-sdl2#windows-mingw ? |
02:08:18 | * | darkf joined #nim |
02:08:22 | Varriount | ZZZZZZZZZ: Ah. |
02:08:38 | Varriount | ZZZZZZZZZ: Any experience with 'ray marching'? |
02:09:05 | ZZZZZZZZZ | i havent done any myself, but ive seen plenty of example on shadertoy.org |
02:09:10 | Varriount | https://news.ycombinator.com/item?id=9576212 |
02:09:37 | Varriount | I really dislike being envious of people I don't know, for doing things I don't understand. |
02:14:07 | * | boydgreenfield joined #nim |
02:14:18 | ZZZZZZZZZ | lol |
02:14:49 | ZZZZZZZZZ | ive done some distance fields, but making a complete game with this technique is pretty crazy |
02:15:09 | ZZZZZZZZZ | if hes really just render on a quad in pure fragment shader |
02:15:14 | ZZZZZZZZZ | redering* |
02:15:25 | Varriount | Apparently, yes. |
02:15:34 | ZZZZZZZZZ | but yeh that could work for voxel i guess |
02:15:36 | Varriount | ZZZZZZZZZ: It's like, I should be amazed at this guys work, and I am, but part of me goes, "Why can't I be that smart?" |
02:15:43 | ZZZZZZZZZ | lol |
02:16:05 | ZZZZZZZZZ | im pumped for the new graphics api soon! |
02:16:13 | Varriount | ? |
02:16:30 | ZZZZZZZZZ | vulkan |
02:16:34 | ZZZZZZZZZ | to replace opengl |
02:16:55 | ZZZZZZZZZ | a spec should be released this year |
02:17:30 | Varriount | Yeah, but is the API going to be anything remotely understandable? |
02:17:43 | ZZZZZZZZZ | and some working library should be released at the same time i guess, since all the major vendors are developping it at the same time |
02:18:43 | ZZZZZZZZZ | ive watched some demos, and i think it can be understood pretty easily, but it takes a lot of work to get something going |
02:19:16 | ZZZZZZZZZ | so using it directly will be hard, i think it will be more used with some wrapper or framework on top of it |
02:19:22 | ZZZZZZZZZ | compared to using it as pure opengl |
02:19:53 | ZZZZZZZZZ | but you could reimplement an opengl-like framework on top of it, and still access the lower level if needed. |
02:20:26 | ZZZZZZZZZ | the main advantaged to me is, no more global states. |
02:20:41 | ZZZZZZZZZ | (theres plenty of others... but) |
02:21:26 | Varriount | See, this is why I wish my college offered a course on modern OpenGL. I know what a global state is, however I don't know what it means in this given context. |
02:22:01 | Varriount | How do people actually *learn* to use OpenGL? |
02:23:07 | ZZZZZZZZZ | https://open.gl/ |
02:23:08 | ZZZZZZZZZ | :) |
02:23:13 | fowl | i suppose you could read about it lol |
02:23:20 | fowl | or trial/error/copying code |
02:23:23 | ZZZZZZZZZ | easy to follow tutorial |
02:23:57 | ZZZZZZZZZ | once you understand the basics, you can read the real opengl doc |
02:24:14 | ZZZZZZZZZ | it explain pretty much everything |
02:26:07 | ZZZZZZZZZ | Varriount: do you have any experience with basic 3d? or graphics programming other than opengl? |
02:26:57 | Varriount | Not really. I've toyed around with a few things, but other than that, no. |
02:27:04 | ZZZZZZZZZ | imo if you have no previous 3d experience you shouldnt start with pure opengl |
02:27:21 | ZZZZZZZZZ | you should be familiar with the maths and the pure concepts first |
02:27:40 | Varriount | What would you recommend I start with then? |
02:27:49 | ZZZZZZZZZ | opengl is a pain to use, you will be overwelmed by it while learing 3d at the same time |
02:28:04 | ZZZZZZZZZ | mmm some kind of framework, in your language of choice |
02:28:18 | ZZZZZZZZZ | i started with software rendering ;) |
02:28:26 | ZZZZZZZZZ | when i was like 10 lol |
02:28:31 | Varriount | Hm. Well, Nim is probably out of the question... How about Python? |
02:28:58 | Varriount | Do you mean something like SDL or Allegro? |
02:29:09 | Varriount | Those are primarily 2d. |
02:29:09 | ZZZZZZZZZ | sure, theres 3d framework in pyton for sure |
02:29:21 | ZZZZZZZZZ | pyglet i think? |
02:29:26 | ZZZZZZZZZ | or something like that, let me check |
02:30:07 | vikaton | to much pink coming from u guys |
02:30:08 | vikaton | http://prntscr.com/77l20q |
02:30:29 | Varriount | vikaton: Change your font then. |
02:30:47 | vikaton | It's not my choice |
02:30:56 | dhasenan | ZZZZZZZZZ: try Urho3D? |
02:31:11 | vikaton | its either ur all black of automatically color coded |
02:31:22 | dhasenan | Probably easier if you have a full engine. |
02:32:24 | ZZZZZZZZZ | dhasenan: no i havent. i prefer bare bone opengl :) |
02:33:07 | ZZZZZZZZZ | Varriount: i havent used http://www.panda3d.org/ |
02:33:18 | ZZZZZZZZZ | for python, but ive heard good thing about it |
02:36:34 | ZZZZZZZZZ | or you could try darkbasic LOL, thats what i was using 15 years ago |
02:42:44 | Varriount | ZZZZZZZZZ: If you need sound effects, try using this tool: http://www.drpetter.se/project_sfxr.html |
02:43:00 | * | vendethiel quit (Ping timeout: 276 seconds) |
02:43:57 | ZZZZZZZZZ | what i was actually planning to do, was try to make a simple synth with sdl |
02:44:06 | ZZZZZZZZZ | to make simple sound effects |
02:45:19 | ZZZZZZZZZ | theres plenty of C example to get started, and i found https://gist.github.com/triplefox/45c8ffebc0d6301d525d |
02:46:55 | ZZZZZZZZZ | but sfxr looks pretty cool |
02:50:36 | * | ZZZZZZZZZ is now known as lI |
02:50:48 | * | lI is now known as lIl |
02:51:11 | * | lIl is now known as zdsa |
02:51:56 | * | zdsa is this less pink? :) |
02:52:09 | Varriount | vikaton: ^ |
02:52:28 | vikaton | yeah :P |
02:52:34 | vikaton | its dark blue now :P |
02:52:41 | * | hello12341234 quit (Quit: Page closed) |
02:52:58 | vikaton | gtg, night |
02:53:46 | fowl | any open source voxel engines |
02:55:46 | zdsa | theres one for unreal engine |
02:55:50 | zdsa | if i remember correctly |
02:55:57 | zdsa | plugin for that is |
02:56:07 | * | pregressive joined #nim |
02:57:00 | zdsa | http://www.volumesoffun.com/update-on-cubiquity-for-unreal-engine-4/ |
02:58:04 | zdsa | o shit i thought it was open source, sorry |
02:58:13 | Varriount | To anyone who loves adventure games: http://www.wadjeteyegames.com/pre-order/technobabylon/ |
02:58:27 | Varriount | <3 |
02:58:55 | zdsa | fowl: https://www.reddit.com/r/VoxelGameDev/ look on the right sidebar, theres a big list |
02:59:51 | fowl | zdsa, thanks :) |
03:00:06 | zdsa | fowl: http://www.reddit.com/r/VoxelGameDev/comments/why8x/the_big_list_of_block_engines/ |
03:00:17 | zdsa | i think u might have enough :P |
03:01:22 | * | Perelandric quit (Ping timeout: 246 seconds) |
03:01:42 | * | BitPuffin|osx quit (Ping timeout: 272 seconds) |
03:07:48 | * | boydgreenfield quit (Quit: boydgreenfield) |
03:10:54 | * | kumul joined #nim |
03:11:05 | * | dtscode quit (Quit: Leaving) |
03:12:32 | * | dtscode joined #nim |
03:37:27 | * | endragor joined #nim |
03:50:30 | * | Kingsquee joined #nim |
04:17:12 | * | boydgreenfield joined #nim |
04:17:57 | * | kumul quit (Ping timeout: 265 seconds) |
04:23:06 | * | TEttinger joined #nim |
04:29:03 | * | Varriount quit (Read error: Connection reset by peer) |
04:29:29 | * | Varriount joined #nim |
04:36:17 | * | pregressive quit (Remote host closed the connection) |
04:36:54 | * | pregressive joined #nim |
04:40:57 | * | pregressive quit (Ping timeout: 240 seconds) |
05:16:05 | * | xificurC joined #nim |
05:16:12 | * | intra quit (Ping timeout: 244 seconds) |
05:17:32 | * | ddl_smurf quit (Quit: ddl_smurf) |
05:21:55 | gokr_ | why dont you guys consider Urhonimo? |
05:28:02 | * | BlaXpirit joined #nim |
05:31:40 | * | yglukhov__ joined #nim |
05:34:00 | * | jbomo quit () |
05:35:14 | * | yglukhov__ quit (Client Quit) |
05:47:52 | * | intra joined #nim |
05:58:09 | * | taesoo quit (Ping timeout: 240 seconds) |
06:14:03 | * | Kingsquee quit (Quit: Konversation terminated!) |
06:22:29 | * | darkf_ joined #nim |
06:22:50 | fowl | gokr_, it would be my choice, i tried out the networking synchronization and its great |
06:25:30 | * | darkf quit (Ping timeout: 256 seconds) |
06:30:31 | * | darkf_ is now known as darkf |
06:32:00 | Araq | Varriount: one problem here is that we don't distinguish between prcre32.dll and pcre64.dll |
06:32:23 | Araq | we should depart from the standard DLL names and the problem goes away |
06:34:21 | dtscode | Araq: I would like to propose a feature for nim :D |
06:34:26 | dtscode | If you don't mind |
06:34:55 | Araq | go ahead |
06:35:06 | dtscode | I actually need to write up an example real quick |
06:37:53 | dtscode | Araq: https://bpaste.net/show/4bd27c3c8351 |
06:37:56 | * | gokr joined #nim |
06:38:17 | dtscode | So, something like __asm blocks for Nim (except it would be C blocks instead of asm) |
06:38:29 | * | zahary joined #nim |
06:38:33 | Araq | .emit pragma? |
06:38:47 | dtscode | Oh I was not aware of that |
06:41:01 | * | yglukhov__ joined #nim |
06:43:10 | * | wedowmaker quit (*.net *.split) |
06:43:11 | * | IronY quit (*.net *.split) |
06:43:11 | * | vinnie quit (*.net *.split) |
06:43:11 | * | Triplefox quit (*.net *.split) |
06:43:18 | * | vinnie joined #nim |
06:44:29 | * | Triplefox joined #nim |
06:46:40 | * | epichero joined #nim |
06:46:46 | * | epichero quit (Remote host closed the connection) |
06:49:41 | * | darkf_ joined #nim |
06:53:06 | * | darkf quit (Ping timeout: 265 seconds) |
06:53:59 | * | johnsoft quit (Ping timeout: 256 seconds) |
06:54:07 | * | johnsoft joined #nim |
07:02:28 | * | Kingsquee joined #nim |
07:08:19 | * | endragor_ joined #nim |
07:08:53 | * | Varriount quit (Ping timeout: 264 seconds) |
07:09:22 | * | Varriount joined #nim |
07:11:45 | * | endragor quit (Ping timeout: 240 seconds) |
07:16:35 | * | johnsoft quit (Ping timeout: 244 seconds) |
07:16:44 | * | johnsoft joined #nim |
07:18:53 | * | endragor_ quit (Remote host closed the connection) |
07:19:32 | * | endragor joined #nim |
07:20:18 | reactormonk | Araq, why exactly can't procvar be the default of procs? |
07:20:49 | Araq | reactormonk: it would defeat its purpose |
07:22:56 | reactormonk | "The rules' purpose is to prevent the case that extending a non-procvar procedure with default parameters breaks client code." - how would additional default parameters break client code? |
07:22:57 | Araq | dom96: we need a better spam filter on the forum |
07:23:50 | Araq | reactormonk: let foo: proc (s: string): seq[string] = strutils.split |
07:24:12 | Araq | strutils evolves, split grows a new defautl parameter |
07:24:29 | Araq | and the above line doesn't compile anymore |
07:25:04 | Araq | so adding a default param to strutils.split is a change that can break code |
07:25:17 | reactormonk | hmmm... would it be possible to convert procs by chunking off default parameters? Or too ugly? |
07:25:36 | * | johnsoft quit (Ping timeout: 252 seconds) |
07:25:49 | Araq | too much work. |
07:25:50 | reactormonk | too flimsy, might break? |
07:25:52 | * | johnsoft joined #nim |
07:26:21 | reactormonk | So should I put it up as a feature request, just in case? |
07:26:46 | Araq | just add this to the existing RFC that .procvar needs to die |
07:26:59 | reactormonk | ok |
07:27:55 | Araq | dom96: when I ban a user all its posts should be deleted |
07:31:31 | * | darkf_ is now known as darkf |
07:33:28 | reactormonk | http://pastie.org/10199899 <- I assume :foo is a symbol? |
07:36:40 | reactormonk | iterators are first-class, right? |
07:36:50 | Araq | reactormonk: closure iterators are, yes |
07:37:12 | Araq | :foo is a compiler generated symbol |
07:37:26 | * | pregressive joined #nim |
07:39:25 | reactormonk | ok, assumed as much. |
07:41:49 | * | pregressive quit (Ping timeout: 264 seconds) |
07:44:32 | Araq | reactormonk: any progress on the idetools front? |
07:47:34 | Araq | reactormonk: the problem seems to be that compileModule only checks for checkDepMem() when the module has never been compiled |
07:47:49 | Araq | no wait hrm |
07:48:44 | reactormonk | Araq, the file invoked with has a different ID the second time |
07:49:14 | Araq | reactormonk: that's awful |
07:49:20 | Araq | it shouldn't have |
07:49:47 | reactormonk | yeah, different fileIdx |
07:50:07 | reactormonk | haven't found out why yet, but that's approx. where I stopped |
07:51:59 | Araq | relevant code: |
07:52:02 | Araq | var isKnownFile = true |
07:52:03 | Araq | if orig.len == 0: err() |
07:52:05 | Araq | let dirtyIdx = orig.fileInfoIdx(isKnownFile) |
07:52:06 | Araq | ? |
07:52:50 | * | IronY joined #nim |
07:54:29 | Araq | reactormonk: do you generate a new dirty filename each time? |
07:54:37 | reactormonk | err, yup... |
07:54:59 | Araq | reactormonk: nevertheless that should work |
07:55:08 | Araq | the original name is used for the lookup |
07:55:15 | Araq | and not it's dirty alias |
07:55:22 | Araq | *its |
07:55:41 | reactormonk | yup. |
07:57:11 | * | Trustable joined #nim |
07:57:47 | reactormonk | darn, I need sleep. I'll take a look at it when I wake up - laptop's right next to my bed anyway |
07:59:00 | * | johnsoft quit (Ping timeout: 256 seconds) |
07:59:26 | Araq | too bad your brain how no usb ports |
07:59:53 | * | johnsoft joined #nim |
08:03:34 | * | coffeepot joined #nim |
08:05:06 | * | vendethiel joined #nim |
08:06:38 | fowl | lol |
08:10:37 | * | boydgreenfield quit (Quit: boydgreenfield) |
08:13:50 | coffeepot | does nim have anything like a standard variant in the stdlib? I know it's simple to set one up with object variants, just wondering if it's already provided |
08:15:05 | * | Sembei joined #nim |
08:15:05 | * | intra quit (Ping timeout: 258 seconds) |
08:20:56 | Varriount | coffeepot: What exactly is a standard variant? |
08:21:06 | * | boydgreenfield joined #nim |
08:21:49 | fowl | coffeepot: there's typeinfo that provides a generic interface for any type |
08:22:18 | fowl | It is like go's bare interface{} |
08:22:51 | coffeepot | well I noticed a lot of modules use some kind of object variant that allows you to store various different types, just wondering if there's a version of this in the stdlib since it's such a common thing to do |
08:23:24 | coffeepot | for example I'm doing it for values from a database, the json module does it, and many more |
08:23:56 | coffeepot | fowl I'm more talking about storing different types than referencing them, if that makes sense |
08:24:06 | fowl | Examples of variant types? Or are you asking for a single variant type to hold any data |
08:24:57 | coffeepot | single variant to hold any data - I've already set one up, but it seems so common (and easy), just wondering if something exists already |
08:26:03 | fowl | Yes in typeinfo |
08:26:10 | coffeepot | cool :) |
08:26:15 | fowl | Its not a variant object |
08:26:28 | fowl | But it does what you describe |
08:26:29 | coffeepot | TAny ? |
08:26:34 | fowl | Yea |
08:26:37 | coffeepot | :) |
08:27:05 | coffeepot | cool, I knew there would be! :) |
08:27:10 | coffeepot | thanks fowl |
08:27:43 | fowl | it only holds a reference though |
08:28:31 | coffeepot | yeah |
08:29:45 | fowl | Because if it held a copy then you need more functionality, at least a way to deref GC memory held |
08:29:51 | coffeepot | well, anyway it was more of an academic question, but also I didn't want to reinvent the wheel |
08:30:10 | coffeepot | so it seems that object variants don't have this issue though? |
08:30:29 | coffeepot | i say issue, but obviously it's been designed with a use in mind |
08:30:30 | fowl | coffeepot: I have an example that makes concept types instanceable |
08:30:44 | fowl | coffeepot: no because in your variant it has a known type |
08:30:58 | coffeepot | ahh yes good point |
08:31:11 | fowl | Whereas here we have a pointer to data and a pointer to type |
08:31:37 | coffeepot | so it's more of a reference any type kind of structure, but the type is stored elsewhere? |
08:32:42 | coffeepot | makes sense, as it's part of typeinfo |
08:32:43 | fowl | Yea it provides runtime reflection |
08:32:59 | coffeepot | ah right, i see :) |
08:34:29 | fowl | coffeepot: see also https://bitbucket.org/fowlsoft/interfaces/wiki/Home |
08:37:20 | * | boydgreenfield quit (Quit: boydgreenfield) |
08:39:41 | Araq | coffeepot: imo json is the variant type you're looking for |
08:39:57 | Araq | and should be the base for DB modules |
08:40:19 | fowl | Jsonnode should cover all possible database types |
08:40:39 | fowl | SQL at least |
08:41:06 | coffeepot | Araq, I was actually thinking of using the json module for this, which is why it was mentioned above. I'm kinda glad you've said that as I am including translation to json in my module anyway, so that'll probably make it easier :) |
08:43:37 | coffeepot | fowl, I'm consistently impressed by how readable Nim is when dealing with stuff that in other languages is often compiler magic. Looking forward to your interfaces being part of the stdlib somewhen(?) At home when I'm in game writing mode, I would have loves to have interfaces |
08:43:51 | coffeepot | loved |
08:44:23 | coffeepot | though I don't feel they're as needed in other languages, it's a useful concept in larger code bases |
08:45:32 | fowl | coffeepot: it can be used to get around the issue of forward declaring types |
08:45:55 | fowl | You can already use generics for that but generics are infectious |
08:46:04 | coffeepot | haha I love generics :3 |
08:46:14 | coffeepot | but yes you're right |
08:56:48 | Araq | fowl: once interfaces work really well, can we remove "method" from the language? |
08:57:43 | * | Araq really wants to get rid of 'method' |
08:57:48 | coffeepot | aren't interfaces going to be higher overhead than method? |
08:58:28 | coffeepot | out of interest, why do you want to get rid of methods? |
08:58:32 | fowl | Araq: multiple dispatch is rarely needed but when it is, it sucks to implement from single dispatch, and I'm not sure its possible to do with this |
08:58:53 | Araq | coffeepot: neither interface nor methods are really useful when you care about performance |
09:00:39 | fowl | Instead of f(x,y) you end up with a bunch of f_x1(y, x) functions that are never used outside of the fake dispatching |
09:02:00 | Araq | coffeepot: cause they are buggy, don't interact well with generics even in principle and rarely used |
09:04:27 | coffeepot | well, fair enough :) I think the rarely used part is only because people aren't yet using Nim in anger, for large OO projects, but it sounds like interfaces do a similar job. But they are different concepts, aren't they? I mean, proccing against type vs proccing against interface is a different beast (though only subtly) |
09:05:02 | coffeepot | AIUI anyway |
09:05:32 | coffeepot | I guess methods are a subset of interfaces, kinda |
09:05:45 | Araq | fowl: also a bit of macro machinery can generate dispatchTable[x + y*rows]() which is faster than the current implementation |
09:06:07 | fowl | but the table has to be huge |
09:07:10 | Araq | dunno. it's worth a try |
09:07:15 | fowl | also most of the entries might be blank |
09:07:43 | Araq | you can special case the "default" implementation |
09:08:11 | fowl | the table is (number of x children types * number of y children types) big right |
09:08:33 | fowl | then it breaks as soon as you subclass one of them |
09:11:02 | Araq | well the table is per proc, not per type |
09:14:19 | * | Kingsquee quit (Quit: Konversation terminated!) |
09:21:50 | r-ku | can i define some kind of converter that would allow str("κόσμε") type of conversion as opposed to var s: str = "κόσμε" (which works already by defining converter toStr*(x: string): str). str is my own string type. |
09:22:28 | * | Kingsquee joined #nim |
09:24:54 | Araq | r-ku: seems like a bug if that doesn't work |
09:25:21 | r-ku | k, will make an issue on github |
09:28:00 | * | ingsoc joined #nim |
09:28:07 | Araq | ty |
09:29:47 | * | ddl_smurf joined #nim |
09:33:56 | r-ku | i noticed that exceptions are non-ref types. is there any use of them as non-ref at all? since you cant raise non-ref it makes me wonder why there is this barrier preventing raise ValueError(msg: "...") |
09:36:24 | Araq | well |
09:36:45 | Araq | the reason is historic |
09:37:22 | Araq | not sure if we can fix that without breaking every project out there |
09:37:54 | r-ku | they should use newException() anyway right? surely it can be made to work with ref types |
09:40:50 | Araq | yeah, please play with it |
09:41:00 | Araq | and tell us what it breaks ;-) |
09:44:33 | * | low-profile joined #nim |
09:45:11 | Araq | hi low-profile welcome |
09:45:27 | low-profile | Hi, thanks |
09:47:57 | * | bjz joined #nim |
09:54:27 | * | xcombelle joined #nim |
10:30:13 | dom96 | Araq: What if I want to ban someone without removing their posts? |
10:30:20 | dom96 | Araq: It should be an option if anything. |
10:40:23 | fowl | Araq: I'll try to implement a multi dispatch table. Sounds like an interesting problem |
11:23:25 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:25:34 | gokr | dom96: Btw, one thing I have wanted in the forum is to be able to click on a user and then click to read all posts from that user. |
11:26:36 | dom96 | gokr: same. Someday I will go on a frenzy and implement lots of nice things in the forum :) |
11:30:13 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:44:32 | * | pipeep quit (Ping timeout: 256 seconds) |
11:46:47 | gokr | Neat: https://github.com/jangko/msgpack4nim |
11:47:46 | * | pipeep joined #nim |
11:50:16 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
11:56:38 | * | egrep quit (Quit: Error -38: Black hole has swalled this client.) |
11:57:18 | * | egrep joined #nim |
12:04:09 | * | allan0 quit (Ping timeout: 240 seconds) |
12:05:53 | * | banister joined #nim |
12:06:11 | * | vikaton quit () |
12:17:29 | * | allan0 joined #nim |
12:34:48 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:35:34 | * | dddddd joined #nim |
12:36:38 | * | ddl_smurf quit (Quit: ddl_smurf) |
12:47:28 | coffeepot | gokr that's really cool, thanks for sharing! |
12:49:13 | def- | i agree, exactly what I asked for for the other msgpack implementation |
12:53:47 | coffeepot | just reorganising my code, does anyone else write stuff as "type A <procs for type A> ... type B <procs for type B>" etc.? I was organising it with all the types at the top then a huge list of procs, but this is a bit easier to navigate as associated types and routines are next to each other. I suppose I'm just wondering if there are any disadvanta |
12:53:47 | coffeepot | ges to this or if people would look at it and go "eww" :) |
12:58:29 | BlaXpirit | coffeepot, i find writing one type then its functions much better |
12:58:45 | BlaXpirit | problem is it doesn't always work out in Nim |
13:01:52 | coffeepot | how so? |
13:02:59 | BlaXpirit | relations between types |
13:03:14 | BlaXpirit | not even necessarily recursive |
13:03:28 | BlaXpirit | just when one type's proc works with a different type and vice versa |
13:06:52 | coffeepot | isn't that a problem in most languages though? I mean, you can forward declare a type can't you? Not actually needed to yet. |
13:07:34 | coffeepot | where that would have been a problem, I've split those types into a separate file and I include them, so I don't have to see their dirty faces |
13:08:13 | coffeepot | yet they're still declared 'out of sequence' in terms of the types they relate to |
13:08:31 | * | banister joined #nim |
13:08:34 | * | banister quit (Max SendQ exceeded) |
13:08:59 | * | banister joined #nim |
13:09:03 | * | banister quit (Max SendQ exceeded) |
13:13:17 | * | banister joined #nim |
13:13:21 | * | banister quit (Max SendQ exceeded) |
13:14:27 | * | banister joined #nim |
13:15:51 | fowl | coffeepot: it works inside the same type section |
13:16:48 | fowl | coffeepot: he means when you go to define all the functions for type X and one of them relies on type Y you'd have to break uniformity |
13:16:49 | coffeepot | ahhhh right, that's useful to know :) |
13:17:10 | coffeepot | I see yes this is a point worth knowing |
13:25:01 | * | BitPuffin|osx joined #nim |
13:27:18 | * | intra joined #nim |
13:28:40 | * | pregressive joined #nim |
13:33:15 | * | pregressive quit (Ping timeout: 258 seconds) |
13:45:30 | * | boopisaway is now known as boop |
13:45:33 | * | BlaXpirit_ joined #nim |
13:45:33 | * | BlaXpirit quit (Killed (orwell.freenode.net (Nickname regained by services))) |
13:45:33 | * | BlaXpirit_ is now known as BlaXpirit |
13:45:37 | * | banister quit (Read error: Connection reset by peer) |
13:46:36 | * | banister joined #nim |
13:50:20 | * | darkf quit (Quit: Leaving) |
13:56:26 | * | vikaton joined #nim |
14:01:01 | * | banister quit (Ping timeout: 264 seconds) |
14:01:52 | * | banister joined #nim |
14:04:27 | vikaton | my bad |
14:04:47 | vikaton | https://www.irccloud.com/pastebin/YkbBsddG |
14:05:12 | vikaton | if I have that ^, how can I make count increment 1 without waiting for the while loop? |
14:06:51 | dom96 | what is your use case? |
14:07:47 | vikaton | dom96: It's event based, so it a key is pressed, the timer starts and something else increments another variable |
14:08:14 | vikaton | https://www.irccloud.com/pastebin/lg4KIdnu |
14:08:19 | vikaton | dom96 ^ |
14:08:21 | dom96 | you shouldn't be sleeping the thread then, your event loop should have timer support |
14:08:32 | * | ddl_smurf joined #nim |
14:08:50 | vikaton | I may be misusing the word "event based" |
14:11:29 | dom96 | are you using sdl? |
14:11:56 | vikaton | dom96, no sfml |
14:12:24 | dom96 | http://www.sfml-dev.org/tutorials/2.0/system-time.php |
14:12:31 | dom96 | Use a sf::Clock |
14:12:41 | dom96 | likely just Clock in Nim. |
14:21:40 | vikaton | dom96: sleep(seconds(1)) still blocks |
14:25:20 | dom96 | http://www.sfml-dev.org/tutorials/2.0/system-time.php#measuring-time |
14:25:25 | dom96 | You shouldn't be using sleep() |
14:25:45 | * | milosn quit (Quit: leaving) |
14:26:12 | vikaton | dom96: https://github.com/BlaXpirit/nim-csfml/blob/871f403a462a1ace88ebb0e42a62ee9942e68272/examples/test_system.nim#L16 ? |
14:26:33 | dom96 | sleep will block your thread |
14:26:53 | dom96 | Better yet, if you want to measure time then do something like this: |
14:27:01 | dom96 | var timerStart = epochTime() |
14:27:24 | dom96 | if epochTime() - timerStart >= 10: doSomethingAfter10Seconds() |
14:27:36 | vikaton | hmm |
14:27:43 | BlaXpirit | that changes nothing... |
14:27:53 | dom96 | Make sure you restart it then by setting timerStart again |
14:27:58 | BlaXpirit | just learn the basics about event loop |
14:28:48 | BlaXpirit | i really doubt measuring time is the goal here |
14:29:41 | BlaXpirit | well maybe it is |
14:30:04 | * | pregressive joined #nim |
14:36:52 | vikaton | how can I break out of multiple loops in Nim? |
14:37:21 | * | TEttinger quit (Ping timeout: 276 seconds) |
14:39:23 | vikaton | nvm got it |
14:41:14 | * | bjz joined #nim |
14:41:56 | * | bjz quit (Client Quit) |
14:42:45 | * | bjz joined #nim |
14:53:14 | * | jbomo joined #nim |
14:54:59 | * | Siecje joined #nim |
14:56:09 | * | yglukhov__ quit (Ping timeout: 240 seconds) |
15:06:26 | * | Ven joined #nim |
15:16:58 | * | boop is now known as boopisaway |
15:38:29 | * | boydgreenfield joined #nim |
15:49:06 | * | endragor quit (Ping timeout: 264 seconds) |
15:50:06 | * | boydgreenfield quit (Quit: boydgreenfield) |
15:56:56 | * | Jesin quit (Quit: Leaving) |
15:57:18 | * | banister quit (Ping timeout: 276 seconds) |
15:57:41 | * | gsingh93_ joined #nim |
16:05:39 | * | TEttinger joined #nim |
16:11:24 | * | pregressive quit (Remote host closed the connection) |
16:12:57 | * | yglukhov___ joined #nim |
16:13:16 | * | taesoo joined #nim |
16:13:52 | * | Cyberfunk joined #nim |
16:14:52 | Cyberfunk | Hello. Is someone available ? I've got a little problem with my code... |
16:15:54 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:17:45 | wtw | just ask, if someone's available they will answer (or not ;) ) |
16:20:50 | def- | Cyberfunk: hi |
16:21:07 | * | Cyberfunk quit (Ping timeout: 246 seconds) |
16:29:41 | reactormonk | Araq, I'd prefer a firewire on that one ;-) |
16:30:27 | * | taesoo quit (Ping timeout: 276 seconds) |
16:31:29 | * | bluenote joined #nim |
16:33:21 | * | flaviu joined #nim |
16:34:33 | * | gokr_ joined #nim |
16:36:57 | reactormonk | in terms of https://github.com/Araq/Nim/pull/2700 - any idea how to do proper encoding handling with type safety? |
16:37:30 | * | milosn joined #nim |
16:41:15 | flaviu | reactormonk: "with type safety"? Impossible, string encoding can only be determined at runtime. |
16:41:59 | flaviu | But it's always possible to go the python route of `.decode("utf8")` and have strings be polymorphic. |
16:42:02 | reactormonk | flaviu, well, yes. What I mean is something to tag a string as unicode and then make it bail if you use a non-unicode procedure or the other way round where you can require a string to be marked as unicode |
16:43:41 | flaviu | reactormonk: Well, attaching an encoding tag to a string and asserting that at the beginning of a proc would work. |
16:44:06 | reactormonk | flaviu, question is, how do we do that with the nim type system. |
16:44:09 | TEttinger | now you just need an enum with every encoding ever used |
16:44:21 | TEttinger | viscii! |
16:44:29 | flaviu | TEttinger: ^^ |
16:44:53 | flaviu | reactormonk: A "EncodedString" type? |
16:45:07 | TEttinger | I was kinda joking, it seems extremely difficult to get a complete possible list! |
16:45:08 | reactormonk | flaviu, maybe similar to python's way of doing things, yup. |
16:45:27 | reactormonk | I'd honestly prefer to use a lib or similar for that... |
16:46:00 | flaviu | TEttinger: yep, although you can get pretty close. A 99% solution would be easy enough. |
16:46:23 | reactormonk | flaviu, remember, you also need the unicode tables for that stuff |
16:46:42 | reactormonk | e.g. LATIN1 -> UTF8 encoding points |
16:47:09 | * | kumul joined #nim |
16:47:11 | * | Cyberfunk joined #nim |
16:48:31 | reactormonk | I'd really prefer to use e.g. ICU just because encodings are ugly |
16:49:02 | flaviu | Sounds like someone could have a lot of fun wrapping ICU idiomatically :) |
16:49:11 | TEttinger | isn't ICU a huge dep though? |
16:49:18 | reactormonk | yes, yes it is |
16:49:40 | reactormonk | But encoding is ugly, and I'd prefer to have a 99% instead of a hand-built 80%... |
16:50:09 | flaviu | Also, unicode changes relatively quickly. Having someone else do all the hard work might be useful. |
16:50:24 | Cyberfunk | So here's my code : https://pastee.org/d58gs (proxy server in Nim). When I try to compile it, I obtain an error : proxy.nim(55, 19) Error: 'spawn' takes a GC safe call expression . I know I can't just call "request()" at line 31, but I don't know how to resolve my problem. Could someone help me, please ? |
16:50:28 | reactormonk | Let's see what c2nim tells me about that |
16:51:27 | reactormonk | Cyberfunk, you can't pass the socket in there would be my first guess |
16:51:40 | reactormonk | hm, wait. Should work. |
16:51:54 | reactormonk | Not sure if the compiler knows tat part though |
16:52:58 | Cyberfunk | I don't even use sockets, I parse the data received from the client and make a HTTP request with the request() function from the httpclient library |
16:53:27 | Cyberfunk | (except for the client, of course) |
16:57:01 | Cyberfunk | So, help. |
16:57:27 | reactormonk | not enough caps |
17:00:52 | reactormonk | Cyberfunk, you need to mark handle with {.noSideEffect.} |
17:01:20 | reactormonk | ... which will then complain it can have side effects |
17:03:08 | Cyberfunk | Now I have a different error. But, what then ?... |
17:04:30 | reactormonk | can't have read in there. I think you should be able to, but I'm not sure how to tell the compiler that |
17:09:02 | Araq | reactormonk: to do input validation use the taint mode |
17:11:43 | * | zero_coder joined #nim |
17:12:14 | Araq | Cyberfunk: sorry, spawn doesn't yeah work with async, known issue |
17:12:21 | Araq | *doesn't yet |
17:12:51 | Araq | but I have the code for it "almost" ready |
17:13:05 | flaviu | Is there someway to get https://gist.github.com/anonymous/e6c5a6110693afb6b99f to work? |
17:13:58 | reactormonk | flaviu, are the concepts ready for stdlib? |
17:14:46 | Cyberfunk | Araq: Oh. Never mind. Thanks ! (and reactormonk also) |
17:15:06 | flaviu | reactormonk: hmm? my question is completely unrelated to any discussion, I'm just playing around. |
17:16:11 | reactormonk | flaviu, just wanted your general statement. I have no idea how well they work yet. |
17:16:25 | reactormonk | and with playing around, you'll most likely find stuff that doesn't work as expected. |
17:17:30 | * | boopisaway is now known as boop |
17:20:34 | * | boydgreenfield joined #nim |
17:23:14 | flaviu | compiler stack overflow :( |
17:23:27 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:23:28 | flaviu | https://gist.github.com/9195f488e2b037e8b48a |
17:24:56 | reactormonk | uhh, how exactly do you deprecate types? |
17:27:38 | flaviu | reactormonk: See the stdlib: {.deprecated: [FReadEnv: ReadEnvEffect, FWriteEnv: WriteEnvEffect].} |
17:27:49 | reactormonk | thanks |
17:36:00 | * | pregressive joined #nim |
17:36:01 | * | Cyberfunk quit (Ping timeout: 246 seconds) |
17:41:11 | * | Ven joined #nim |
17:42:41 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:43:56 | * | pregressive quit (Remote host closed the connection) |
17:44:52 | * | pregressive joined #nim |
17:49:38 | * | shodan45 joined #nim |
18:06:26 | * | mgee joined #nim |
18:08:23 | mgee | hi, I have a little issue with a const array of objects. Here is a minimal example: http://pastebin.com/NdSZ4dMz |
18:08:47 | mgee | compiling this snippet gives me: "test.nim(5, 3) Error: internal error: expr(skType); unknown symbol" |
18:09:07 | * | taesoo joined #nim |
18:09:33 | mgee | however, if I replace the object with a tuple it works. I don't quite understand why it doesn't work with objects though |
18:09:57 | def- | just a compiler bug, I'd guess |
18:12:06 | mgee | ok, then I file an issue on github. thanks! |
18:12:17 | def- | missing case is in ccgexprs.nim:2021 |
18:17:01 | * | taesoo quit (Ping timeout: 265 seconds) |
18:17:09 | reactormonk | def-, got a fix up already? |
18:17:34 | def- | No |
18:19:54 | reactormonk | uh, ok. genTypeSection is empty? |
18:19:55 | * | gokr_ quit (Read error: Connection reset by peer) |
18:20:00 | reactormonk | proc genTypeSection(m: BModule, n: PNode) = |
18:20:02 | reactormonk | discard |
18:20:30 | * | endragor joined #nim |
18:21:43 | mgee | here is the github issue: https://github.com/Araq/Nim/issues/2774 |
18:22:27 | reactormonk | mgee, btw, use lowercase even for consts |
18:22:37 | mgee | reactormonk: ok thanks |
18:24:39 | reactormonk | mgee, btw, the full compiler trace helps |
18:26:38 | * | taesoo joined #nim |
18:26:47 | reactormonk | mgee, wanna try a fix? just add of skType: genTypeInfo(p, n) into the location def- mentioned |
18:27:09 | reactormonk | well, below the of nkSym section |
18:27:37 | reactormonk | just above ccgexprs.nim:2019 |
18:27:54 | mgee | reactormonk: yeap |
18:28:30 | reactormonk | and recompile via ./koch temp c test.nim |
18:30:37 | mgee | compiler/ccgexprs.nim(2022, 18) Error: type mismatch: got (BProc, PNode) |
18:30:56 | mgee | but expected one of: cgen.genTypeInfo(m: BModule, t: PType) |
18:31:54 | reactormonk | ok, was just a guess |
18:32:00 | Araq | reactormonk: that fix is completely wrong |
18:32:04 | Araq | ;-) |
18:32:05 | * | boydgreenfield joined #nim |
18:32:22 | reactormonk | Araq, it's getting you to fix it, so I consider it at least useful |
18:32:39 | * | banister joined #nim |
18:32:44 | * | banister quit (Max SendQ exceeded) |
18:33:16 | mgee | reactormonk: I updated the github issue with a full compiler trace |
18:33:18 | * | Siecje quit (Ping timeout: 276 seconds) |
18:33:23 | reactormonk | mgee, neat, thanks |
18:34:00 | * | banister joined #nim |
18:34:04 | * | banister quit (Max SendQ exceeded) |
18:35:05 | * | shodan45 quit (Quit: Konversation terminated!) |
18:37:20 | * | banister joined #nim |
18:38:08 | * | TEttinger quit (Ping timeout: 246 seconds) |
18:38:10 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:38:14 | * | Arrrrrr joined #nim |
18:57:04 | * | endragor quit (Remote host closed the connection) |
18:58:50 | * | endragor joined #nim |
19:03:15 | * | shodan45 joined #nim |
19:05:40 | * | endragor quit (Remote host closed the connection) |
19:15:52 | * | Siecje joined #nim |
19:17:09 | * | mgee_ joined #nim |
19:21:04 | * | mgee_ quit (Client Quit) |
19:21:12 | * | mgee_ joined #nim |
19:21:23 | * | mgee quit (Ping timeout: 276 seconds) |
19:21:35 | * | Ven joined #nim |
19:21:41 | * | mgee_ quit (Remote host closed the connection) |
19:21:55 | * | mgee joined #nim |
19:22:49 | * | Ven quit (Client Quit) |
19:26:24 | * | Ven joined #nim |
19:27:41 | * | filcuc joined #nim |
19:31:57 | * | Matthias247 joined #nim |
19:37:53 | vikaton | Well I finished my school project :P https://github.com/Vikaton/SpaceBarRace |
19:42:10 | BlaXpirit | > window.clear color(math.random(255),math.random(255),math.random(255)) |
19:42:14 | BlaXpirit | well that's gonna hurt |
19:44:21 | * | boydgreenfield quit (Quit: boydgreenfield) |
19:44:50 | Arrrrrr | Some poeple just want to see the world in flames. |
19:45:08 | vikaton | heh :P |
19:47:05 | * | kumul quit (Ping timeout: 250 seconds) |
19:50:15 | Arrrrrr | This is also a great lib for games, you should check it out vikaton https://github.com/EXetoC/nim-glfw |
19:50:29 | vikaton | o |
19:51:02 | vikaton | will check out |
19:51:12 | * | Arrrrrr quit (Quit: Page closed) |
20:01:23 | vikaton | Does Nim compile or transpile? |
20:01:32 | * | jubalh joined #nim |
20:01:33 | jubalh | hi |
20:02:33 | Araq | vikaton: it compiles. |
20:02:36 | Araq | jubalh: hey |
20:03:25 | vikaton | Coo |
20:04:58 | * | OnO joined #nim |
20:06:26 | def- | vikaton: think of C as portable assembler for Nim |
20:06:51 | vikaton | yeah |
20:07:16 | vikaton | The C compiled from my Nim project sure doesnt look like any C I have seen/used https://gist.github.com/Vikaton/510f50ba3e808c9194f5 |
20:07:51 | def- | compile with -d:release, then there's less noise |
20:08:47 | flaviu | To be pedantic, "transpile" means the same thing as compile. |
20:09:01 | flaviu | or at least compile means the same thing as "transpile" |
20:09:30 | Araq | flaviu: maybe. usually people think it's a source to source translation though |
20:09:32 | def- | no |
20:12:42 | * | jubalh quit (Ping timeout: 258 seconds) |
20:15:18 | * | BitPuffin|osx quit (Ping timeout: 272 seconds) |
20:16:40 | * | OnO quit (Remote host closed the connection) |
20:17:08 | dom96 | High level language to low level language -> Compiler. High level language to a different high level language -> Transpiler. |
20:17:18 | dom96 | At least as far as I understand from skimming http://en.wikipedia.org/wiki/Source-to-source_compiler |
20:18:03 | * | filcuc quit (Ping timeout: 258 seconds) |
20:18:39 | dom96 | vikaton: You really shouldn't commit DLLs. |
20:18:50 | strcmp1 | sounds about right, dom96 |
20:19:16 | flaviu | compilers ⊇ transpilers |
20:19:53 | dom96 | indeed |
20:20:09 | vikaton | dom96, I did so ppl can easily git clone and run it |
20:20:26 | vikaton | dom96, but its Nim low-level? :( |
20:20:29 | vikaton | :) * |
20:20:40 | dom96 | nim is not low-level |
20:21:02 | vikaton | o |
20:21:36 | vikaton | whats low-level defined by? steps taken to compile into an executable for example? |
20:22:02 | Varriount | vikaton: How close it is to the actual code run by the hardware. |
20:22:20 | * | xcombelle quit (Quit: Leaving) |
20:22:21 | vikaton | O |
20:22:28 | * | xcombelle joined #nim |
20:23:09 | * | xcombelle_ joined #nim |
20:23:50 | * | xcombelle__ joined #nim |
20:23:56 | * | filcuc joined #nim |
20:25:21 | * | jubalh joined #nim |
20:26:57 | * | xcombelle__ quit (Client Quit) |
20:26:58 | * | xcombelle_ quit (Client Quit) |
20:26:58 | * | xcombelle quit (Client Quit) |
20:31:39 | * | jubalh quit (Quit: Leaving) |
20:32:56 | * | boydgreenfield joined #nim |
20:43:02 | * | kumul joined #nim |
20:47:24 | * | vikaton quit () |
20:47:30 | * | kumul quit (Ping timeout: 252 seconds) |
20:50:03 | * | vikaton joined #nim |
20:55:06 | * | mgee quit (Quit: Leaving...) |
20:56:37 | * | mgee joined #nim |
21:03:15 | * | intra quit (Ping timeout: 244 seconds) |
21:03:17 | * | yglukhov___ quit (Quit: Be back later ...) |
21:05:37 | dom96 | Any of you guys bored and wanna get this going? https://github.com/exercism/xnim |
21:07:54 | vikaton | is Jester ever going to be optimized? jw? |
21:09:57 | Araq | vikaton: will you ever learn that you're not google? :P |
21:10:12 | Araq | it got optimized btw, I think |
21:11:22 | strcmp1 | last time i heard "you're not facebook, you're not google" etc, it was from a ruby on rails maintainer, and that didnt work out too well ;) |
21:12:02 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:12:28 | * | gsingh93_ quit (Ping timeout: 265 seconds) |
21:13:00 | vbtt_ | seriously, jester is fast enough |
21:13:05 | vbtt_ | even youtube runs on python: http://highscalability.com/blog/2012/3/26/7-years-of-youtube-scalability-lessons-in-30-minutes.html |
21:13:12 | vbtt_ | nothing in python is as fast as jester i believe |
21:13:19 | dom96 | vikaton: Have you tested Jester's performance lately? |
21:13:27 | vbtt_ | your bottlenecks will be elsewhere |
21:14:40 | def- | vikaton: see benchmarks here, for being single-threaded Nim isn't doing badly: https://github.com/nanoant/WebFrameworkBenchmark |
21:15:08 | def- | would still be nice to get multi-threaded async |
21:15:49 | def- | (that's a 6core/12thread CPU) |
21:16:10 | Araq | strcmp1: we had a guy from google here in #nim who said 10K requests per second is already very good and it's more about the features of the http server |
21:16:41 | vbtt_ | bah, you can just run miltiple processes instead of multi threaded |
21:16:53 | vbtt_ | one process per core |
21:17:27 | Araq | vbtt_: shhhttt, the goal is to run one process on your 500 core CPU with 3000 GB of RAM |
21:18:34 | * | taesoo quit (Ping timeout: 245 seconds) |
21:18:35 | zdsa | it should be pretty ez to remove everything from the banned user if needed, sql-> on delete cascade, delete the user, reinsert it |
21:18:44 | zdsa | nothing to more to do |
21:18:53 | zdsa | more to do* |
21:19:07 | vbtt_ | yeah, lets not get too sidetracked by benchmarks |
21:19:48 | Araq | zdsa: thanks, yeah of course. but I don't have time to even clean up my nim branches |
21:20:31 | vbtt_ | we need a good balance of performance and features. in the end you never know where you'll need to optimize until you create your hugely successful website. |
21:21:14 | zdsa | Araq: i MIGHT look at it this weekend if i got nothing to do. |
21:21:57 | * | touch joined #nim |
21:22:21 | * | touch is now known as Guest38908 |
21:22:21 | dom96 | zdsa: If you are going to implement this in the forum then please make it optional. |
21:23:00 | * | Guest38908 left #nim (#nim) |
21:23:11 | zdsa | dom96: yes of course, the ban itself would just ban, a 'delete all user items' or something would be an additional feature |
21:23:36 | vbtt_ | does delete actually delete the row or just mark it deleted? |
21:23:47 | dom96 | vbtt_: There are many more ways that we can optimise it. I have a couple of vague ideas and I'm sure that there will be networking experts in the future that will optimise it even further. |
21:24:08 | dom96 | vbtt_: deletes it |
21:24:26 | * | mgee quit (Quit: Linkinus - http://linkinus.com) |
21:24:45 | Araq | dom96, zdsa and while we're at it, don't make give a reason for the banning |
21:24:53 | Araq | it's always "spammer" anyway |
21:25:06 | zdsa | Araq: ok |
21:25:10 | vbtt_ | dom96:I suggest never deleting rows from the db, just mark a deleted column or something |
21:25:21 | vbtt_ | so you can recover from accidents |
21:25:37 | vikaton | ah nice |
21:25:41 | dom96 | Araq: Is it really that hard to write that? |
21:25:48 | vikaton | anyhow, I have a problem |
21:25:49 | zdsa | vbtt_: thats another ballpark imo |
21:26:01 | vbtt_ | dom96:sure, optimization is good, but at this point i think newer and complete features will be more attractive. |
21:26:01 | vikaton | 2 windows machines, 1 Nim file |
21:26:03 | * | bassa joined #nim |
21:26:06 | dom96 | IMO you should be forced to write it, stops you from accidentally banning people. |
21:26:07 | vbtt_ | does jester support websockets? |
21:26:09 | vikaton | 1 machine works, the other segfaults |
21:26:10 | vbtt_ | or http 2.0? |
21:26:37 | BlaXpirit | :D |
21:26:41 | vbtt_ | dom96:which is why with the deleted column, you can unban and recover everything. |
21:27:25 | dom96 | vbtt_: I'd rather not add more complexity. |
21:27:31 | zdsa | vbtt_: sure it can be done, but its way more complex |
21:27:34 | dom96 | vbtt_: Better to backup the DB regularly. |
21:27:40 | zdsa | and opens up the whole 'hide my post x' |
21:27:44 | zdsa | or whatever |
21:28:18 | zdsa | aka not a 10 minute job as adding on cascade delete on the fk lol |
21:28:37 | vikaton | def-, what does it take to get multi-threaded async? |
21:29:00 | vikaton | also, does anyone here have a windows machine at hand? |
21:29:07 | Araq | vikaton: an Araq with more time |
21:29:20 | zdsa | vbtt_: plus there is probably backups of the forums, if a mistake is made |
21:29:27 | zdsa | (or at least i hope so) |
21:29:44 | * | taesoo joined #nim |
21:30:27 | vikaton | Araq: I have never seen him before :/ |
21:30:43 | vbtt_ | sure, imo deleted column is preferable to recovery from backups, but it's understandably more work and not essential |
21:30:50 | * | Matthias247 quit (Quit: Matthias247) |
21:31:20 | dom96 | zdsa: I still need to set up proper automated backups... |
21:31:22 | vbtt_ | btw, what would it take to integrate something like http://lthread.readthedocs.org/ with nim? unfortunately it's linux/fbsd only. |
21:32:21 | zdsa | dom96: at least its just a sqlite .db, easier to setup backups compared to mysql or something |
21:32:41 | dom96 | zdsa: yeah, just a case of copying the file. |
21:33:38 | zdsa | cronjob gzip scp gg |
21:36:22 | Araq | vbtt_: these things can work out with the newish setupForeignThreadGC() |
21:37:07 | * | vendethiel quit (Ping timeout: 265 seconds) |
21:37:36 | vbtt_ | Araq: ah awesome - does that handle gc handing for stacks that are not on the actual stack? (if that made sense) |
21:37:53 | zdsa | dom96: if i ever want to add some meta data for javascript in nimforums html are you ok with that? aka data-post-id, data-last-post-id etc etc, i was thinking of maybe implementing a client-side 'new messages' and be able to mark what you have read, or sticky posts or whatever else someone might want, but client side. |
21:38:06 | Araq | vbtt_: kind of, it setups a thread local GC for a thread that hasn't been created by Nim's runtime. |
21:38:23 | zdsa | just something i MIGHt work on someday |
21:38:28 | Araq | vbtt_: then you only need to enforce .gcsafe'ty and things work out |
21:38:47 | dom96 | zdsa: why client-side? I'm planning on implementing that feature but server-side :) |
21:39:06 | dom96 | zdsa: well, I guess I can see why you might wanna do it client-side. |
21:39:20 | dom96 | although, some cookies might be enough |
21:39:27 | zdsa | dom96: lol sure then, it just doesnt new table or anything, and be customizable |
21:39:37 | dom96 | bbl |
21:39:42 | zdsa | o i was using key-value storage |
21:40:02 | zdsa | better than cookies |
21:40:11 | * | taesoo quit (Ping timeout: 250 seconds) |
21:40:32 | * | pregressive quit () |
21:44:54 | * | Matthias247 joined #nim |
21:54:54 | * | saml quit (Read error: Connection reset by peer) |
22:06:38 | * | vendethiel joined #nim |
22:07:41 | * | vikaton quit () |
22:21:03 | * | boop is now known as boopisaway |
22:26:59 | * | boydgreenfield quit (Quit: boydgreenfield) |
22:28:55 | * | boopisaway is now known as boop |
22:34:13 | flaviu | Araq: I already made a list of dead branches in the nim repo: https://github.com/Araq/Nim/issues/1893 |
22:35:32 | Araq | flaviu: yeah but not my point, I have a couple of unfinished / unpushed branches |
22:35:48 | flaviu | ah, I see. |
22:36:51 | * | boydgreenfield joined #nim |
22:47:06 | * | gsingh93_ joined #nim |
22:47:10 | * | vendethiel quit (Ping timeout: 272 seconds) |
22:51:00 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:51:35 | * | ^aurora^ joined #nim |
22:51:41 | * | Trustable quit (Remote host closed the connection) |
22:51:55 | * | filcuc quit (Quit: Konversation terminated!) |
22:53:51 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:55:22 | * | boydgreenfield quit (Quit: boydgreenfield) |
23:01:33 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:02:01 | * | Kingsquee joined #nim |
23:09:32 | zdsa | http://www.reddit.com/r/programming/comments/36qvbm/jon_blow_jai_custom_allocators_and_threads/ |
23:09:51 | zdsa | the 'context' allocator looks like a good idea |
23:11:05 | zdsa | change memory management style in the caller, transparent to the callee |
23:11:15 | zdsa | genius |
23:22:27 | * | Jesin joined #nim |
23:37:43 | Araq | zdsa: pretty sure this has been reinvented hundreds of times by now |
23:38:49 | zdsa | probably, i just had never seen it at the language level |
23:39:20 | * | Jesin quit (Quit: Leaving) |
23:39:54 | * | Jesin joined #nim |
23:40:10 | * | Axord joined #nim |
23:42:46 | Araq | zdsa: how does he do it "at the language level"? all I see is function calls |
23:45:58 | * | Siecje quit (Read error: Connection reset by peer) |
23:47:09 | zdsa | Araw: its all because of the implicit 'context' var |
23:47:53 | zdsa | Araq: ^ |
23:49:04 | zdsa | https://www.youtube.com/watch?v=ciGQCP6HgqI&feature=youtu.be&t=910 timestamp where he explains it |
23:49:48 | * | boop is now known as boopisaway |
23:50:48 | Araq | zdsa: that's a global or thread local "context" variable |
23:51:03 | Araq | that's still no "language feature" |
23:51:23 | Araq | in fact, that's what you can do in delphi since 1985 or something |
23:53:53 | vbtt_ | are global allocators really that useful? i would think type specific allocators are more useful |
23:54:33 | vbtt_ | also, does jai have a gc? how do cross pool references work? |
23:54:56 | Araq | Nim can do very similar things thanks to its thread local GCs |
23:55:32 | Araq | you can disable the GC for your thread that should only do bump pointer allocations and then discard the memory at the end |
23:55:41 | vbtt_ | ah awesome |
23:55:47 | vbtt_ | didn't realize that's possible |
23:56:02 | * | Axord left #nim ("Death by grue.") |
23:56:10 | Araq | well I guess I need to export the proc to do that but still |
23:56:17 | vbtt_ | hehe ok |
23:56:23 | Araq | it's not hard |
23:56:47 | Araq | to answer your question: no his language has no GC because "GCs are bad" |
23:57:17 | vbtt_ | oh, sounds like a lot of fun ;-) |
23:58:00 | vbtt_ | so are you mostly bugfixing these days, Araq? |
23:58:37 | * | ^aurora^ quit (Ping timeout: 264 seconds) |
23:59:30 | Araq | depends on what "these days" means |
23:59:43 | Araq | I won't get into serious bugfixing before June |
23:59:45 | reactormonk | Araq, btw, how would you code https://pastee.org/d58gs ? |