<< 04-05-2015 >>

00:15:24*vendethiel joined #nim
00:36:33*vendethiel quit (Ping timeout: 240 seconds)
00:46:28*filwit joined #nim
00:48:59*gyeates quit (Ping timeout: 245 seconds)
00:51:33*gsingh93 quit (Ping timeout: 276 seconds)
00:51:54*xanadulives joined #nim
00:52:44*vendethiel joined #nim
00:54:33reactormonkAraq, can't move it over, the type dependencies go haywire.
00:55:01Araqreactormonk: couse you can, you only need to move the 'var' to there
00:55:28reactormonkAraq, nope, it depends on the Suggest type, an when I import suggest in msg I get compiler/ast.nim(630, 11) Error: undeclared identifier: 'TLineInfo'
00:55:58reactormonkah fuck it, let's move that one over too
00:56:56reactormonknope, can't move it over. I need ast.nim because I use TSymKind which requires msg.nim TLineInfo, so the import gets nasty. Wanna go down that route?
00:57:23reactormonkI don't.
00:58:39Araqgood night
00:58:43reactormonkkk
00:58:47reactormonko/
01:00:58*lakurei quit (Quit: lakurei)
01:03:35*TEttinger joined #nim
01:12:33*xanadulives quit (Read error: Connection reset by peer)
01:14:31*vendethiel quit (Ping timeout: 264 seconds)
01:28:55filwitdom96: you around?
01:29:57filwitdom96: just wondering if Aporia is deliberately stripping whitespace from blank lines at save for some reason and, if so, why?
01:36:05fowlThat sounds like a great feature
01:43:32filwitfowl: eh? it's annoying when trying to add a line between indented code and have to re-tab first
01:44:08def-filwit: that's because there's lots of trailing whitespace in the Nim repo and it's slowly getting removed now
01:44:17def-I'd guess that it can be disabled in the settings
01:44:36filwitit's not like it's going to save much HDD space or something by removing the spaces.. I could understand something like intelligently cropping whitespace to surrounding indent levels or something
01:44:54filwitdef-: yeah i see, i'll look for a setting (think i already did, but maybe i missed it)
01:45:25def-filwit: It's quite annoying for some people. Sometimes I want to append to a line and suddenly I'm at an unexpected position because of trailing whitespace
01:46:40filwitdef-: i can't tell if you mean it's annoying the way Aporia is now, or if it's annoying without it deleting whitespace.
01:47:04def-it's annoying that there are up to 60 chars of trailing whitespace in some lines
01:47:20filwitoh yes, i see
01:47:41filwitbut that's easy to strip out.. stripping whitespace from blank lines doesn't make sense IMO
01:49:21*saml_ joined #nim
01:50:48*darkf joined #nim
02:20:31*zzach quit (Ping timeout: 255 seconds)
02:20:53*zzach joined #nim
02:27:35*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:29:02*BitPuffin|osx quit (Ping timeout: 272 seconds)
02:29:53filwitdoes anyone know if/where there's been discussion on seq len/xlen/add recently? I'm wondering why 'len' does nil-checks but not 'add', also I dislike 'xlen'.. it should be 'uncheckedLen' or 'rawLen' or something with an 'uncheckedAdd()' to go with it.. but maybe I'm out of the loop and these things have already been discussed?
02:35:22*jefus quit (Ping timeout: 255 seconds)
02:37:58def-filwit: I remember Araq mentioning something about that. I think the plan is to add nil-checked add as well. I guess the x prefix is for convenience, writing "uncheckedLen" is a bit long
02:38:35*gsingh93 joined #nim
02:39:08fowlit is planned
02:39:14fowlmaybe safeAdd/add could just be switched
02:40:00filwitit would make sense to switch those since len now defaults to 'safe'
02:40:39filwit'xlen' isn't a huge deal, though I always prefer things be clearly labeled (and just alias them if you use it often
02:41:03filwiteither way, i guess len/xlen and add/xadd would work. thanks for the info
02:43:48*jefus joined #nim
02:43:56*ddl_smurf quit (Quit: ddl_smurf)
03:03:03filwitdoes anyone know how to iterate over the fields of a type from within a macro?
03:03:36def-filwit: i'd pass it to a proc and build it there I guess
03:04:29filwitwell unfortunately I am not passing a instance, but the actual Type, eg: `impl Foo: ...` where impl is the macro and 'Foo' is the type
03:05:18filwit'getType' and 'fields' only seem to work on instances.. which I really don't want to alloc an instance just to get type field info
03:05:42fowlfilwit, yea
03:07:05fowlfilwit, https://gist.github.com/fowlmouth/3c74409c30533bb0a5b4#file-showty-nim and https://gist.github.com/fowlmouth/9b9010397ad5fe4b9872#file-xeq-nim
03:08:09filwitawesome fowl, you rock! lots of code there for me to pick through
03:11:25filwiterr, your code doesn't appear to work, fowl
03:11:27filwitfor instance: https://gist.github.com/fowlmouth/3c74409c30533bb0a5b4#file-showty-nim-L125
03:11:42filwitwhen I try to do this, I get "Error: node has no type"
03:11:56fowlfilwit, ah i will update it
03:12:18fowlfilwit, oh if you invoke it from a macro you have to use showtyperec
03:14:06filwitfowl: i'm not even calling the macro, but that line I linked to doesn't even compile for me
03:14:39filwiti just copied the first to lines of your 'showType' macro, but it doesn't work
03:19:28*saml_ quit (Quit: Leaving)
03:22:01fowlfilwit, dunno what to tell you, it works for me
03:22:07fowli just updated nim
03:24:57filwitso did i (0.11.1), odd...
03:26:02filwitoh pfft.. my mistake
03:26:15filwitlooking at the wrong thing.. sigh..
03:26:16fowlit has to be stmt (or "typed" as its called now)
03:26:45fowllol
03:29:54reactormonkanyone know where exported symbols of a module are stored?
03:29:56filwitfowl: sweet it works! thanks
03:32:07fowlgood
03:34:02filwitdoesn't seem to work in {.immediate.} macros though.. hmmm...
03:34:29filwitthough i suppose i need to figure this out, since that pragma is being depreciated anyways
03:35:12filwitnevermind, was easy to do (just removed the pragma, and made the 'body' `untyped`)
03:35:48fowlit wont where there aren't types (immediate macros, untyped (eager) expression)
03:37:04*gyeates joined #nim
03:48:25*gsingh93 quit (Ping timeout: 264 seconds)
04:03:23*vikaton quit (Quit: Connection closed for inactivity)
04:27:51*NimBot joined #nim
04:28:50*solidsnack joined #nim
04:33:08reactormonkAraq, should semIdentDef return the same symbol in case there's two global usages? or shouldn't it be called twice in the first place?
04:36:08*vendethiel joined #nim
05:04:47*NimBot joined #nim
05:05:27*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:27:46*gyeates quit (Ping timeout: 272 seconds)
05:52:55*vendethiel quit (Ping timeout: 264 seconds)
05:53:40*solidsnack joined #nim
06:15:03*vendethiel joined #nim
06:37:26*vendethiel quit (Ping timeout: 272 seconds)
06:52:11*Trustable joined #nim
07:06:01*yglukhov_ joined #nim
07:11:02*yglukhov_ quit (Ping timeout: 246 seconds)
07:12:48*vendethiel joined #nim
07:16:00*yglukhov_ joined #nim
07:16:31*gokr_ joined #nim
07:23:17*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:34:19*vendethiel quit (Ping timeout: 265 seconds)
07:36:34*OnO joined #nim
08:22:06*NimBot joined #nim
08:26:41*bjz joined #nim
08:26:57filwit"morning" gokr :)
08:27:09gokr:)
08:28:33gokrJust verified that the guy helping me with my taxes has gotten more time from the swedish IRS - phew. Otherwise last day today ;)
08:28:52gokrfilwit: So doing anything fun?
08:29:35filwithmmm.. not exactly "fun".. working on an event/object-scene system right now
08:29:52*ddl_smurf joined #nim
08:30:33*akiradeveloper joined #nim
08:31:54filwitgetting it to load arbitrary Nim types from a file right now (can't use marshal, not enough options), and auto-wire up events/object-links of known "game objects" (those that use my 'impl' macro to declare events).
08:33:40*JinShil joined #nim
08:33:48filwitpretty fun actually, i enjoy this kind of thing.. and now that `getType()` actually works with typedesc inside macros (i need to scan the records of the types in order to distinguish references to known game objects) things are going great.
08:36:39filwitgokr: you?
08:36:43*bjz quit (Ping timeout: 264 seconds)
08:37:36gokrMmmm, we are working on integrating Urh3D in our system. So I have some issues to work on
08:39:24gokrWhen you write "load arbitrary Nim types" - you refer to serialization?
08:39:59filwityes
08:40:30gokrSo you wrote your own?
08:40:44filwitwell i'm writing that part of it now, yes
08:42:00filwiti've it working with marshal already, but I need to do some special processing on the instances before storing them (their ref-type records of known "game object" types are treated specially)
08:46:42OnOoh, good morning everyone
08:47:48filwitmorning
08:48:00*akiradeveloper quit ()
08:49:17*vendethiel joined #nim
08:51:40filwitit's pretty great that you can use procs as global variable generators for generic parameter sets... I'm not sure if that's possible in C++ or not, but it's really useful.
08:52:35gokrI looked at marshal - is that the "only" serialization we have in stdlib?
08:52:55gokrJust wondering if we have more
08:53:21filwitwell the only one that does all the heavy lifting for you. You can use typeinfo yourself which is easy.
08:54:49filwitbut yeah, marshal should get some updates too.. and I really don't like the `$$` name personally... it's too rare a procedure to justify such a easy-to-miss-cause-it-looks-just-like-$ name.
08:55:36gokrI read through it - and its easy code. But ... no special hooks or support for migrating stuff. It does handle cycles right? I thought I saw that.
08:56:14filwiti haven't tested for cycles actually...
08:56:39gokrIt seems to keep track of everything stored - and writes out a pointer int instead if already written.
08:57:49filwitit does "deep" serialization.. always, which is my problem with it.
08:58:07gokrRight, no "hooks"
08:58:23gokrSo you can override what to store.
08:58:44filwitright
08:59:29filwiti'm not familiar with other serialization libs.. i did a tad of it with C# a few years ago, but I can't remember what features where available
08:59:42filwitand a little with D too
09:00:55*bjz joined #nim
09:03:36gokrPharo has a very good one these days called Fuel.
09:04:14gokrI just clicked through the original presentation of it - one thing it does in order to be fast is to cluster instances by type.
09:05:04*milosn quit (Quit: leaving)
09:05:54filwitwell for my purposes using typeinfo and macros directly works just fine.. it's really pretty easy to serialize Nim objects yourself
09:06:45filwiti found this out awhile ago and it's really cool:
09:06:45gokrSo you store the actual type too?
09:06:45filwitproc enabledItems(T:typedesc, eventName:static[string]): var seq[T] = var data {.global.} = newSeq[T](); data
09:07:14filwitwhat do you mean by "store the type" ?
09:07:39gokrI mean... what about objects and inheritance etc?
09:08:13gokrIf you always know the exact type of every field - and don't bother with migration - then sure, no need to store the type.
09:09:27filwithmm.. that doesn't help me understand what you're asking really.. i don't know what you mean by "migration" exactly (though I can guess)
09:09:52gokrMigration as in loading data into a program in which types have changed.
09:10:06gokrSay objects that now have more or less fields etc
09:10:41filwiti see, well that's not really applicable to my situation (I don't think)
09:11:10gokrAnd if you have an object that has a field of type Fruit - which can ref an Apple or Banana, how do you store it?
09:11:51gokrI presume you need to store somehow the type of the fruit - or else, how do you know what to create when you load?
09:12:13filwitbasically I'm trying to store a game's "scene", which is just a list of arbitrary Nim types registered as a "game object".. each scene is entirely self-contained (game objects shouldn't ever reference other's outside a given scene, at least not for initialization)
09:13:19*vendethiel quit (Ping timeout: 264 seconds)
09:13:31filwitand I load the entire scene at once.. each object instance in the scene has an index, and each object reference to any other game object in that scene will store reference by that index
09:15:07filwitso the step's I'm planning are: Allocate each instance in scene -> wire together known game-object references by index -> wire events for known game object's (and their known events) -> ready to execute
09:16:24OnOneed help: how do I get T type's name having arg of T : typename
09:16:30filwit^ steps for loading from a scene*
09:16:57filwitOnO: repr(T)
09:17:58OnOError: internal error: expr(skType); unknown symbol
09:18:05OnOtype User = object
09:18:05OnOecho repr(User)
09:18:17BlaXpiritOnO, so it's a macro?
09:18:56OnOI have a: template `.`(T: typedesc[Model], f: string): ORMStmt =
09:19:00filwitOnO: well this works: proc sayName(T:typedesc) = echo repr T
09:19:03OnOI want turn T into its type name
09:19:06OnOa string
09:19:54filwiterr.. sorry, you need to make a const equal 'repr(T)'
09:19:54OnOfilwit: hmm... crashes here
09:19:57BlaXpiritOnO, typetraits.name
09:20:10filwitOnO: yeah, it's a bug, my bad. Do this instead
09:20:20filwitproc sayName(T:typedesc) =
09:20:25filwit const name = repr T
09:20:28filwit echo name
09:21:01BlaXpiritdoes not appear to work either
09:21:09BlaXpirittypetraits.name just works -_-
09:21:16*vendethiel joined #nim
09:21:28OnOyes... typetraits!
09:21:29OnOthanks
09:21:36filwitOnO: wtf.. that doesn't seem to work either.. i was just doing this, one sec
09:23:57filwitbut yeah, typetraits is probably best anyways
09:24:05OnOis there any way to prevent symbol from module to be declared without suffix, I want use typetraits.name but not name
09:24:22OnOsince name collides with mine
09:24:41BlaXpiritfrom typetraits import nil
09:25:24BlaXpiritthis is the annoying part about nim. import nil only works well for modules that don't have any classes
09:25:50OnOBlaXpirit: ok, works, thanks
09:28:28OnOAraq: did I understood correctly that you are working on making seq[T] concat operation work on compile time?
09:30:30BlaXpiritbut it works normally!
09:33:20OnOI am sorry, what?
09:34:11*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:40:37*RegisterOn joined #nim
09:40:54RegisterOnsup
09:41:07filwithi
09:46:39RegisterOnis it possible to cross-compile nim programs? e.g. make freebsd binaries from osx or windows?
09:47:01RegisterOni understand it's a c++ compiler underneath, so maybe it's just how i pass flags to that?
09:47:30filwitRegisterOn: http://nim-lang.org/0.11.0/nimc.html#cross-compilation
09:48:07gokrRegisterOn: Personally I would just use Vagrant or something.
09:49:57filwiton second thought.. i may just use marshal to do all serialization, then just scan that tree and register known 'game objects' after allocation (to wire state/events and trigger setup)
09:52:41filwiti think i can do it if I just append a typename to each root instance
09:53:42filwiter.. duh, that's obviously what marshal was intended for, now that I think about it..
09:54:39gokrIts indeed a common pattern - get it into memory first, shape it up.
09:55:08dom96filwit: I don't see why removing empty lines of whitespace would be a problem.
09:55:15OnORegisterOn: for Linux cross compiling from OSX I use http://crossgcc.rts-software.org/doku.php
09:55:25OnOalso for windows
09:55:26filwityeah.. for some reason I was thinking marshal wasn't going to work because it didn't store the names or something.. but I think it does, so I'm not sure where I got that idea
09:55:39gokrThe names of?
09:56:18filwitdom96: it's only annoying to have to retab to the correct place when trying to add code into the middle of a procedure
09:56:30filwitwhich happens a ton, so yeah
09:57:49*HakanD joined #nim
09:57:57filwitdef mentioned it was to remove excessive whitespace from projects, which is cool, but IMO it should leave empty lines alone. Anyways, I wasn't just trying to complain about something, it's not a huge deal or anything.. i just didn't know if you'd done it intentionally or not.
09:58:07dom96I usually just press enter and the next line is at the correct indentation level.
09:58:30dom96I think there is an option to disable it though.
09:59:42*HakanD_ joined #nim
09:59:46filwiti looked through raw options and didn't see anything, but maybe it was just missing from the existing name (i noticed "scrollPastEnd" was in rawPrefs and not prefs). I'll look through the source code later and find out
10:03:15*HakanD quit (Ping timeout: 256 seconds)
10:03:58filwitdom96: any idea what the option would be called? (looking at aporia/cfg.nim right now)
10:04:55dom96hrm, I guess there isn't one. Sorry.
10:05:20*vendethiel quit (Ping timeout: 252 seconds)
10:05:54filwitno problem, do you know where it's handled in aporia.nim by any chance? I'll look into adding one.
10:07:55*antranigv joined #nim
10:13:32filwitnevermind, found it in utils.nim:normalize
10:15:15*HakanD_ quit (Quit: Be back later ...)
10:19:51antranigvis there a newsgroup for nim? (:
10:20:20repaxantranigv: There's a forum.
10:20:23repaxhttp://forum.nim-lang.org/
10:21:18RegisterOnthanks, seems like cross-compiling works just fine
10:22:18filwitdom96: okay, I changed it to keep whitespace of empty lines, but I'll add an option for it before I make a PR... I want to add de-indent on backspace in 2-or-more-whitespace chars too while I'm here
10:23:09filwitmake that `tabcount`-or-more-whitespace chars of course
10:23:38dom96antranigv: there is also a mailing list http://nim-lang.org/community.html
10:24:18RegisterOnany well-known software written in Nim out there?
10:25:11dom96filwit: yes, add an option for both.
10:25:19filwitwell known? I don't know of any. But have you seen def-'s NES emulator? it's pretty cool (and runs in the web too)
10:25:29filwitdom96: k
10:26:31RegisterOnanyway, well done guys, so far Nim looks really good for systems programming
10:26:34filwitRegisterOn: plus there's the Urho3D bindings as well, which is pretty cool
10:26:42RegisterOni'll check it out
10:26:56dom96the nim forum is written in Nim too
10:27:03RegisterOnnice
10:28:11*HakanD_ joined #nim
10:30:07*Ven_ joined #nim
10:34:23*ingsoc joined #nim
10:35:53*ingsoc quit (Client Quit)
10:36:05antranigvnice :) the only reason I like newsgroups more than forums is the web (: so yay for the mailing list
10:36:16*banister joined #nim
10:36:47RegisterOnwait... what?
10:41:36antranigvin short. i love doing everything in alpine (:
10:42:14RegisterOnhah, just went back to mutt from alpine
10:51:20*vendethiel joined #nim
11:02:14*Kingsquee quit (Quit: Konversation terminated!)
11:06:11antranigvRegisterOn: out of topic. which one do you like better?
11:10:59RegisterOnantranigv: i like both, but mutt is just more configurable for the things I do, and it's has started to get some serious maintenance love lately, accepting my patches quickly
11:11:18RegisterOnantranigv: http://dev.mutt.org/hg/mutt/
11:11:34RegisterOnthat's right, 11 hours ago :)
11:13:56*vendethiel quit (Ping timeout: 256 seconds)
11:14:16antranigvo~ nice (: did you write the patch in nim?
11:14:31RegisterOnheh, alas
11:29:49*TEttinger quit (Ping timeout: 245 seconds)
11:40:21def-http://hookrace.net/blog/nim-binary-size/
11:40:40def-^ New article, hope it's fun to read
11:41:01RegisterOnby you?
11:41:36def-yes
11:42:23RegisterOnawesome, i'm going to use Nim in a freestanding kernel project, just the stuff I love reading about :)
11:44:18*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:44:34jefusi've yet to actually dive into nim, but indeed that was a fun and interesting read; thanks def-
11:47:54RegisterOnare there plans to provide a pure standard networking library (only wrappers now)?
11:48:10*seymour_ joined #nim
11:49:34dom96RegisterOn: have you seen the net module?
11:50:06RegisterOndom96: ah, missed that, thanks!
11:50:36*seymour quit (Ping timeout: 240 seconds)
11:50:40RegisterOnoh, there's an asyncdispatch/net too
11:50:41RegisterOnniiiice
11:54:14RegisterOnugh, seems like brew only has 0.10.2, i hope this gets updated soon
11:54:36def-RegisterOn: yes, they have an issue about it I saw yesterday
11:54:49RegisterOnyeah?
11:55:00def-https://github.com/Homebrew/homebrew/pull/39272
11:55:19RegisterOnaha, thanks!
11:55:31def-Where they say they want to wait for 0.11.2, which should should be released today if Araq hasn't changed plans
11:55:55RegisterOnAraq: plan on? :)
11:58:07*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:07:28*iamd3vil joined #nim
12:26:45FDGFGFGDFDhttp://www.reddit.com/r/programming/comments/34tb7r/nim_binary_size_from_160_kb_to_150_bytes/cqxvm1j
12:28:52AraqRegisterOn: yes.
12:34:17thotypousFDGFGFGDFD: nice article :D
12:35:48FDGFGFGDFDits from def- , i just wrote the stupid comment ;)
12:39:38OnOAraq: just to ensure that you've said yesterday evening, are you working on compile-time folding (concat) of seq[T]?
12:39:56AraqOnO: yes but not for 0.11.2
12:40:12AraqOnO: try --implicitStatic:on with your code, it might help
12:40:39OnOokay.... here's my experiment updated: https://gist.github.com/nanoant/ce1428eee5d009fdf3eb
12:41:05r-kudef-: thats pretty cool article. was interesting read
12:41:14OnOI am still not sure whether I should use templates or macros for generating SQL + argument variables seq from stmt
12:41:40OnOtemplates seem to be more natural, but so far I can't make strings fold this way
12:42:02Araqyou're doing it wrong ;-)
12:42:03ddl_smurfyou probably can't do everything with templates, but what you can you should
12:42:49*OnwardEuler joined #nim
12:42:59OnOAraq: tell me more :)
12:43:38Araqyou're building some AST from Nim's AST via templates, that's not necessary, you only need a single toSql macro
12:43:57Araqor maybe not, but that's what I would try
12:44:07OnOyes, this is what I was asking :> so I'll try with macros
12:44:09gokrdef-: Fun article
12:44:13Araqmacro toSql(x: untyped)
12:44:43OnOjust one Q everything that comes as "s" to macro(s:stmt) is already pre-optimized?
12:45:08OnOI mean calling toSql(v == 1 + 1) I will get AST for 1+1 or just 2
12:45:09OnO?
12:45:31Araqthat's what --implicitStatic:on tries to do and what I'm working on
12:46:19Araqbut well for 'untyped' you won't get this
12:46:33Araqbut it's not necessary for this I think
12:48:04*vikaton joined #nim
12:48:25r-kugokr: poke. just so you know.. urhonimo github repo wasnt synced in a month. maybe whenever you are bored and have nothing else to do..? ;)
12:49:48*kulelu88 joined #nim
12:51:39*NimBot joined #nim
12:51:46kulelu88vikaton: yes.
12:51:50kulelu88let me find it for you
12:51:59vikatonthanks
12:52:21kulelu88vikaton: https://github.com/idlewan/nawak
12:52:23RegisterOnbut is it nimble? :D
12:52:43kulelu88the guys who work on Nim don't seem to be too eager to make nim a web-ready language
12:52:58kulelu88the scope is probably too narrow for just web stuff
12:53:12kulelu88so they prefer to stay on a gaming/systems kind of level
12:53:20AraqIMO def- did destroy the point of web framework benchmarks yesterday night
12:53:22vikatono
12:53:40vikatonAraq, what did he say?
12:53:43OnwardEulerAraq: how so?
12:54:29kulelu88and they may also be shooting themselves in the foot by making Nim web-ready. Python and Ruby are just so much easier to use for web stuff and it kind of seems irrational to choose nim/go/rust for your small webapp
12:54:48*iamd3vil left #nim ("Leaving")
12:55:54vikatonI benchmarked Rust vs Crystal yesterday https://gist.github.com/Vikaton/3102c16ee14ef3d76244
12:56:01vikatonand I was looking forward for benchmarking Nim
12:56:24vikatonthough maybe I should wait since dom96 informed me that jesters isnt quite optimized yet
12:56:48*EXetoC joined #nim
12:57:14kulelu88vikaton: I think the ideal benchmark would be to handle +1 million requests per second?
12:57:17dom96kulelu88: I certainly want to make Nim web ready.
12:57:43vikatonkulelu88: this is a 512 mb RAM vps, kinda hard to get it to hit 1mil
12:58:10vikatonthough it does show a rough image between the 2
12:58:49kulelu88dom96: even with a genius like yourself behind Jester, the momentum seems to be with Go for fast webapps
12:58:56*HakanD_ quit (Quit: Be back later ...)
12:59:08dom96kulelu88: Hah. I wouldn't consider myself a genius but thank you :)
12:59:16vikatonI really dont like Go
12:59:18dom96I guess the biggest problem is that I have very little time nowadays.
12:59:32kulelu88what's Crystal?
12:59:38Araqhe said he got 1-2 requests per second when his article was the top at hacker news and reddit
12:59:39vikatonI would def go with Crystal rather than Go, think of it as a blazing fast rails app
13:00:11vikatonkulelu88: compiled Ruby (basically, though not literally)
13:00:32Araqnot 1000 requests per second, not 100, not 10, but perhaps 2.
13:01:18vikatonAraq, Def-'s website is personal is it not?
13:01:41EXetoC2 :p
13:01:59kulelu88a game like agar.io in Nim would be the ultimate test to see if it can compete with C++
13:02:08EXetoCoh
13:02:12kulelu88I've never heard of Crystal before. I know Pypy
13:02:46vikatonkulelu88: its barely 1 year old
13:02:47pigmejkulelu88: pypy is 'python' not the same group
13:03:28*HakanD_ joined #nim
13:03:29vikatonCrystal/Nim/Rust/C++/C are all in the same window of performance
13:03:40antranigvI am amazed that github recognizes Nim, but not Oberon-2 :)
13:03:43kulelu88pigmej: I know Pypy is python +P I'm just trying to say that I've never heard of compiled Ruby before
13:04:17kulelu88at least you guys welcome these discussions. Try asking these questions in Go :D
13:04:21pigmejkulelu88: pypy is not 'compiled' python
13:04:26thotypousantranigv: there is a linguist repository for recognizing languages which accepts PRs, so basically it is collaborative
13:04:36vikatonGo is before my time
13:04:43kulelu88it's JIT and 'faster' than Cython (apparently)
13:04:56pigmejkulelu88: cpython,
13:05:00vikatonCrystal is AOT
13:05:03pigmejcython is also different language
13:05:13kulelu88aah yes. i'm confused again
13:05:17pigmejkulelu88: the thing is, you can't compare apples and oranges :)
13:05:46*mpthrapp joined #nim
13:05:55pigmejpypy have awesome JIT, it's starting to have STM, it's generally very cool project
13:06:04kulelu88pigmej: true. that's why Im no longer fighting it. I'll use Python for now and dream of a nim-py-go blazing fast, easy to write, web language someday
13:06:10pigmejand rpython does the job very well in other langauges (ruby, php)
13:06:39vikatonwhats
13:06:52vikatonnim-py-go blazng fast?
13:07:38kulelu88vikaton: in simple terms, convulated bullshit +)
13:07:40kulelu88=)
13:08:44vikatonkulelu88: if u want that, maybe this will interest u, https://github.com/dhruvrajvanshi/Moonshine
13:09:59kulelu88would it be possible to write the underlying workings of a web-framework in nim and use Python on top of it for the basic stuff?
13:10:21kulelu88something like: https://github.com/StarfruitStack/guava
13:12:12*banister joined #nim
13:12:32thotypouskulelu88: does python act like a glue language for plugging C modules in guava?
13:12:47thotypousimho python is not the most adequate language for this kind of task
13:13:40thotypouslua is usually better as a glue for lowlevel code
13:13:49kulelu88I think the core of the work is written using the Python-C API and this framework is rest-like, so you write what I would call the "fluff" code on top
13:14:05kulelu88I could be wrong
13:14:12kulelu88Always assume I am wrong
13:14:15kulelu88=)
13:18:08Araqkulelu88: the point of compiling things is not only speed, it's also security
13:18:24AraqNim has no 'eval', Python does
13:19:18AraqNim tries to prevent SQL injection attacks via its type system, Python doesn't even have a type system
13:19:32antranigvAraq: agree (:
13:21:08thotypouswell, one could argue the same for java or .net :P
13:22:32Araqthotypous: Java and .NET are heavily used for web development but have reflection which weakens these systems in practice to be hardly better than dynamically typed, ymmv
13:23:25thotypous(i purposefully said .net in order to include F# in the list :P)
13:24:03vikatoncould Nim implement n eval command tool/
13:24:15vikaton'nim eval 'echo "hi"`
13:24:20*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
13:24:34thotypousif you link to the compiler and to libtcc, it would be possible
13:25:55Araqyes and there is also os.execShellCmd anyway. but you can use Nim's effect system to prove "this section of code doesn't exec external stuff"
13:27:16thotypouswhich gets us to the point that, unless you strictly enforce W^X memory protection, you can treat the cpu as being as vulnerable to "reflection" as the java or .net VMs ;D
13:28:27Araqer ... no. why do you think that?
13:30:07thotypousyes, you are right, not really with nim, unless there is a bug in unsafe code
13:31:07*vendethiel joined #nim
13:36:20pigmejkulelu88: the thing is if you want fast python 'api' then just use it
13:36:34pigmejyou will need uwsgi / nginx in front anyway, so ...
13:36:37pigmejit's C level,
13:46:26RegisterOnthat said, reflection is a wonderful tool for writing serialization and ORM frameworks :)
13:47:06thotypousmetaprogramming ftw
13:47:11RegisterOnwhile in the C world, stuff like s11n has to resort to pretty lame linker tricks
13:47:27*darkf quit (Quit: Leaving)
13:47:32AraqRegisterOn: these things are better done with a macro system
13:47:55OnwardEulerAre there any examples of how to use the socket libraries?
13:48:33RegisterOnAraq: how can you discover facts about types at runtime with a macro system? Bear with me, I'm a total Nim noob :)
13:48:53RegisterOnfrom time to time, that's mighty useful
13:49:07RegisterOnload in plugins dynamically, discover stuff
13:49:27Araqyou don't, that's the point. instead you generate specialized serializers at compile-time with the type knowledge you have at compile-time
13:49:38RegisterOnheh
13:56:16*vendethiel quit (Ping timeout: 240 seconds)
13:59:12dom96OnwardEuler: What would you like to do?
14:00:32dom96The net docs really do need more examples.
14:00:35OnwardEulerdom96: I'm trying to make a simple client/server based app
14:00:40dom96The asyncnet docs have an example.
14:00:51dom96of exactly that
14:01:04dom96http://nim-lang.org/asyncnet.html
14:01:19OnwardEulerAwesome, thanks!
14:02:18OnwardEulerI hadn't even looked at the asyncnet pages... that's exactly what I needed =)
14:02:20*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:09:36*ddl_smurf quit (Quit: ddl_smurf)
14:11:17*banister joined #nim
14:14:27*gsingh93 joined #nim
14:16:21*saml joined #nim
14:18:12kulelu88proc is the same thing as func right?
14:18:45BlaXpiritkulelu88, func does not exist
14:18:49BlaXpirityet
14:19:19kulelu88but isn't proc equivalent to a function?
14:19:27BlaXpiritbut yes, you can use `proc` for procedures that return values
14:19:48thotypousas in "equivalent to the concept of function in other languages"?
14:19:49thotypousyes
14:19:51*superfunc joined #nim
14:19:54BlaXpiritlong story short, proc is a function
14:22:08*gsingh93 quit (Ping timeout: 244 seconds)
14:22:14*jsudlow joined #nim
14:22:17kulelu88in the case of optimizing jester, where is the optimization lacking? In the algorithms or in the use of outdated features?
14:22:49thotypousis jester slow at all? i think it is pretty fast
14:23:06superfunchaven't been around in a bit, have typeclasses changed much, or are they still mostly experimental?
14:23:28BlaXpiritsuperfunc, they work better
14:23:30Araqsuperfunc: they kind of work now and are called 'concept's now
14:23:39superfunccool
14:23:43superfuncalso, hey Araq
14:24:00*kulelu88 superfunc should be known as superproc
14:25:01*milosn joined #nim
14:26:00OnwardEulerdom96: that example in the docs won't compile, says I've got an Error: unhandled exception, ivalid format string [ValueError]
14:26:17*Ven joined #nim
14:28:04*HakanD_ quit (Quit: Be back later ...)
14:28:15dom96OnwardEuler: works for me on Windows.
14:28:37*HakanD_ joined #nim
14:28:38OnwardEulerI'm on windows, latest nim and everything
14:28:38*HakanD_ quit (Read error: Connection reset by peer)
14:28:52*mhi^ joined #nim
14:30:17*ChrisMAN joined #nim
14:30:48dom96OnwardEuler: weird
14:30:48OnwardEuler" Error: unhandled exception: invalid format string [ValueError] "
14:30:59dom96Is the compiler crashing?
14:31:06OnwardEulerNo line info or anything, could it be a macro thing?
14:31:19*BitPuffin|osx joined #nim
14:31:22Araqmore likely your config is borked
14:32:01*Jehan_ joined #nim
14:32:29OnwardEulerI'll take a look at my cfg
14:34:27filwitdef-: nice article
14:34:48OnwardEulerAraq: I'm pretty sure I'm using the default config
14:35:25OnwardEulerShould I look for anything in particular?
14:35:25def-Araq: any idea how I can set codegenDecl on the declaration of a proc only and not the definition? I'm trying {.codegenDecl: "$# $# $# __attribute__((noreturn))".} because {.noReturn.} doesn't seem to do that
14:35:26*gokr quit (Quit: Leaving.)
14:35:51OnwardEuleroh, dom96: yeah, I'm pretty sure the compiler's crashing
14:36:13Araqyeah well... that doesn't work, def- :-/
14:36:30def-Araq: alright, too bad. would have saved another byte ;)
14:36:48dom96OnwardEuler: Can you compile hello world?
14:38:24OnwardEulerdom96 - Nope that crashes too, same error
14:38:46OnwardEulershould have tried that sooner, I only just installed 0.11
14:41:02OnwardEulerreinstalling, will report back
14:44:18*gsingh93 joined #nim
14:48:14OnwardEulerdom96, Araq: Don't know what happened, reinstalled, works now. Thanks!
14:48:36dom96OnwardEuler: That's good to hear.
14:49:06superfuncI wonder what happened
14:50:23*HakanD_ joined #nim
14:50:58Araqbbs
14:57:02def-t
15:04:11*Ven quit (Disconnected by services)
15:04:32OnwardEulerdom96: though telnetting into the server yields some weird results hahah
15:04:51*Ven_ joined #nim
15:06:01*OnO joined #nim
15:10:48*gyeates joined #nim
15:21:13kulelu88dom96: do you have enough time to write an app similar to this one: http://tangowithdjango.com ?
15:22:44dom96kulelu88: I am planning on writing something similar for Jester. Whether I have the time... nope, at least not right now with exams coming up...
15:23:16*ddl_smurf joined #nim
15:25:42*ingsoc joined #nim
15:26:58kulelu88dom96: perhaps you can skip the tutorial part and write the app only. I'd like to see a proper crud app in jester that i can do cookie-cutter work with
15:28:08dom96kulelu88: Isn't the forum already a good enough example app?
15:28:31kulelu88dom96: not really. there needs to be a simpler tutorial using basic crud workflow
15:28:46kulelu88a forum is a big application with lots going on
15:28:55*mhi^ left #nim (#nim)
15:29:36*ddl_smurf quit (Quit: ddl_smurf)
15:29:39*jholland joined #nim
15:30:09dom96sure
15:30:22*aboisvert joined #nim
15:31:48kulelu88but if you're busy your studies should take priority, not some silly webapp :P
15:38:22*superfunc quit (Ping timeout: 246 seconds)
15:41:00*vendethiel joined #nim
15:45:51*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
15:49:42HakanD_def-: your article at front page of HN again \o/
15:53:02*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:53:35*aboisvert quit (Quit: aboisvert)
15:54:56*ingsoc quit (Quit: Leaving.)
16:00:12*aboisvert joined #nim
16:06:04*vendethiel quit (Ping timeout: 245 seconds)
16:09:48*OnO joined #nim
16:10:34*ddl_smurf joined #nim
16:11:25Araqplease test: http://nim-lang.org/download/nim-0.11.2_x32.exe
16:11:33Araqplease test: http://nim-lang.org/download/nim-0.11.2_x64.exe
16:11:47Araqplease test: http://nim-lang.org/download/nim-0.11.2.zip
16:13:28Araqbbs
16:15:14*UberLambda joined #nim
16:19:18Jehan_Araq: Doesn't build for me.
16:19:48Jehan_Well, the initial build.sh run works, but "bin/nim cc koch.nim" does the following:
16:20:03Jehan_Eh, ./koch boot -d:release
16:20:06Jehan_compiler/sem.nim(19, 43) Error: cannot open 'plugins/active'
16:20:10BlaXpirittry update csources
16:20:39BlaXpiritAraq, all my code works. regression fixed.
16:20:59Jehan_BlaXpirit: That's directly from the nim.zip that Araq wanted tested.
16:21:14Jehan_So, updating csources is sort of beside the point.
16:21:14BlaXpiritoh...
16:21:25BlaXpirityeah, i just checkout devel :/
16:23:18Jehan_BlaXpirit: So do I normally. :)
16:23:36*ddl_smurf quit (Quit: ddl_smurf)
16:25:01BlaXpiriti thought build.sh is all that's needed
16:25:43Jehan_Ah, it looks like the plugins directory is simply not included in the zip file.
16:26:25Jehan_BlaXpirit: Yeah, that gets the compiler running, but I wanted to test it, and tried to do that by having it build itself.
16:26:37*solidsnack joined #nim
16:27:02BlaXpiritso... the compiler can't build itself but will work anyway?
16:27:43BlaXpiritnim from archive works well
16:28:35Jehan_BlaXpirit: Yeah, because part of the compiler sources are missing.
16:32:11Jehan_It's nice how fast a codebase can progress when the author can actually work fulltime on it. :)
16:33:16*solidsnack quit (Ping timeout: 255 seconds)
16:33:55*vendethiel joined #nim
16:37:32gyeatesq
16:37:56*gsingh93 quit (Ping timeout: 264 seconds)
16:39:59OnwardEulerhaha are we getting a new release already?
16:40:26BlaXpirityes
16:40:44OnwardEulersweet =)
16:45:43*DKordic left #nim ("ERC Version 5.3 (IRC client for Emacs)")
16:56:00*BitPuffin|osx quit (Ping timeout: 252 seconds)
16:57:16*dalarmmst quit (Ping timeout: 240 seconds)
16:57:20*solidsnack joined #nim
17:02:09def-Araq: runs fine for me, but some tests fail because of missing files still, for example tests/testdata/jsontest.json
17:02:38ldleworkWhy new release?
17:03:06def-ldlework: 0.11.0 broke existing code with a risky change
17:03:20ldleworkouch
17:05:22OnOhelp pls, why: macro where(T: typedesc[Model]): stmt {.immediate.} = accepts any type as 1st param, not only Model and subclasses?
17:05:38OnOif I remove {.immediate.} then it behaves as desired
17:06:22ldleworkOnO: that's what immediate means
17:07:12ldleworkOnO: immediate macros are applied lexically. it doesn't know what the type of the thing you're passing to your macro is.
17:08:01OnOI would expect that only for expr/stmt arguments, NOT all arguments
17:08:07OnOit does not make sense
17:08:57OnOacutally I have: macro where(T: typedesc[Model], st: expr): stmt {.immediate.} =
17:09:29fowlImmediate is getting removed
17:09:30OnOI want it match Model.where(any non-evaluated expression)
17:09:32ldleworkOnO: there's no typing involved in an immediate macro
17:09:35ldleworkfowl: woah really?
17:09:43fowlYea
17:09:48ldleworkwhy?
17:09:58fowlYou'll use expr/untyped insteas
17:10:36OnOldlework: again, I understand {.immediate.} can apply to stmt/expr aguments, but no reason it should apply to all
17:10:51ldleworkOnO: it applies to the entire macro
17:11:00ldleworkits a different type of macro application -all together-
17:11:26OnOldlework: okay, but does it make sense? I don't see any
17:12:23ldleworkOnO: immediate macros are lexical. If you can't write your macro only making lexical transformation, you need a non-immediate macro.
17:13:07ldleworkThat it supports syntax such as type classes is unfortunate, but it sounds like the whole thing is being removed from the language.
17:13:22*gsingh93 joined #nim
17:13:24OnOldlework: I understand that, but you are not trying to understand me.... immediate should apply only to stmt/expr arguments of macro/template, NOT all arguments
17:13:38ldleworkOnO: no
17:13:56ldleworka macro applied immediate *can't possible know* *any type information*
17:14:05ldleworkregardless of what kin of parameter is is.
17:14:08ldleworkit *can't* know
17:14:47ldleworkif I understand correctly, anyway.
17:15:47ldlework(its applied for type information is established by the compiler)
17:15:51ldleworkbefore*
17:15:57OnOldlework: sorry, but I completely don't follow that, how it can't know, compiler is just deciding if it is going to parse AST or not prior passing it to macro
17:16:19OnObut this makes sense only for stmt/expr arguments
17:16:37OnOwhy NOT parse argument of type typedesc[Model] !?
17:17:06BlaXpiritimmediate macros completely ignore types
17:17:45fowlOh well the idiot who wrote that part of the compiler couldn't figure it out and that's something we live with. Some excuse about not wanting the compiler to have to do a hundred passes
17:17:46ldleworkOnO: because that's what ________,.-> immediate <-.,________ means
17:18:26ldlework"Apply this macro, before any type information has been figured anywhere in the program, lexically, no questions asked."
17:18:29*fowl left #nim ("Leaving")
17:18:54BlaXpiritgood explanation
17:19:23*HakanD_ quit (Quit: Be back later ...)
17:19:37OnOokay, I understand that any argument to immediate macro is just NimNode and any type spec is silently ignored
17:20:13OnOthe problem I have is that cannot bind such a macro to certain type, becaue it is all or nothing
17:20:30BlaXpirityup
17:20:35OnO:(
17:21:00BlaXpiriti think this will be solved with changes mentioned by fowl
17:22:03BlaXpiritbut OnO, maybe you don't need different macros
17:22:25BlaXpiritdo you realize that you can put a big if/case around it all and...
17:22:49OnOI need: macro where(T: typedesc[Model], st: expr): stmt {.immediate.} = <- where T is parsed existing subtype of Model and st is non-parsed expression
17:23:01BlaXpiritwhy do you need it
17:23:23OnOto type User.where(@name = somename)
17:23:38OnOand know what was the 1st T type
17:23:49BlaXpiritriiight... making a global "where" macro that works for everything is not nice
17:23:53OnObecause where macro will eventually lead to constructing such object
17:24:15OnOBlaXpirit: that's right :)
17:24:18*JinShil quit (Quit: Konversation terminated!)
17:24:30OnOit is very very not nice ;)
17:24:39BlaXpiriti ran into this very recently
17:25:13OnOI think it should be the arguments annotated as {.immediate.} not whole macro
17:25:24OnOmacro where(T: typedesc[Model], st: expr {.immediate.}): stmt =
17:25:40OnOso st is unparsed, but everything else is
17:25:44BlaXpirit[:20:58] <BlaXpirit> i think this will be solved with changes mentioned by fowl
17:26:02BlaXpiritwho knows, it might even work already
17:26:30OnOoh... fowl can you elaborate this?
17:26:47OnOis this what "untyped" is for?
17:28:11BlaXpiriti have good news for u, OnO
17:28:35OnOyess.... it works with untyped
17:28:38OnOsweeeeet
17:28:41BlaXpiritOnO, https://bpaste.net/show/0b4084a32fc4
17:29:08OnOawesome.... {.immediate.} must die!
17:29:54ldleworkOnO: congrats!
17:30:11yglukhov_Hello. Can anyone help with vararg forwarding please? Details: http://forum.nim-lang.org/t/1186
17:31:11BlaXpirityglukhov_, varargs might not even work at all in templates
17:32:06BlaXpirityglukhov_, https://github.com/Araq/Nim/issues/1862
17:32:20BlaXpiritoh wait.. this is about immediate, sorry
17:33:19BlaXpiritbut how do you expect to pass an array of expressions???
17:35:09Jehan_OnO: Immediate will be deprecated eventually.
17:35:33BlaXpiriti dont know why everyone isn't talking about this "untyped"
17:36:07*filcuc joined #nim
17:36:08OnOhuh, I am almost there with compile type expr to SQL :)
17:36:19OnOI miss compile time toLower and toUpper for strings
17:36:57yglukhov_BlaXpirit, simplified my example.
17:37:35Jehan_yglukhov_: There's an outstanding issue with varargs[expr] for templates.
17:37:57Jehan_I'll have to look closer at it, but that might be it.
17:38:33BlaXpirityglukhov_, replied to simplified example
17:38:56*OnwardEuler quit (Ping timeout: 240 seconds)
17:42:30yglukhov_BlaXpirit, but that's not fair. I want to expand varargs so that $ will be called again on every argument, when passed to echo. But with your suggestion that's not the case, right?
17:42:53BlaXpiritjust call it yourself
17:43:08*posix4e joined #nim
17:43:28posix4eHowdy. I am new to nim. I am curious why I should consider nim vs rust
17:44:19BlaXpiritthere are enough such comparisons.
17:44:30posix4eI felt they only hit the surface
17:44:42posix4eWould it make sense to write an OS in nim?
17:44:52Jehan_Different goals, really.
17:44:55posix4eIs the runtime libc?
17:45:18Araqsomebody is doing just that. moved from Rust over to Nim for OS kernel development.
17:45:31Araqiirc he also blogged about it
17:45:31BlaXpirithttps://news.ycombinator.com/item?id=9049698
17:45:52Jehan_Nim attempts to bridge the gap between the expressiveness of a high-level language such as Python and the performance of a system-programming language such as C.
17:46:09BlaXpiritwhat
17:46:14BlaXpiritwhat language doesn't nowadays
17:46:30Jehan_BlaXpirit: Umm, plenty?
17:46:50Jehan_Rust aims more at being a more rigorous and disciplined alternative to C++.
17:47:47Jehan_BlaXpirit: Go, for example, aims for simplicity over expressiveness.
17:48:23posix4eJehan_: But go isn't really comparable to rust right? More java or python or something
17:48:49posix4earen't going to write a memory allocator in go
17:48:50Jehan_posix4e: Not really, either.
17:49:05Jehan_It's not like Rust, but it's not like Java or Python, either.
17:49:23BlaXpiritworst of both worlds
17:49:24Jehan_It's still meant for code that's pretty "close to the metal".
17:49:38Araqposix4e: iirc they rewrote their GC and memory allocator in Go
17:49:55posix4eAraq: I think it's still using libvc
17:49:56posix4elibc
17:50:24posix4eSo let's talk gc
17:50:30posix4eit seems as though there's a rt gc in nim
17:50:37posix4eI have no idea why no one else does that
17:50:44posix4esans azul
17:51:06Araqthere is also Jamaica and a couple of others
17:51:21posix4eWhat if i set the max pause time to 10ms
17:51:33Araqwhat if you don't?
17:51:35posix4eam i going to be trading a ton of perf?
17:51:40posix4eAraq: sorry two part question
17:54:45Araqposix4e: if the GC can put up with the number of allocations that you do, or rather the amount of garbage the mutator produces, there is no perf overhead
17:55:16Araqin fact, it's more like: there is no perf overhead, but if the time slice is too short, it starts to leak
17:55:46Araqwell not really "leak" but memory usage grows without boundary
17:55:57Araqand you either die with OOM
17:56:04Araqor you need to give it more time
17:56:09*gyeates quit (Ping timeout: 240 seconds)
17:56:30AraqJehan_: can you test the download again please?
17:56:42Jehan_Araq: Second.
17:57:04BlaXpiritwhen to expect git tag and merge to master?
17:57:08OnOokay I am getting closer, how do I convert typedesc into NimNode of nnkSym type?
17:57:24OnOnot found any proc for that in macros
17:57:34r-kunewNimNode()?
17:57:53Araqdepends on the details
17:58:40OnO#proc `typ=`*(n: NimNode, typ: typedesc) {.magic: "NSetType".} <- commented in macros
17:59:42OnOmacro where(T: typedesc[Model], st: untyped): stmt = newCall(newDotExpr(T, bindSym"execQuery"), newLit(genSQLQuery(T.repr, st, args)))
17:59:47Jehan_Araq: Hmm, still missing plugins/active
18:00:01Jehan_Eh, second.
18:00:05OnOhowever newDotExpr(T, bindSym"execQuery") is invalid, I need to turn T into NimNode
18:00:11Jehan_Download messed up, may have used the old zip file.
18:00:13OnObut no idea how
18:01:09*filcuc quit (Read error: No route to host)
18:01:23*filcuc joined #nim
18:02:32Jehan_Araq: Okay, compiler builds now.
18:02:34*filcuc quit (Remote host closed the connection)
18:02:48Jehan_And tests seem to be performing as before.
18:03:45*gsingh93 quit (Ping timeout: 240 seconds)
18:04:43OnOokie newIdentNode(T.repr) seems to work
18:06:48Jehan_Hmm, longish discussion about null references on HN.
18:06:54*dalarmmst joined #nim
18:10:54posix4eWell I have to admit I can't imagine times when i'd choose go over nim then. If for no other reason then the GC.
18:11:46Araqposix4e: well Go has a shared memory GC, Nim uses thread local heaps instead. there are plenty of different tradeoffs made in these languages
18:12:55posix4eAraq: that's very nice of you. It'll be interesting to see how go gc perf changes with a concurrent collector.
18:13:57Araqposix4e: well if Go becomes too good at one day, we'll likely grow a codegen for it ;-)
18:14:10posix4ethat's funny
18:14:27posix4eMaybe I should be thinking of nim as a meta code gen language
18:15:01posix4eI mean when I first heard about nim-> c I was all like "What's so special c++ did this for years" But perhaps i didn't get it
18:15:03*stefantalpalaru joined #nim
18:15:25*dalarmmst quit (Ping timeout: 255 seconds)
18:17:11*dalarmmst joined #nim
18:18:43stefantalpalaruHi! What's the best way to use Ident nodes as keys for a table? I need this for a macro that may be called from multiple modules and the idents may be procedures with the same name for which the string representation I get with $ is the same. The probmlem with using NimNode as key is that there's no defines hash proc for them.
18:19:57Araqstefantalpalaru: dunno, have you considered a different approach? I like to get away from these compileTime global vars which break modularity
18:20:09BlaXpiritstefantalpalaru, i think ident nodes don't carry any magical extra identification than the names themselves
18:20:19Araqand by different approach I mean staticExec plus static marshal calls
18:20:47BlaXpiritAraq, sometimes it is necessary to have state.....
18:21:27Araqalso you can get a different "name" for the proc via getType()
18:22:11BlaXpiritthis getType seems like the be-all-end-all
18:22:18stefantalpalaruI don't see how. I need to create and use a new var for each targeted function from 2 different macros that may be called in any order. My plan is to have a global (compile time) table with function idents as keys and these new gensymed variables as values.
18:23:32BlaXpiritAraq, are you seriously going to keep documentation at old version?
18:23:33*brson joined #nim
18:23:55BlaXpiritI only accidentally found out that it moved
18:24:56*dalarmmst quit (Ping timeout: 240 seconds)
18:25:27yglukhov_Another template related question. How do I do type matching here: https://gist.github.com/yglukhov/9a2a66074b67053a53da#file-gistfile1-nim-L6-L7
18:26:31BlaXpiritinb4 someone says that the answer here is also getType
18:26:51Araqyglukhov_: you can use 'T is seq' instead but it's futile, typetraits already exists and there is also macros.getType to get real type inspection facilities
18:27:00BlaXpiritcalled it
18:27:52*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:29:27stefantalpalaruI was looking at nim-lang.org/macros.html instead of nim-lang.org/0.11.0/macros.html and didn't find what getType. Not cool.
18:30:03BlaXpiritthat's what i said too
18:30:08Araqfunny that you say that, I'm removing the old stuff
18:30:27BlaXpirityou can't just 404 all of the links..........
18:30:43stefantalpalarudo a HTTP redirect instead
18:30:58BlaXpiritproblem is it's not so easy
18:31:08stefantalpalaruor point them to the most recent version
18:31:13BlaXpiritsome dynamic logic would be best
18:31:22BlaXpiritand it is definitely not an option to not have a link to latest docs
18:31:24Araqthey do point to the most recent version
18:31:37dom96there needs to be a nim-lang.org/latest/
18:31:43dom96and or better yet
18:31:47dom96nim-lang.org/docs/
18:31:49Araqdom96: I thought you did that?
18:31:50*gokr joined #nim
18:31:52dom96just put the docs there.
18:31:56dom96not yet
18:32:04Araq-.-
18:32:08dom96I think you should put docs in nim-lang.org/docs/
18:32:16Araqok
18:32:29stefantalpalaruthey don't point to the most recent version unless you just removed getType: http://nim-lang.org/macros.html#getType,NimNode
18:32:33BlaXpiritthat's all fine but what's going to happen to old links?
18:32:50dom96As far as I can see redirecting all those links is not trivial.
18:33:04BlaXpirit[:30:56] <BlaXpirit> problem is it's not so easy
18:33:05*gyeates joined #nim
18:33:43BlaXpiritwell if some dynamic logic can be applied, then in case of 404 under root, it can look inside 0.11.2 folder instead
18:33:55stefantalpalaruit's nginx, how hard can it be to write some redirection rules?
18:34:16thotypoushttp://nim-lang.org/0.11.0/documentation.html <-- fun, language manual points to /0.11.0/0.11.0/manual.html
18:34:24*aboisvert quit (Quit: aboisvert)
18:34:30*dalarmmst joined #nim
18:34:42BlaXpirituh, thotypous, i don't think that address is supposed to be used
18:34:59*solidsnack joined #nim
18:35:14*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
18:35:15Araqthotypous: it's called a "relative" path
18:35:22dom96stefantalpalaru: There is a lot of docs.
18:35:35BlaXpirit[:33:41] <BlaXpirit> well if some dynamic logic can be applied, then in case of 404 under root, it can look inside 0.11.2 folder instead
18:35:40dom96Guess I can write a script to do it for me.
18:35:42def-dom96: make a script to make a rewrite rule for each? this should be a one-time thing i guess
18:35:53dom96yep
18:35:56BlaXpirit...............
18:36:12Araqgoogle should be smart enough to learn about the new structure within minutes
18:36:16def-and then google will be happy once they see that the pages moved and index the new ones
18:36:17*OnO joined #nim
18:36:41Araqgoogle only needs to follow the links properly ...
18:36:44def-Araq: maybe if you removed the old ones
18:36:46BlaXpiritok but could you not make hundreds of redirect rules?
18:36:57Araqthat's a bizarre webcrawler
18:36:59dom96perhaps we should just let Google figure it out.
18:37:02def-BlaXpirit: that sounds hacky, to try redirecting everything
18:37:42BlaXpiritso hundreds of redirect rules is the proper way now
18:38:51*gyeates quit (Ping timeout: 276 seconds)
18:39:45*posix4e left #nim (#nim)
18:39:45*aboisvert joined #nim
18:39:49*posix4e joined #nim
18:39:54flaviudef-: Your articles are always nice to read :)
18:39:58*posix4e left #nim (#nim)
18:40:04def-flaviu: Great to hear, thanks!
18:41:00antranigvdef-: yes, nice article (:
18:41:11*brson quit (Ping timeout: 256 seconds)
18:47:24*havenwood joined #nim
18:54:50gokrfilwit: Hehe, full war on hackernews ;)
18:56:43filwitgokr: haha
18:57:19filwitgokr: i wasn't trying to start a ton of discussions, but now I've spent a couple hours just responding to everyone..
18:57:22gokrFunny that... every article about Nim ends up discussing nil and Rust's memory model.
18:57:29gokrYeah
18:58:44filwitwell it's the main significant practical difference between these two up-n-coming systems languages.. makes sense it's the hot topic
19:01:54*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:02:04antranigvI hate when people start compairing languages.
19:03:34filwitit's an unavoidable consequence of our pattern seeking minds... on the plus side, that same ability allows us to write these languages in the first place :)
19:04:47Araqbbl
19:05:48*Matthias247 joined #nim
19:06:22OnOokie macro implementation of expr to SQL works now like a charm, thanks for great "untyped" type: https://github.com/nanoant/nim-orm/blob/master/orm.nim
19:07:05ldleworknice
19:07:22ldleworkOnO: working on an ORM?
19:08:00OnOyup, something like Ruby's but most work to be done on compile time
19:08:09OnOand lazy evaluation if possible
19:08:16flaviuhttp://goo.gl/forms/W9XDgby8a4 < quick 5 second poll about API syntax.
19:09:46filwitflaviu: can't decide between #2 and #5..
19:10:27flaviufilwit: I can't help you there, #2 and #5 are different for everyone :)
19:10:48flaviuI was hoping that would prevent bias from people choosing options closer to the top.
19:11:30filwitwell i certainly don't like the other ones.. if that's any help.. maybe i'll write that in 'other'
19:11:48*gsingh93 joined #nim
19:11:58flaviuSounds good to me.
19:12:02BlaXpiritthe problem with this poll is people don't see any merit at all in a few of the options
19:12:18BlaXpiritbut there is a reason for them to be like this. the "anycrlf" part is rare
19:12:34BlaXpiritand some of the options are just consistent with PCRE's syntax
19:12:53BlaXpirit(?i) can appear in the middle of the string
19:13:05BlaXpiritand (*ANYCRLF) is a syntax that is already supported by PCRE
19:13:46BlaXpiritand (?i) too
19:15:02flaviufilwit: My point was that I don't know which answers #2 and #5 are. Everyone has a different #2 and #5.
19:15:40*BitPuffin|osx joined #nim
19:15:41filwitoh crap, lol.. then you really wont understand what I wrote in the 'other' box...
19:15:48flaviuyep.
19:16:11filwitre(r"..", "..") and re"..".opts".."
19:16:39flaviuI've fixed it.
19:16:44filwit^ those where my choices.. other's where really obscure and left me wondering what the actually expr was doing
19:17:22flaviuWell, responses have tapered off a bit. https://docs.google.com/spreadsheets/d/1y_Co5OV3MIkH9l4MFe-F9-ouB9gIhP8aixGz3yy8pqk/edit?usp=sharing if anyone is interested.
19:17:57flaviuIf you're going to answer the poll, I'd appreciate it if you don't click that link until afterwards to avoid bias.
19:18:16*gsingh93 quit (Ping timeout: 240 seconds)
19:20:37*iamd3vil joined #nim
19:21:41stefantalpalaruWhat's the best way to insert NimNodes before the top level node passed to a statement macro? Would it be a problem if I create a new StmtList, make the previous top node a child and return that?
19:22:01BlaXpiritstefantalpalaru, that last part is good
19:22:06stefantalpalaruok
19:22:11BlaXpiriti'm pretty sure
19:22:55OnOis it possible to inject some module into other module? or pass a parameter to some module?
19:23:00*mischanix joined #nim
19:23:09BlaXpirityou wish
19:23:48*mischanix quit (Client Quit)
19:23:52BlaXpirit there is no way to pass settings to modules, the only way is to pass compiler flags
19:24:03BlaXpiritand inject... isn't that just include?
19:24:40BlaXpiritoh you mean it in the context of configuring it
19:28:41*mischanix joined #nim
19:44:41*gsingh93 joined #nim
19:44:49*iamd3vil quit (Ping timeout: 264 seconds)
19:49:09flaviuCan someone with access to the website add a symlink from /latest/ to whatever the latest release is?
19:50:40*brson joined #nim
19:51:54flaviuAlso, what exception do I throw for a NPE?
19:52:32BlaXpiritfor a what
19:53:34flaviuWell, I need to throw an exception if I get a null parameter.
19:57:41*gsingh93 quit (Ping timeout: 256 seconds)
19:57:53*mpthrapp quit (Remote host closed the connection)
20:00:47*posix4e joined #nim
20:01:10posix4eAraq: so nim's gc is conservative-ish?
20:02:03stefantalpalaruwhy am I getting a linking error from the tables module? nimcache/tables.o: In function `HEX24_77242': tables.c:(.text+0x592): undefined reference to `HEX24_51813'
20:02:12*mpthrapp joined #nim
20:03:08def-stefantalpalaru: strange, works here. tried removing nimcache?
20:03:14BlaXpiritthat might just be a compiler bug
20:03:36stefantalpalaruyes, I removed nimcache
20:08:59flaviuAccessViolationError is basically a NPE, right? ;)
20:10:19flaviuHmm, InternalError would also be nice.
20:12:59*BitPuffin|osx quit (Ping timeout: 256 seconds)
20:13:16*repax_ joined #nim
20:15:04*repax quit (Ping timeout: 246 seconds)
20:16:08dalarmmstIs it not possible to compare uints?
20:16:19def-dalarmmst: import unsigned
20:16:49dalarmmstThanks
20:16:58dalarmmstWhere do I find this info?
20:17:06*mpthrapp quit (Remote host closed the connection)
20:17:07dalarmmstI'm reading the nim tutorials
20:17:18dalarmmstBut I didn't see it there. Maybe I missed it
20:17:44stefantalpalaruI found the cause of the error. I was printing an empty table at compile time with unstringifiable values. This worked, printing {:} but apparently generated that undefined function.
20:18:49def-dalarmmst: Looks like it's missing in the tutorial. I'm suggesting to make unsigned operations available by default because everyone runs into this problem at some point
20:19:02dalarmmstI agree
20:19:45OnOdoing newNimNode(nnkCall) with .add(newIdentNode("fetch")), if fetch is a proc then it works, if fetch is an interator I get Error: undeclared identifier: 'fetch'
20:19:50stefantalpalaruand deprive Nim users from finding out about Araq's strong dislike of unsigned integers? :-)
20:19:59OnOhow to return an iterator from macro?
20:20:33*mpthrapp joined #nim
20:22:06*Jehan_ quit (Quit: Leaving)
20:22:48BlaXpiritOnO, yeah, calling an iterator is indeed invalid
20:23:25BlaXpirita normal iterator can only be used in the context of a `for`
20:23:38BlaXpiritnot sure if that means it's impossible to return from a macro
20:23:39OnOokie so: for u in macro(....): echo u <- how do I return iterator in macro?
20:24:09OnOtrying to do a call in macro, but it does not work
20:24:16*CARAM__ quit (Ping timeout: 265 seconds)
20:24:30OnOI guess iterator has different AST, but what ? :)
20:25:30*CARAM__ joined #nim
20:25:32BlaXpirit appears it doesn't have different ast
20:27:33OnOhmm... but it is not a nnkCall
20:29:40BlaXpirityeah, it definitely doesn't work, and I don't see a way to make it work
20:29:48BlaXpiritmaybe i can suggest some alternatives
20:30:45*vikaton quit (Read error: Connection reset by peer)
20:30:45*NhanH quit (Read error: Connection reset by peer)
20:30:47*CARAM__ quit (Read error: Connection reset by peer)
20:31:01BlaXpiritmaybe you can settle for returning just the iterator without calling it in advance
20:31:16BlaXpiritmaybe you can use a closure iterator, no need to shy away from them
20:32:22flaviuHmm, how about some sort of InvalidUnicodeError?
20:32:55*Kingsquee joined #nim
20:33:28*NhanH joined #nim
20:33:38*CARAM__ joined #nim
20:34:00flaviuI'm not sure that belongs in nre, it might be better in the unicode module.
20:34:53BlaXpiritstandard library never checks for invalid unicode
20:36:00*zahary joined #nim
20:36:29*vikaton joined #nim
20:36:47*Kingsquee quit (Client Quit)
20:36:48flaviuI know, but I don't want there to be two different unicode exceptions.
20:40:17*vikaton quit (Client Quit)
20:40:30*vikaton joined #nim
20:41:19*aboisvert quit (Quit: aboisvert)
20:42:10*aboisvert joined #nim
20:44:54*gsingh93 joined #nim
20:45:15*UberLambda quit (Quit: Leaving)
20:49:59BlaXpiritdom96, 0.11.2 tags to devel, master is not updated
20:50:46Araqflaviu: if you do if x.isNil: raiseNilException() you're doing it wrong
20:51:03flaviuAraq: I know, but PCRE does it for me.
20:51:26Araqah ok
20:51:26flaviu"PCRE_ERROR_NULL" on man pcreapi.
20:51:55Araqdoes it do PCRE_ACCESS_VIOLATION too? ;-)
20:52:08*ddl_smurf joined #nim
20:52:09AraqPCRE_INVALID_POINTER
20:52:39BlaXpiritgoogle now sends to 404. just great.
20:52:46flaviuWell, PCRE_ERROR_BADMAGIC and PCRE_ERROR_UNKNOWN_OPCODE are other indications that a pointer is bad.
20:53:41BlaXpiritplease someone make redirects from /system.html etc
20:55:27BlaXpiriteven for me here http://blaxpirit.github.io/nim-random/random.html the links broke
20:55:37BlaXpirit(imports section links)
21:00:12*mpthrapp quit (Remote host closed the connection)
21:01:13dalarmmstHow do I make a type T have it's data inlined in another type X? in C++ this would be struct X { T t; }, instead of struct X { T* t; }
21:02:38def-dalarmmst: just don't make it a ref type, then that happens in Nim
21:03:25dalarmmstNice, thanks!
21:04:29*solidsnack joined #nim
21:05:09*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
21:09:07*solidsnack quit (Ping timeout: 255 seconds)
21:13:50vikatondoes reem come here often?
21:15:21*jsudlow quit (Remote host closed the connection)
21:15:23Araqvikaton: why is that an important question?
21:15:45vikatonAraq: it isnt, I havent seen him and wanted to talk to him
21:18:19*OnO joined #nim
21:28:43*banister is now known as banisterfiend
21:32:35*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:35:45OnOFYI: https://github.com/Araq/Nim/issues/2656 iterators with vaargs arguments and {.closure.} cause invalid code :(
21:38:22BlaXpiritdamn
21:40:19*biz joined #nim
21:40:26bizhello
21:40:42*biz is now known as Guest91971
21:40:57BlaXpirithello
21:41:07*Guest91971 is now known as bizn
21:41:15biznbiz was registered :(
21:41:17biznwhat's up
21:41:48biznwell you see i came to irc to ask for a bit of help
21:41:56bizni need help communicating with skype api Skype4Com
21:42:01biznzero idea where to start
21:42:14BlaXpirituh i think they're gonna remove it
21:42:29biznso useless to mess with?
21:42:36biznwill be outdated in a month~ i assume
21:42:37bizn?
21:43:13*zahary quit (Quit: Leaving.)
21:43:57BlaXpirithmm skype api was supposed to be killed 1.5 years ago...
21:44:03biznlmfao
21:44:14biznwhat's with all the current skype bots?
21:44:18biznmanual possibly?
21:44:22*zahary joined #nim
21:44:26biznclownfish still works and that's one of the main ones
21:51:28*Kingsquee joined #nim
21:53:16*vendethiel quit (Ping timeout: 240 seconds)
21:54:50*milosn quit (Ping timeout: 256 seconds)
21:58:05*bizn quit (Quit: Page closed)
21:59:14*Senketsu quit (Quit: Leaving)
21:59:57stefantalpalaruis there any way to get "ref T" from an instance y of T without doing "var x: ref T; new(x); x[] = y" ?
22:01:36flaviustefantalpalaru: Of course! Pull that code into a procedure!
22:01:37flaviuhttps://gist.github.com/1ae1d7deac4c57d0a84c
22:02:26stefantalpalaruI meant without the copying step
22:03:48stefantalpalarusomething simple like getting a ptr with addr. don't we have something like that for refs?
22:04:11*BlaXpirit is now known as BlaXpirit_
22:04:14*BlaXpirit_ is now known as BlaXpirit
22:05:25def-Ha, with this I can get the binary 1 byte smaller: https://github.com/Araq/Nim/pull/2657
22:06:16*BlaXpirit quit (Remote host closed the connection)
22:06:34*BlaXpirit joined #nim
22:06:47*BlaXpirit quit (Client Quit)
22:07:01*wtw quit (Ping timeout: 264 seconds)
22:10:27flaviuIs the noReturn pragma really necessary?
22:11:43renesacw/o it your binary may be 1 bit bigger!
22:12:02*yglukhov_ quit (Quit: Be back later ...)
22:12:07renesacwell, I guess there is some use for it, as the three main compilers have some sort of support for it
22:12:21renesac*three main C compilers
22:13:23flaviuIf people want it, then they should use C.
22:13:47flaviuBecause if they get to the level where that sort of stuff is important, then they are effectively writing C in Nim anyway.
22:14:21renesacdon't araq always says that you can use Nim as a better C if you want?
22:14:22renesac:D
22:15:32def-flaviu: noreturn allows optimizations, even for totally normal code that just never returns. i don't see why we should have a noReturn pragma, but not pass that information to the C compiler
22:15:35renesachttp://stackoverflow.com/questions/10538291/what-is-the-point-of-the-noreturn-attribute
22:18:03flaviu"need not save and restore any volatile state around the call" - write it in assembly if a function call is too much overhead for you.
22:18:04flaviu"dead-code eliminate any code that would otherwise follow the call" - Too minor of an advantage.
22:18:17flaviuI'm sure that the compiler could infer that it'd never return from the code.
22:19:07renesacnot if it don't have the full source of the called code, and even then I'm not sure if it can be infered
22:19:56def-of course it can't infer that. Why would the compiler know whether a syscall kills your program (for example)
22:20:01renesacit is a pragma, an obscure pragma that most people don't need to know
22:20:39gokr"I'm sure that the compiler could infer that it'd never return from the code." - doesn't that sound like the stopping problem? :)
22:21:13gokrOr "Halting problem" I mean.
22:21:18flaviugokr: Sure, but methods tend to be short.
22:21:33flaviuAnd I'm assuming there is no non-local control flow like exceptions.
22:21:33*BitPuffin|osx joined #nim
22:23:04flaviuhttps://codesearch.debian.net/results/__attribute__((noreturn))/
22:23:11flaviuI'm not convinced noreturn is useful.
22:24:14flaviuIt seems that the only programs that have any mention of noreturn are development tooling, and that's not because they actually use noreturn.
22:24:26*yglukhov_ joined #nim
22:24:29*brson quit (Quit: leaving)
22:26:09renesacthe cost of keeping it in nim seems very low, even though the benefit may be low too
22:28:04renesacyou didn't search right
22:28:17renesachttps://codesearch.debian.net/results/noreturn/page_0
22:28:50*yglukhov_ quit (Ping timeout: 256 seconds)
22:28:58renesac2088 pages
22:29:32flaviuhmm, looks like everyone defines a macro for their noreturns.
22:29:48flaviufair enough then.
22:30:12def-flaviu: yeah, because it's not platform independent. same thing as I did in the PR. In C11 noreturn is finally in the standard
22:37:20*Jesin quit (Quit: Leaving)
22:44:19stefantalpalaruhow do I convince Nim do type convert every member of a tuple literal in an assignment? I get "Error: conversion from (int, int, nil) to f8_args_tuple is invalid" for a tuple defined as "type f8_args_tuple = tuple[a: int32, b: int64, c: pointer]". If I convert individually each of the members, it works.
22:46:53*Jesin joined #nim
22:51:14*Matthias247 quit (Read error: Connection reset by peer)
22:54:57*gsingh93 quit (Ping timeout: 240 seconds)
22:59:06*solidsnack joined #nim
22:59:43filwitstefantalpalaru: 'int' in Nim is a pointer size, and it does not implicitly convert to either int32 or int64 IIRC. So you'd need to pass (int32, int64, nil). So somethinglike (0'i32, 0'i64, nil)
23:00:43stefantalpalaruas the error says, I'm passing (int, int, nil) into a (int32, int64, pointer)
23:01:19stefantalpalaruthe compiler fails to automatically convert the first int to int32 and the second to int64
23:01:20filwitso (int32(a), int64(b), c)
23:02:08stefantalpalaruI know the workaround, but I'm working on a macro and it would make my life a lot easier if it would just convert each tuple member
23:03:15filwitthat isn't really a 'workaround'.. you have to explicitly convert an int -> int32/64.. however you can make this happen implicitly with a converter
23:05:47*Jesin quit (Quit: Leaving)
23:05:48filwitconverter toIntIntPtrTuple(t:tuple[a, b:int, c:pointer]): tuple[a:int32, b:int64, c:pointer] = (int32(a), int64(b), c)
23:07:26flaviuIsn't this basically a problem of contra/covariance?
23:08:29flaviuHmm, not really I guess.
23:09:37*gsingh93 joined #nim
23:10:46*aboisvert quit (Quit: aboisvert)
23:11:22*Trustable quit (Remote host closed the connection)
23:11:38stefantalpalaruI'm dealing with generic tuples
23:11:47*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
23:11:56filwityou can define a generic converter
23:12:23stefantalpalarufor any tuple with any number of members which have any combination of types?
23:12:35*aboisvert joined #nim
23:12:58filwiti doubt it.. but i also doubt you really want to do that
23:13:30filwitbut you could make a macro which did that
23:13:33stefantalpalaruI do. I keep proc parameters in hose tuples.
23:14:35stefantalpalaruI'm taking a generic proc and transforming it into a proc that takes a tuple ref cast into a pointer and in that tuple ref are the original parameters
23:16:11stefantalpalarucan I look inside a tuple and see its member types from a macro, given only the tuple ident?
23:16:26*asdf joined #nim
23:16:36filwitsounds like you want a macro or template. Note, you can run through tuple vars by index, someTuple[0]
23:16:54asdfhow can I get an ast of some code at runtime
23:18:47filwitasdf: const x = getAst someTemplateCall()
23:18:57filwitshould work i believe
23:19:00filwit'getAst' is in 'macros'
23:20:21filwitstefantalpalaru: you should be able to do what you want with macros, or maybe even directly inside your proc at runtime via tuple len/indexing.. either way, I can't much help without seeing more context, and I need to work on stuff now, sorry.
23:22:00asdfI need to do this at runtime though, as in read in a string that represents nim code and get its AST
23:24:18flaviuasdf: That's a *little* more complicated ;)
23:25:32asdfflaviu: haha I know, it doesn't need to be easy
23:25:44filwitasdf: if you mean read arbitrary strings at runtime (from actual runtime vars), you basically looking at using the compiler as a dependency (which is actually possible).. but yeah, it's not so straight forward, and unless you're writing a REPL, probably not needed.
23:26:16flaviuwell, if you want to parse nim code, then you have to link to the compiler like filwit says.
23:26:22filwitif you look at your problem though, you might find you just need to process string literals into Nim ast, which is much more straight forward.
23:26:25flaviusee compiler/parser, compiler/ast.
23:27:34asdfalright, in I go
23:29:24k1iany idea if/when a shared, GC'd heap will make its way into nim?
23:31:49*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)
23:31:51k1ibtw the nim manual is 404ing
23:31:51flaviuI don't think it'll happen, but there are assignment operators.
23:31:57flaviuhttp://nim-lang.org/0.11.0/manual.html#type-bound-operations-operator
23:32:04k1iah, nvm, relocated
23:32:42*solidsnack joined #nim
23:33:40*elbow_jason quit (Quit: Leaving)
23:34:36renesack1i: the boehm GC option collects shared memory
23:34:55renesacit seems
23:35:09k1iwithout boehm
23:36:43renesacmaybe sometime post 1.0?
23:36:47renesacdon't hold your breath
23:45:10*TEttinger joined #nim
23:45:27ldleworkhi asdf !
23:45:34*Jesin joined #nim
23:45:41ldleworkwait a minute.. you're not the asdf I know.
23:56:59asdfldlework: sorry to disappoint
23:58:34ldleworkasdf: the other asdf is happy to hear you exist
23:58:52ldleworkas a real person, rather than a forgotten registered nick
23:59:25*solidsnack quit (Quit: My Mac has gone to sleep. ZZZzzz…)