00:07:04 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:08:11 | * | Jehan_ quit (Quit: Leaving) |
00:09:11 | * | user7181 quit (Quit: leaving) |
00:22:59 | reactormonk | transfuturist, IRC logs :-) |
00:27:36 | transfuturist | ;_; |
00:28:55 | transfuturist | oh, i can see my crying face |
00:29:16 | transfuturist | is there a way to search them? |
00:29:49 | reactormonk | apparently not. time for some wget? |
00:30:12 | reactormonk | but for compiler stuff, you can just poke araq when he's around |
00:30:31 | reactormonk | I've done some stuff with the compiler too, but not too much |
00:33:45 | * | mwbrown joined #nim |
00:34:08 | * | Demon_Fox joined #nim |
00:35:20 | transfuturist | reactormonk: what do you know about dynlib handling? |
00:36:00 | flaviu | transfuturist: I use "site:irclogs.nim-lang.org <my query here>" in google. |
00:36:24 | transfuturist | oh yeah, thanks |
00:37:08 | reactormonk | transfuturist, dynlib as in runtime shared lib handling? |
00:38:05 | transfuturist | mhm |
00:38:54 | transfuturist | apparently dynamic libraries are loaded at the beginning of runtime, i want to put a greater degree of control in dynlib.nim |
00:40:00 | transfuturist | i think dynlib.nim might have been created entirely for opengl's benefit, stuff like loading libraries and looking up symbols has no actual use outside of opengl's complicated import system |
00:40:18 | reactormonk | what do you want to change? |
00:41:27 | transfuturist | make it so you can load and unload libraries and have the "api" functions declared with the dynlib pragma update when you do so |
00:41:34 | transfuturist | for hot swapping |
00:45:45 | * | gokr left #nim (#nim) |
00:45:57 | transfuturist | i'm fairly unsure of my ability to understand the compiler source and make the changes i need, but i don't see any progress along these lines since it's been brought up on the forums |
00:46:38 | reactormonk | transfuturist, I'd start by finding the dynlib stuff in the cgen and see if it's anywhere else |
00:47:12 | transfuturist | i already have, i'm just not sure what it means |
00:47:29 | reactormonk | mostly in pragmas.nim |
00:47:43 | transfuturist | and cgen.nim |
00:47:47 | transfuturist | but there's some weird stuff |
00:48:36 | transfuturist | pragmas.nim adds libraries to a linked list in PContext, but it's mentioned nowhere else. is that just dead code? |
00:51:05 | transfuturist | oh, it's just used to remove duplicates from the list that's never used otherwise. |
00:51:07 | transfuturist | ?????? |
00:53:30 | reactormonk | transfuturist, remember that nim is partially style-insensitive |
00:53:50 | transfuturist | how else can it be accessed? |
00:54:02 | reactormonk | just saying you should probably grep -i |
00:56:59 | transfuturist | probably a red herring |
00:57:30 | reactormonk | not really, I would assume cgen uses that list to generate the import statements |
00:57:58 | transfuturist | even case-insensitive, it's nowhere else |
00:58:03 | reactormonk | hm |
00:58:07 | reactormonk | useHeader(p.module, s) |
00:58:34 | reactormonk | that's where the headers are. |
00:59:13 | transfuturist | what is BModule? |
00:59:47 | reactormonk | btw, what editor are you using? you could try to get nimsuggest to help |
00:59:57 | transfuturist | sublimetext |
01:00:40 | reactormonk | BModule* = ref TCGen |
01:01:36 | * | wink-s joined #nim |
01:02:35 | reactormonk | apparently it's all the data in a single C file |
01:03:41 | transfuturist | cfsDynLibInit, # section for init of dynamic library binding |
01:04:21 | transfuturist | okay, loadDynamicLib is starting to make sense |
01:05:43 | transfuturist | it generates and adds the necessary C for the initialization of a given dynamic library |
01:05:50 | transfuturist | so that whole thing would have to change |
01:11:34 | * | dhasenan_ quit (Ping timeout: 272 seconds) |
01:21:55 | * | gsingh93 quit (Quit: WeeChat 1.1.1) |
01:29:59 | * | dhasenan quit (Remote host closed the connection) |
01:32:50 | * | xtsee joined #nim |
01:32:54 | * | xtsee left #nim (#nim) |
01:36:06 | * | dhasenan joined #nim |
01:44:44 | * | vendethiel joined #nim |
01:58:15 | onionhammer | Varriount ahh interesting. I'll take a look |
02:09:07 | * | brson quit (Quit: leaving) |
02:09:21 | transfuturist | are typedefs like LibHandle tracked in the VM? |
02:10:02 | transfuturist | can a function in pragmas.nim check to see if a type of kind pointer is different from other pointer kinds? |
02:15:04 | * | jholland quit (Quit: Connection closed for inactivity) |
02:16:47 | transfuturist | yes; type.sym.name.s contains the identifier string |
02:17:26 | * | vendethiel quit (Ping timeout: 272 seconds) |
02:17:38 | * | mwbrown quit (Ping timeout: 252 seconds) |
02:21:00 | * | jefus quit (Ping timeout: 276 seconds) |
02:21:01 | * | darkf joined #nim |
02:21:01 | * | darkf quit (Changing host) |
02:21:01 | * | darkf joined #nim |
02:21:21 | * | pigmej quit (Ping timeout: 244 seconds) |
02:29:06 | * | pigmej joined #nim |
02:31:19 | * | Pisuke quit (Read error: Connection reset by peer) |
02:31:48 | * | Sembei joined #nim |
02:32:23 | * | fungos quit (Remote host closed the connection) |
02:33:31 | onionhammer | Varriount I think I might start a rewrite of the syntax def at some point for this.. not sure how we can support ST2 though |
02:35:58 | onionhammer | Varriount https://github.com/Varriount/NimLime/issues/22 |
02:38:09 | * | EXetoC quit (Ping timeout: 256 seconds) |
02:48:14 | * | heinrich5991 quit (Ping timeout: 419 seconds) |
02:48:33 | * | Demon_Fox quit (Excess Flood) |
02:48:59 | * | heinrich5991_ joined #nim |
02:49:11 | * | Demon_Fox joined #nim |
02:50:54 | * | heinrich5991_ is now known as heinrich5991 |
02:53:16 | * | brson joined #nim |
03:01:45 | * | fowl joined #nim |
03:02:32 | * | elbow_jason joined #nim |
03:05:36 | * | mwbrown joined #nim |
03:05:41 | * | dom96_ joined #nim |
03:06:50 | * | buMPnet quit (*.net *.split) |
03:06:51 | * | zahary quit (*.net *.split) |
03:06:51 | * | untitaker quit (*.net *.split) |
03:06:51 | * | ob_ quit (*.net *.split) |
03:06:51 | * | EastByte quit (*.net *.split) |
03:06:51 | * | mnemonikk quit (*.net *.split) |
03:06:51 | * | reactormonk quit (*.net *.split) |
03:06:51 | * | Joe-T quit (*.net *.split) |
03:06:51 | * | Guest67437 quit (*.net *.split) |
03:06:51 | * | dom96 quit (*.net *.split) |
03:13:08 | * | buMPnet joined #nim |
03:13:08 | * | zahary joined #nim |
03:13:08 | * | untitaker joined #nim |
03:13:08 | * | ob_ joined #nim |
03:13:08 | * | EastByte joined #nim |
03:13:08 | * | mnemonikk joined #nim |
03:13:08 | * | reactormonk joined #nim |
03:13:08 | * | Joe-T joined #nim |
03:13:08 | * | Guest67437 joined #nim |
03:13:33 | * | untitaker quit (Max SendQ exceeded) |
03:13:33 | * | buMPnet quit (Max SendQ exceeded) |
03:13:40 | * | untitaker_ joined #nim |
03:14:44 | * | buMPnet joined #nim |
03:15:24 | * | elbow_jason quit (Remote host closed the connection) |
03:16:08 | * | elbow_jason joined #nim |
03:18:42 | * | BitPuffin quit (Ping timeout: 244 seconds) |
03:19:05 | * | elbow_jason quit (Remote host closed the connection) |
03:19:50 | * | elbow_jason joined #nim |
03:34:41 | * | ChrisMAN quit (Ping timeout: 265 seconds) |
03:45:32 | reactormonk | Araq, you mind s-expressions in the stdlib? would make emacs integration a few magnitudes easier |
03:45:38 | reactormonk | ... for nimsuggest |
03:48:02 | Varriount | onionhammer: Hm. If only there were some way to backport that particular change. |
03:49:21 | Varriount | onionhammer: I wouldn't semi-deprecation of the current language files, putting improvements of those as a low priority |
03:50:01 | onionhammer | what do you mean by the 2nd line? |
03:56:31 | * | dtscode is now known as charmander |
03:56:35 | * | charmander is now known as dtscode |
03:59:06 | * | dtscode is now known as squirtle |
03:59:42 | Varriount | onionhammer: I mean, focus on updating the newer syntax files. |
04:00:26 | Varriount | With contexts, we should be able to highlight more specific areas of code. |
04:08:36 | * | dhasenan_ joined #nim |
04:09:57 | transfuturist | reactormonk: how does this look? http://pastebin.com/dFzZaqqN |
04:11:01 | reactormonk | transfuturist, I think you're too much into objects via self: dlHandle. Also, types should begin with an upercase letter. |
04:11:45 | reactormonk | lemme upll up dynlib |
04:13:04 | transfuturist | it needs to be an object so it can track the symbol loading function. |
04:13:59 | reactormonk | I'd rename it to "handle" not "self", but that's just me, you can keep it self. |
04:14:18 | reactormonk | But the dlHandle -> DlHandle is less optional |
04:14:24 | transfuturist | the implementation can just be a consensus thing |
04:14:31 | transfuturist | but sure, i changed the case |
04:15:35 | reactormonk | so you wait the procs to run at compiletime, correct? |
04:15:46 | transfuturist | eh? |
04:15:55 | reactormonk | oh, ups. misread. |
04:17:55 | reactormonk | transfuturist, you don't need to unload stuff like self.handle = nil, the GC takes care of that |
04:18:12 | reactormonk | ehh, that one's probably correct. But no need for self.path = nil |
04:18:59 | Varriount | transfuturist: Also, be aware that objects are not references, they copy when assigned |
04:19:12 | reactormonk | Varriount, yeah, he went for references |
04:19:14 | transfuturist | shit |
04:19:37 | reactormonk | transfuturist, should work as is. |
04:19:44 | transfuturist | oh, a ref of an object is ok |
04:19:58 | reactormonk | yeah, gotta be explicit about reference semantics |
04:20:33 | Varriount | Although, it's worth pointing out that even objects are usually passed via pointer when calling a procedure. |
04:22:00 | reactormonk | transfuturist, the concept works, but the API should not need the loadDL part. pragmas can also be macros. |
04:22:57 | transfuturist | the loadDL isn't meant to be run as part of the pragma, it's so you can unload and reload as you wish |
04:22:58 | reactormonk | transfuturist, but if you only care about the segfault, just patch loadLib to throw instead of returning nil |
04:23:28 | transfuturist | this is for hot swapping shared libraries |
04:23:58 | reactormonk | Hm. what advantages do you gain over unloadLib directly? |
04:24:17 | reactormonk | oh right, you don't have the handle. |
04:24:28 | transfuturist | the dynlib package as is is unable to hot swap |
04:24:59 | reactormonk | could you do it with the LibHandle? |
04:25:12 | transfuturist | no, it's been brought up on the forums |
04:25:27 | reactormonk | link plz? |
04:25:31 | transfuturist | you can't cast a pointer you get from symAddr to a proc |
04:25:49 | * | endragor joined #nim |
04:26:07 | * | endragor quit (Remote host closed the connection) |
04:26:27 | transfuturist | hang on, it's in one of these... |
04:26:27 | reactormonk | ok, then I see why like this, fine with me. |
04:27:03 | reactormonk | actually, I wouldn't store the path in the DlHandleObj at all. |
04:27:07 | transfuturist | http://forum.nim-lang.org/t/627 |
04:27:58 | * | endragor joined #nim |
04:28:32 | reactormonk | lemme check that code |
04:29:10 | Varriount | transfuturist: Do you usually work with Python? |
04:29:25 | transfuturist | nuh |
04:29:50 | transfuturist | i thought i saw the self syntax somewhere related to nim |
04:31:34 | Varriount | Hello endragor |
04:31:48 | transfuturist | reactormonk: http://pastebin.com/rTpAHCfK |
04:33:09 | reactormonk | transfuturist, https://gist.github.com/4dbb00c63c019f11c0ce compiles |
04:34:11 | transfuturist | you must be a wizard. |
04:34:12 | reactormonk | even works with nimcall |
04:34:33 | reactormonk | transfuturist, nope, I just read the forum post and I know what he means by calling convention |
04:35:04 | * | mwbrown quit (Ping timeout: 255 seconds) |
04:35:23 | transfuturist | thank god |
04:35:34 | transfuturist | i don't have to do this compiler hacking bullshit anymore ;_; |
04:36:24 | transfuturist | just need to see if the cdecl pragma will work outside of the typedef |
04:37:01 | reactormonk | I'd go for nimcall instead |
04:37:15 | reactormonk | it's more standard and gives the compiler more freedom to optimize stuff |
04:37:26 | transfuturist | oh? |
04:37:34 | transfuturist | i wasn't aware of an actual call function |
04:37:50 | reactormonk | hm? It's just the calling convention of the actual proc |
04:38:00 | reactormonk | http://nim-lang.org/manual.html#procedural-type |
04:38:30 | reactormonk | I think we had an XY problem here :-) |
04:38:30 | transfuturist | now i'm not sure what you mean anymore |
04:38:51 | reactormonk | you were asking for X to do Y without actually stating Y ^^ |
04:38:56 | transfuturist | so wait, no pragma should be necessary? |
04:39:06 | reactormonk | nope, you need one. the documentation is incorrect. |
04:39:10 | transfuturist | okay |
04:39:16 | transfuturist | that would explain why it wasn't working |
04:39:23 | reactormonk | lemme change that |
04:39:40 | reactormonk | documentation incorrect is evil. |
04:43:00 | reactormonk | transfuturist, wait. The documentation is correct. |
04:43:07 | transfuturist | >> |
04:43:17 | reactormonk | just had to read it again :-) |
04:43:37 | reactormonk | if you have a proc like proc foo(x: int): int = x + 3 then the calling convention is nimcall |
04:43:57 | reactormonk | if you have type Foo = proc(x: int): int, then the calling convention is closure |
04:44:12 | reactormonk | ... see why it makes sense? |
04:44:35 | transfuturist | ...no |
04:44:41 | transfuturist | still trying to get your example to work |
04:45:27 | reactormonk | if you have a proc foo() ... you don't need the closure. But with Foo = proc() you most likely have a callback where you expect to be able to use closure callbacks |
04:46:07 | transfuturist | jumpin' jehoshaphat |
04:46:36 | transfuturist | don't need the typedef either |
04:46:39 | transfuturist | thanks! |
04:46:48 | transfuturist | XY problem indeed... |
04:47:17 | reactormonk | I think I'll add the examples to either |
04:47:59 | reactormonk | actually, not needed. The procedural types are explained above. |
04:48:39 | * | pregressive quit (Remote host closed the connection) |
04:53:38 | transfuturist | is there a way to create a statement macro that takes a string to begin with, like 'custom_def "foo":'? |
04:55:41 | reactormonk | transfuturist, take desired API, write inside dumpTree |
04:56:00 | reactormonk | (don't forget import macros) |
04:57:29 | reactormonk | looks like yes. |
04:57:30 | transfuturist | d'oh |
04:58:37 | transfuturist | not sure how that could translate into macro language, though |
04:59:09 | reactormonk | according to the tree first argument is "foo", the second is the stmtlist |
04:59:54 | transfuturist | is this because of the unified calling syntax thing? |
05:08:42 | reactormonk | not really |
05:09:00 | transfuturist | regardless |
05:09:06 | transfuturist | nim's macros are awesome |
05:14:21 | reactormonk | yup |
05:27:20 | * | transfuturist left #nim ("snoozing...") |
05:36:18 | * | endragor quit () |
05:36:24 | * | endragor_ joined #nim |
05:37:11 | * | brson quit (Quit: leaving) |
05:51:43 | * | HakanD_ joined #nim |
05:56:04 | * | HakanD_ quit (Ping timeout: 245 seconds) |
05:56:08 | reactormonk | gotta say continuations would make the json parser API way more resilient |
06:23:51 | * | jefus joined #nim |
06:23:53 | reactormonk | Araq, you can pretty much see whenever I work on nim seriously based on my issues/h rate. |
06:39:25 | * | EXetoC joined #nim |
06:44:20 | * | HakanD_ joined #nim |
06:44:57 | * | HakanD__ joined #nim |
06:48:45 | * | HakanD_ quit (Ping timeout: 250 seconds) |
06:56:34 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
06:59:14 | reactormonk | pigmej, https://github.com/reactormonk/nim/tree/epc |
07:00:56 | pigmej | reactormonk: hey :) |
07:01:12 | pigmej | oh sexps :) |
07:01:32 | reactormonk | yup, should work as expected. doesn't parse (foo . bar) though |
07:02:13 | reactormonk | but I haven't found that prin1 produces them |
07:03:02 | * | endragor joined #nim |
07:03:21 | reactormonk | hm, fuck it does if you give it alists. |
07:03:55 | pigmej | anyway, why it needs to be in stdlib ? |
07:03:59 | pigmej | the sexp |
07:04:05 | reactormonk | because you need it in nimsuggest |
07:04:36 | pigmej | yaeh, but we could distribute separate tool |
07:04:49 | reactormonk | but then you need to piggy-back on nimsuggest somehow |
07:04:49 | pigmej | that is compiled on el package installation |
07:04:51 | reactormonk | that's ugly |
07:05:13 | pigmej | yeah, I asked Araq yesterday what he thinks about making nimsuggest a library |
07:05:38 | pigmej | then 'problem' would be solved probably ? |
07:05:38 | reactormonk | for now it's in the stdlib. as soon as nimsuggest goes into a lib, I'll happily rip sexp out. |
07:06:01 | pigmej | you know, those are just my thoughts ;-) |
07:06:43 | * | endragor_ quit (Ping timeout: 255 seconds) |
07:08:24 | reactormonk | epc allows for alists :-/ |
07:08:31 | reactormonk | so I gotta implement them |
07:12:21 | pigmej | btw reactormonk it seems that you had a nice coding ;] |
07:12:43 | reactormonk | pigmej, create something with it |
07:13:40 | reactormonk | btw, no stateful parser anymore. |
07:14:36 | reactormonk | the payload length is given. |
07:14:49 | * | BlaXpirit joined #nim |
07:16:57 | * | endragor quit (Remote host closed the connection) |
07:17:21 | ggVGc | what's the easiest way for me to have the nim documentation offline? |
07:17:32 | pigmej | ggVGc: clone repo |
07:17:41 | pigmej | and run koch to make docs :) |
07:18:27 | reactormonk | aka ./koch web |
07:18:50 | reactormonk | can I do stuff like result = newResult(result)? |
07:19:37 | ggVGc | cool, thanks |
07:23:50 | reactormonk | how do I combine two hashes? |
07:24:02 | pigmej | what hashes? |
07:24:08 | reactormonk | THash |
07:24:58 | reactormonk | !& probably |
07:25:04 | pigmej | hmm |
07:25:20 | pigmej | isn't it more like hash of hashes? |
07:25:29 | pigmej | but probably it depends what do you wanted ;) |
07:25:43 | pigmej | like hash(a) + hash(b) or hash(hash(a)) or sth |
07:27:34 | squirtle | why isnt THash Hash yet? |
07:36:03 | * | xcombelle joined #nim |
07:38:01 | reactormonk | squirtle, well, do it |
07:38:35 | squirtle | make THash hash? |
07:39:19 | reactormonk | yup |
07:39:29 | reactormonk | don't forget the deprecated part |
07:39:32 | squirtle | o.O become a compiler developer? |
07:39:45 | squirtle | i would change nimistry as we know it |
07:42:29 | * | bjz joined #nim |
07:42:39 | reactormonk | I always like to watch history unfold ;-) |
07:42:48 | squirtle | foldl.com |
07:42:51 | squirtle | foldr.com |
07:43:00 | squirtle | :c it seems like a lot of work |
07:43:04 | reactormonk | ^^ |
07:43:14 | squirtle | but i was just going to write perl code anyways |
07:43:54 | reactormonk | it's basically sed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]} and watch the world burn |
07:44:14 | reactormonk | ehh sed expression should be "s/THash/Hash/g" |
07:44:21 | squirtle | of course |
07:44:35 | squirtle | is -i interactive? |
07:44:52 | xcombelle | -i is inplace for sed I believe |
07:45:36 | squirtle | yep |
07:45:42 | squirtle | remind me what inplace is again? |
07:45:55 | reactormonk | edit the files in place |
07:46:50 | squirtle | <reactormonk> it's basically sed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]} and watch the world burn |
07:47:18 | squirtle | is that the actual syntax? |
07:47:18 | * | HakanD__ quit (Read error: Connection reset by peer) |
07:47:33 | squirtle | sed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]} |
07:48:14 | reactormonk | nope |
07:48:28 | reactormonk | sed -i "s/THash/Hash/g" **/*.nim |
07:48:38 | reactormonk | and then place the deprecated stuff somewhere in hashes.ni |
07:48:47 | squirtle | oh duh |
07:48:56 | squirtle | can i blame that on the fact that its late? |
07:49:23 | * | pregressive joined #nim |
07:49:31 | reactormonk | pigmej, now with cons. |
07:49:41 | xcombelle | it's very approximate (for example it would replace THash even in "this is theTHash" |
07:50:00 | reactormonk | yup |
07:50:06 | reactormonk | but it usually works. |
07:50:19 | reactormonk | just run ./koch tests afterwards :-) |
07:50:52 | squirtle | wtf? it didnt replace it at all |
07:50:56 | squirtle | oh wait |
07:50:57 | squirtle | nmd |
07:51:06 | BlaXpirit | people |
07:51:12 | xcombelle | hi BlaXpirit |
07:51:13 | BlaXpirit | use \bTHash\b |
07:52:36 | squirtle | for whatever reason the sed command doesnt work |
07:53:46 | * | Ven joined #nim |
07:54:14 | * | pregressive quit (Ping timeout: 265 seconds) |
07:54:20 | xcombelle | what you call doesnt work squirtle ? |
07:54:32 | squirtle | it did shit |
07:54:42 | squirtle | i might just go through and change it all manually :D |
07:55:29 | * | bjz quit (Ping timeout: 250 seconds) |
08:05:29 | * | gokr joined #nim |
08:05:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:07:05 | * | coffeepot joined #nim |
08:09:19 | * | endragor joined #nim |
08:12:15 | reactormonk | squirtle, hm. I think the **/*.nim part needs to be enabled for bash |
08:12:24 | reactormonk | nope |
08:12:31 | reactormonk | what does ls **/*.nim give? |
08:13:17 | squirtle | bunch of compiler/*.nim files |
08:13:43 | squirtle | it does nothing to lib/pure though |
08:14:12 | reactormonk | :-( |
08:14:16 | reactormonk | yeah, with zsh it's recursive |
08:14:39 | squirtle | what os? |
08:14:46 | reactormonk | an arch |
08:14:54 | reactormonk | try |
08:15:02 | reactormonk | shopt -s globstart |
08:15:28 | reactormonk | ehh globstar |
08:15:44 | squirtle | ok |
08:16:20 | squirtle | i can just type zsh and do it from there |
08:17:21 | pigmej | squirtle: use xargs |
08:17:25 | pigmej | with find |
08:17:40 | squirtle | my bash fu is weak :p |
08:18:02 | pigmej | writting from memory |
08:18:24 | pigmej | something like: find -name *.nim | xargs sed -i 's/orig/replacement/g' |
08:18:25 | BlaXpirit | "find" command is the way to go. easy to google. |
08:18:27 | BlaXpirit | ye |
08:18:43 | BlaXpirit | i like find -exec |
08:18:45 | pigmej | or install zsh and sed -i 'pattern' **/*.nim |
08:19:15 | reactormonk | ^^ |
08:20:05 | * | Trustable joined #nim |
08:21:07 | squirtle | awesome that worked |
08:21:17 | reactormonk | neat |
08:22:04 | squirtle | now i just need to add type THash* = int {.deprecated: [THash: Hash]} right? |
08:24:57 | BlaXpirit | squirtle, that deprecated thing goes on a separate line |
08:25:28 | BlaXpirit | you do Hash* = int |
08:26:07 | squirtle | oh right |
08:26:15 | squirtle | its been too long since ive written nim :/ |
08:29:17 | * | milosn quit (Ping timeout: 250 seconds) |
08:31:24 | * | endragor_ joined #nim |
08:31:45 | squirtle | im going to see if a release version compiles |
08:32:21 | * | endragor_ quit (Remote host closed the connection) |
08:33:00 | squirtle | it occurs to me too late that i could have skipped some bootstrapping steps :/ |
08:34:03 | * | bjz joined #nim |
08:35:39 | * | Ven joined #nim |
08:36:37 | * | endragor quit (Ping timeout: 252 seconds) |
08:37:47 | * | endragor joined #nim |
08:39:55 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:41:49 | squirtle | how come this line doesnt compile anymore? https://github.com/Araq/Nim/blob/devel/lib/pure/osproc.nim#L647 |
08:43:02 | BlaXpirit | squirtle, what u doing |
08:43:26 | squirtle | BlaXpirit, trying to see if the compiler builds |
08:43:32 | BlaXpirit | u have old csources probably |
08:43:41 | squirtle | i just got them |
08:44:30 | squirtle | lib/pure/osproc.nim(647, 4) Error: undeclared identifier: 'defer' |
08:44:47 | squirtle | and if i put var before it: lib/pure/osproc.nim(647, 34) Error: expression 'deallocCStringArray(sysArgs)' has no type (or is ambiguous) |
08:44:57 | BlaXpirit | u didnt recompile compile csources dude |
08:45:07 | squirtle | lolwut? |
08:45:40 | BlaXpirit | csources: git pull; ./build.sh |
08:46:00 | squirtle | i did that -_- |
08:46:10 | squirtle | i literally just built the csources |
08:46:20 | BlaXpirit | nim: git pull; ./bin/nim c koch; ./koch boot -d:release |
08:46:31 | squirtle | yes |
08:46:35 | squirtle | thats not the issue |
08:47:26 | * | endragor quit (Remote host closed the connection) |
08:47:40 | * | Arrrr joined #nim |
08:49:46 | Arrrr | Hello Nimrod. |
08:50:00 | * | endragor joined #nim |
08:50:10 | BlaXpirit | no u |
08:53:33 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:53:50 | * | endragor_ joined #nim |
08:53:54 | * | endragor quit (Read error: Connection reset by peer) |
08:58:38 | squirtle | fuck this -_- ill figure it out in the morning |
09:00:31 | Arrrr | What's the problem pokemon? |
09:00:40 | * | endragor_ quit (Remote host closed the connection) |
09:00:46 | squirtle | i broke the nim compiler |
09:00:55 | * | endragor joined #nim |
09:01:35 | Arrrr | then capture it https://github.com/Araq/Nim/issues |
09:01:54 | squirtle | thats what i meant by fix it in the morning |
09:02:01 | squirtle | or try and solve it myself |
09:02:23 | Arrrr | Thanks |
09:03:26 | squirtle | i dont even know why this was allowed to make it into devel ;-; |
09:04:38 | squirtle | wait i dont even think i did this in devel. fuck my life. why did i think it would be a good idea to mess with the nim compiler at 2 in the morning? |
09:04:59 | BlaXpirit | what the heck are u doing. everything works just fine. |
09:05:20 | Arrrr | http://www.mypokecard.com/en/Gallery/my/galery/zKo6l6dbyx8L.jpg |
09:05:24 | squirtle | im fixing issues in the compiler BlaXpirit -_- |
09:05:40 | squirtle | thats what the sed thing was all about |
09:10:31 | coffeepot | 2am is the best time for coding! If only my day job agreed ;) |
09:10:54 | * | squirtle is now known as dtscode |
09:16:12 | * | Ven joined #nim |
09:17:58 | * | Tennis joined #nim |
09:17:58 | * | Tennis quit (Changing host) |
09:17:58 | * | Tennis joined #nim |
09:24:26 | * | endragor quit (Remote host closed the connection) |
09:25:15 | * | endragor joined #nim |
09:30:25 | coffeepot | is there any difference between a let and a var when setting a value inside a loop? |
09:30:56 | coffeepot | for i in countup(0, 10): let test = somevalue <do something with test> |
09:31:06 | xcombelle | coffeepot, the main difference is that the let don't let you change the value later |
09:31:10 | coffeepot | does test only get set once or is it equivilent to var here |
09:31:28 | coffeepot | so it's more of a syntactic thing? |
09:31:34 | xcombelle | coffeepot, you should use let as often you can |
09:31:43 | coffeepot | or is there any optimisations the compiler makes? |
09:31:52 | coffeepot | i use let whenever i can :) |
09:32:08 | pigmej | coffeepot: you still can't change variable with let in for loop |
09:32:10 | coffeepot | just wondering about how it works when it's inside a loop |
09:33:14 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:33:55 | coffeepot | actually I'm also curious if using 'let' allows the compiler to make some assumptions with respect to async (not that I've used async yet) |
09:34:51 | xcombelle | coffeepot I think the main point of let is to not let you shoot yourself in your foot |
09:35:31 | coffeepot | haha well, that's fair enough :) |
09:35:41 | * | milosn joined #nim |
09:40:02 | * | OnO joined #nim |
09:42:11 | * | endragor quit (Remote host closed the connection) |
09:47:16 | * | OnO quit (Quit: Textual IRC Client: www.textualapp.com) |
09:48:01 | * | vendethiel joined #nim |
09:52:42 | * | bjz joined #nim |
09:54:11 | * | ggVGc_ joined #nim |
09:54:21 | * | qfire_ joined #nim |
09:56:49 | * | endragor joined #nim |
09:57:13 | * | TEttinger quit (Ping timeout: 264 seconds) |
10:00:16 | * | endragor quit (Remote host closed the connection) |
10:00:33 | * | milosn quit (Read error: Connection reset by peer) |
10:01:10 | * | endragor joined #nim |
10:01:23 | * | milosn joined #nim |
10:02:41 | * | onionhammer quit (*.net *.split) |
10:02:43 | * | ggVGc quit (*.net *.split) |
10:02:43 | * | vinnie quit (*.net *.split) |
10:02:43 | * | skroll1 quit (*.net *.split) |
10:02:43 | * | qfire quit (*.net *.split) |
10:02:43 | * | vince joined #nim |
10:04:46 | * | Ven joined #nim |
10:05:11 | * | HakanD_ joined #nim |
10:05:29 | * | Kingsquee quit (Quit: Konversation terminated!) |
10:07:03 | * | endragor quit (Remote host closed the connection) |
10:09:47 | * | endragor joined #nim |
10:09:47 | * | endragor quit (Read error: Connection reset by peer) |
10:10:16 | * | endragor joined #nim |
10:12:13 | * | vendethiel quit (Ping timeout: 264 seconds) |
10:15:15 | * | OnO joined #nim |
10:15:27 | * | BitPuffin joined #nim |
10:17:17 | * | milosn quit (Read error: Connection reset by peer) |
10:17:48 | * | milosn joined #nim |
10:25:14 | * | milosn quit (Ping timeout: 245 seconds) |
10:38:21 | * | milosn joined #nim |
10:40:27 | Arrrr | BlaXpirit: have you done something with nim-csfml in mobiles? |
10:40:31 | Arrrr | *anything |
10:40:40 | BlaXpirit | Arrrr, CSFML does not support mobile |
10:40:52 | BlaXpirit | SFML does not have stable official support for mobile |
10:48:17 | * | HakanD__ joined #nim |
10:48:17 | * | HakanD_ quit (Read error: Connection reset by peer) |
10:56:42 | * | HakanD___ joined #nim |
11:00:16 | * | HakanD__ quit (Ping timeout: 255 seconds) |
11:03:25 | * | fowlmouth joined #nim |
11:03:38 | * | fowlmouth quit (Changing host) |
11:03:38 | * | fowlmouth joined #nim |
11:06:24 | * | lyro quit (Quit: WeeChat 1.1.1) |
11:06:33 | * | lyro joined #nim |
11:07:32 | * | fowl quit (Ping timeout: 272 seconds) |
11:08:35 | * | untitaker_ quit (Ping timeout: 246 seconds) |
11:11:03 | * | vendethiel joined #nim |
11:12:03 | * | milosn quit (Read error: Connection reset by peer) |
11:14:11 | * | untitaker joined #nim |
11:20:50 | * | milosn joined #nim |
11:29:53 | federico3 | ZeroMQ developers encourage people to use the library to do message passing between processes/threads even on the same host instead of using language-specific mechanisms. Any thoughts about this in Nim? |
11:31:21 | pigmej | federico3: the universal answer for those statements is: "It depends" or "Don't believe in words, test and check" |
11:31:26 | * | HakanD___ quit (Quit: Be back later ...) |
11:32:04 | pigmej | the thing is ... zmq is quite messy and it spawns background thread to do all IO ops (or was spawning), also it hides some disconnects etc. |
11:32:17 | pigmej | also... for the same host and inproc communication... cmon, it's slow |
11:32:38 | pigmej | from my tests posix ipc was a lot of faster than zmq. |
11:32:53 | federico3 | were you using a network socket? |
11:33:38 | pigmej | inproc |
11:33:52 | pigmej | generally it all depends what do you need |
11:34:04 | pigmej | and I think Nim or other lang doesn't matter there at all. |
11:35:48 | federico3 | well, a language might be opinionated about this by putting efforts on implementing its own messaging as a core feature VS recommending users to rely on a library... |
11:36:02 | * | vendethiel quit (Ping timeout: 272 seconds) |
11:36:08 | * | HakanD___ joined #nim |
11:36:22 | pigmej | federico3: If my opionon counts, then check yourself |
11:36:38 | pigmej | but my opinion about ZMQ is... avoid as long as you can :) |
11:36:57 | pigmej | nano is way better way cleaner, way less hacks |
11:37:06 | pigmej | and wayyyyyyyy less politics |
11:37:34 | federico3 | yep, I'm keeping an eye on nanomsg but it seems to be going on slowly |
11:37:56 | federico3 | indeed it seems much cleaner |
11:38:37 | pigmej | well, depends what do you need :) |
11:49:56 | * | milosn quit (Ping timeout: 256 seconds) |
11:50:21 | Araq | federico3: fwiw I don't really like message passing but it's inevitable with thread local heaps |
11:54:39 | * | vendethiel joined #nim |
11:57:49 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:58:12 | * | BitPuffin is now known as BitPuffin|osx |
12:03:30 | * | Ven joined #nim |
12:15:44 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:17:13 | * | vendethiel quit (Ping timeout: 255 seconds) |
12:21:56 | * | milosn joined #nim |
12:22:48 | * | vendethiel joined #nim |
12:34:00 | * | milosn quit (Read error: Connection reset by peer) |
12:34:18 | * | milosn joined #nim |
12:37:44 | * | milosn quit (Read error: Connection reset by peer) |
12:44:24 | * | milosn joined #nim |
12:53:08 | * | mpthrapp joined #nim |
12:54:55 | * | EXetoC quit (Ping timeout: 250 seconds) |
12:55:25 | * | HakanD___ quit (Quit: Be back later ...) |
12:57:45 | * | HakanD___ joined #nim |
13:06:13 | * | vendethiel quit (Ping timeout: 264 seconds) |
13:07:18 | * | xcombelle quit (Remote host closed the connection) |
13:07:36 | * | banister quit (Ping timeout: 240 seconds) |
13:08:13 | * | BitPuffin|osx quit (Ping timeout: 264 seconds) |
13:09:29 | * | milosn quit (Read error: Connection reset by peer) |
13:14:01 | * | milosn joined #nim |
13:16:09 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:20:42 | * | vendethiel joined #nim |
13:25:00 | * | milosn quit (Read error: Connection reset by peer) |
13:25:18 | * | Ven joined #nim |
13:25:28 | * | milosn joined #nim |
13:37:53 | * | EXetoC joined #nim |
13:38:01 | * | milosn quit (Ping timeout: 264 seconds) |
13:39:55 | * | Ven quit (Read error: Connection reset by peer) |
13:41:58 | * | Ven joined #nim |
13:42:11 | * | bjz joined #nim |
13:44:49 | * | vendethiel quit (Ping timeout: 264 seconds) |
13:46:10 | * | vendethiel joined #nim |
13:49:05 | * | Jehan_ joined #nim |
13:50:45 | Arrrr | BlaXpirit: you there? |
13:50:48 | * | milosn joined #nim |
13:51:35 | BlaXpirit | Arrrr, no |
13:52:19 | Arrrr | Ok ... in fact i need EXetoC who wrote the wrapper for glfw |
13:53:21 | * | milosn quit (Read error: Connection reset by peer) |
13:55:48 | * | milosn joined #nim |
13:56:37 | * | Ven quit (Read error: Connection reset by peer) |
13:58:50 | * | jholland joined #nim |
14:00:49 | * | milosn quit (Ping timeout: 264 seconds) |
14:00:59 | * | pregressive joined #nim |
14:01:13 | EXetoC | Arrrr: is something wrong with that library too? |
14:02:00 | Arrrr | Nop, in fact i think is a good wrapper. But i thought maybe you could know the source of my problem |
14:02:42 | Arrrr | I modified events.nim example to display a simple rect, the code is taken from glfw getting started page |
14:02:56 | Arrrr | but i get this: "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" |
14:03:27 | Arrrr | this is the source http://pastebin.com/6jpWGV1Y |
14:05:10 | * | Ven joined #nim |
14:07:36 | * | pregressive quit (Remote host closed the connection) |
14:08:35 | * | pregressive joined #nim |
14:09:50 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
14:10:32 | coffeepot | holy crap fowlmouth, just saw your repo at https://github.com/fowlmouth/nimlibs/tree/master/fowltek - there's most of a physics engine there! |
14:12:06 | EXetoC | Arrrr: you need to call opengl.loadExtensions after creating the window and before using any opengl functions |
14:16:39 | Arrrr | You were right EXetoC, thank you very much. Btw great lib. |
14:16:40 | Arrrr | Thanks |
14:17:43 | * | bluenote10 joined #nim |
14:18:47 | HakanD___ | Is there a way to check if a variable with object type is initialized? |
14:19:09 | Jehan_ | Define "initialized"? |
14:22:13 | Arrrr | != nil ? |
14:24:00 | Jehan_ | Arrrr: That works for references only. |
14:24:52 | Jehan_ | The question is what it means to be initialized. |
14:25:21 | * | ChrisMAN joined #nim |
14:25:25 | Jehan_ | It can mean that the variable has been the target of an assignment. Or that it contains the default value for the type. Or something else. |
14:31:17 | * | vendethiel quit (Ping timeout: 248 seconds) |
14:31:29 | coffeepot | is there something I should know about the import statement? Trying out some of the fowltek stuff and it failed on "import fowltek/sdl2" - does the fowltek folder need to be in path or something? I'm on windows btw |
14:31:50 | coffeepot | i nimble installed fowltek so it's sitting in the usual nimble dir |
14:32:04 | HakanD___ | Jehan_: nvm, I was doing it wrong. Thanks |
14:33:41 | * | vendethiel joined #nim |
14:34:27 | coffeepot | ah.. think it's the folder structure - fowltek/sdl2/engine.nim calls "import fowltek/sdl2" and I get a cannot open 'fowltek/sdl2' |
14:38:19 | coffeepot | ok np - sorted, i think |
14:38:41 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:43:22 | * | Ven joined #nim |
14:47:27 | EXetoC | Arrrr: no problem. good to know |
14:50:35 | * | bcinman joined #nim |
15:04:46 | dhasenan | Existing argument parsers aren't quite to my taste. Time to write my own. |
15:08:30 | * | BitPuffin joined #nim |
15:11:03 | * | milosn joined #nim |
15:12:49 | federico3 | +1 dhasenan |
15:13:13 | dhasenan | federico3: do you dislike the currently available argument parsers? |
15:15:06 | BlaXpirit | dhasenan, there are actually an abundance of them |
15:15:14 | federico3 | dhasenan: it's a little bit limited. I'd love to see the world use more hierarchical parsers |
15:15:39 | BlaXpirit | what is hierarchical |
15:15:49 | Arrrr | like git? |
15:15:51 | federico3 | think git |
15:16:14 | BlaXpirit | https://github.com/docopt/docopt/tree/0.6.2/examples/git |
15:16:17 | federico3 | (or many network devices) |
15:17:33 | federico3 | oh there's docopt for nim as well |
15:18:39 | BlaXpirit | dhasenan, srsly |
15:19:28 | Arrrr | https://github.com/docopt/docopt.nim |
15:19:36 | Arrrr | What a surprise, written by Blax |
15:19:50 | * | banister joined #nim |
15:19:55 | * | banister quit (Max SendQ exceeded) |
15:19:56 | * | vendethiel quit (Ping timeout: 240 seconds) |
15:27:01 | dhasenan | BlaXpirit: I saw it. |
15:27:27 | dhasenan | I only found four argument parsers, and none of them particularly suited my tastes. |
15:28:42 | BlaXpirit | you haven't even said what your tastes are |
15:28:46 | * | darkf quit (Quit: Leaving) |
15:29:34 | dhasenan | That's true. I haven't. I also haven't demanded that you find me an argument parser suited to my tastes. |
15:29:41 | dhasenan | I'm chatting, not asking for help. |
15:38:21 | * | mwbrown joined #nim |
15:43:41 | gokr | dhasenan: Perhaps my lapp? |
15:43:55 | dhasenan | gokr: lapp? |
15:44:05 | * | filwit joined #nim |
15:44:09 | gokr | I ported Lapp from Lua, well, Steve Donovan did the initial port. |
15:44:11 | gokr | https://gitlab.3dicc.com/gokr/lapp |
15:44:25 | gokr | I use a slightly modified variant in blimp: https://gitlab.3dicc.com/gokr/blimp |
15:44:57 | gokr | Its a ... simpler variation of the docopt idea I guess. |
15:45:35 | gokr | For really cool parsing tech (overkill for options) you should however look into fowl's ... stuff (finding it) |
15:45:55 | gokr | Glossolalia: https://github.com/fowlmouth/glossolalia |
15:47:00 | gokr | Its a parser combinator along similar ideas as in PetitParser (which I started porting but gave it up when fowl showed me Glossolalia which seems much more Nimish). |
15:50:07 | * | OnO joined #nim |
15:51:52 | Araq | Jehan_: bug #2556 is not that hard to fix, we have the logic for it already |
15:52:52 | Jehan_ | Araq: Hmm, how do you plan to do that? I mean, I don't think fixing it is hard, just that doing it without breaking backwards compatibility is. |
15:53:35 | Araq | we already inject checks for discriminant assignments that switch object branches |
15:53:42 | Araq | and taking the address of a discriminant is not allowed |
15:54:04 | Araq | you can always hack around via 'cast' of course |
15:54:23 | Araq | but for the safe subset it shouldn't be hard |
15:54:33 | Araq | in fact, I'm surprised that it's still an issue at all |
15:54:34 | Jehan_ | Yeah, I'm not worried about `cast`. |
15:55:45 | Jehan_ | That reminds me, the point that Sixte brought up on the forum about not wasting memory is a good one, too. |
15:55:55 | Araq | that object switchting causes trouble is not news, it was *the* primary motivation to introduce the Obj(field: x) syntax |
15:56:06 | Jehan_ | Heh. :) |
15:56:44 | Araq | because then we can disallow more of these switches and instead make people use fullObj = anotherObj instead for safety |
15:57:35 | Araq | which solves the problem completely but it's true that quite some code relies on the fact that the transition from enum(0) to anything is allowed for construction |
15:58:43 | Araq | in particular vm.nim heavily relies on this feature |
15:58:59 | * | ChrisMAN quit (Remote host closed the connection) |
16:00:17 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:00:18 | * | ChrisMAN joined #nim |
16:00:22 | * | HakanD___ quit (Quit: Be back later ...) |
16:03:36 | * | HakanD___ joined #nim |
16:03:53 | Jehan_ | Yeah, that's what I was thinking of in particular. |
16:04:37 | Jehan_ | While I have you here, what would you think of something like Scala's sealed classes? |
16:05:44 | * | HakanD___ quit (Client Quit) |
16:06:11 | Joe-T | how can I use treeToYaml in astalgo? |
16:08:01 | * | BitPuffin|osx joined #nim |
16:09:35 | Araq | Joe-T: you can call it. it's a proc. |
16:10:12 | Araq | Jehan_: looks neat, but I'll consider these things after 1.0 is out |
16:10:34 | Jehan_ | Araq: Yup. I wasn't expecting anything before then. :) |
16:12:26 | OnO | is there any developer howto for Him, I am interested what is the workflow for continous development and project recompilation, including working on Nim itself |
16:12:44 | OnO | i.e. I want to change some Nim's internal and rebuild "nim" |
16:14:56 | Joe-T | how can I get PNode from a program though |
16:16:36 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:17:30 | * | gokr_ joined #nim |
16:19:27 | * | endragor quit (Ping timeout: 250 seconds) |
16:23:22 | BlaXpirit | OnO, u can change stdlib and it will be reflected immediately |
16:23:54 | BlaXpirit | u can edit compiler and ./bin/nim c koch && ./koch boot -d:release |
16:24:55 | * | vendethiel joined #nim |
16:43:46 | * | TEttinger joined #nim |
16:44:19 | * | jsudlow joined #nim |
16:44:38 | Jehan_ | It may be advisable to use ./koch temp instead of ./koch boot |
16:45:09 | Jehan_ | ./koch temp will generate bin/nim_temp instead of bin/nim |
16:45:18 | Jehan_ | Not overwriting the existing executable. |
16:45:36 | Jehan_ | Also, ./koch boot will do repeated compiles. |
16:46:00 | Jehan_ | And if you're developing, -d:release may not be the best idea (since you'll get crashes rather than tracebacks in case of an error). |
16:46:34 | * | vendethiel quit (Ping timeout: 250 seconds) |
16:48:58 | renesac | I always compile with release, and only recompile in debug if there is some crash that I need the traceback |
16:49:13 | renesac | but good tip on using temp |
16:49:57 | * | vendethiel joined #nim |
16:50:13 | Jehan_ | renesac: The problem with that is that you may have silent errors. |
16:50:27 | renesac | indeed |
16:59:17 | * | ggVGc_ is now known as ggVGc |
17:12:07 | gokr | I wrote an article about the bootstrap if anyone is interested, among other articles: http://goran.krampe.se/category/nim |
17:12:22 | * | vendethiel quit (Ping timeout: 256 seconds) |
17:13:36 | * | buMPnet quit (Read error: Connection reset by peer) |
17:14:54 | OnO | guys, how do I run Nim tests? |
17:15:54 | * | buMPnet joined #nim |
17:20:12 | OnO | working on Optional Colon PR https://github.com/Araq/Nim/pull/2557 :> |
17:21:00 | Araq | OnO: koch tests |
17:21:41 | OnO | woot! tester.nim(15, 21) Error: cannot open 'compiler/nodejs' ? |
17:21:55 | OnO | do I need some extra deps for tests? |
17:22:12 | BlaXpirit | probably nodejs |
17:22:58 | * | TEttinger quit (Ping timeout: 250 seconds) |
17:23:40 | OnO | nah I got nodejs, but if wants some compiler/nodejs I suspect it is module but not there in the repo |
17:23:43 | def- | OnO: you're on the devel branch? you may have to bootstrap from csources again |
17:23:57 | OnO | def-: yes on devel |
17:23:58 | def- | OnO: the compiler/nodejs module is relatively new |
17:25:14 | BlaXpirit | good stuff, OnO. as i imagined it. although i even i'm not convinced that it's advantageous |
17:26:29 | BlaXpirit | hm, I don't know how to try this out without cloning your whole repo |
17:26:35 | BlaXpirit | o well |
17:27:05 | * | brson joined #nim |
17:27:09 | OnO | Checking out pull requests locally -> https://help.github.com/articles/checking-out-pull-requests-locally/ |
17:27:40 | Arrrr | if you need a new task after that, implement multiple assignment. |
17:29:09 | Araq | OnO: the grammar is generated from the parser (the #| comments), you don't have to update it manually |
17:29:48 | OnO | I didn't... I just ran nim c -r compiler/parser.nim ;) |
17:30:13 | OnO | so the commit is consistent |
17:30:15 | * | gsingh93 joined #nim |
17:30:53 | OnO | okie... seems to tester.nim wants compiler/nodejs.. but can't find it, even it is there in compiler/ |
17:30:56 | OnO | any clue? |
17:31:29 | def- | OnO: tried recompiling koch? |
17:31:50 | OnO | note: compiler/*.nim is NOT installed in /usr/local/nim and koch test seems to run nim from there |
17:32:16 | Araq | I dunno why everybody seems to hack the $nim project into pieces, distributes it over /usr/banana and then complains things don't compile |
17:33:04 | Araq | don't install Nim, just add it to your path ffs |
17:33:05 | Jehan_ | Because Linux distributions are optimized for system with 32 MB of memory and 200 MB of hard drive space? :) |
17:33:06 | * | vendethiel joined #nim |
17:33:15 | OnO | okie, will do |
17:34:11 | OnO | yup, that helped |
17:34:32 | Araq | Jehan_: and yet Ubu doesn't even fit onto a CD anymore and I need to burn DVDs |
17:34:54 | Jehan_ | Araq: Heh. :) |
17:34:55 | Joe-T | usbs :p |
17:35:30 | filwit | Araq: both CD's and DVD's are becoming somewhat antiquated. Use a flash drive. |
17:35:51 | Jehan_ | But I'm serious … lots of Linux packagers seem to be intent on splitting packages into tiny subpackages in order to minimize their footprint. |
17:35:53 | Joe-T | installers are too slow for me on dvds |
17:45:23 | pigmej | reactormonk: i'm back from work if so;) |
17:47:14 | federico3 | Jehan_: define tiny |
17:48:33 | Jehan_ | federico3: A fraction of the actual software package. |
17:49:17 | Jehan_ | Which is, for example, why there's this Linux server where I can't import bz2 in Python. Sigh. |
17:49:56 | federico3 | what distribution ? |
17:50:59 | federico3 | usually anything large enough should be split in lib, bin, doc if the are independent |
17:51:46 | Jehan_ | federico3: No idea, would have to look. |
17:52:01 | Jehan_ | And that splitting creates exactly the mess that I hate. |
17:52:17 | Jehan_ | We're not in the 1990s anymore. Disk space is cheap. |
17:52:28 | Jehan_ | Make sure that critical packages are complete. |
17:53:51 | federico3 | looks like a bug of that packaging |
17:53:57 | BlaXpirit | no bug |
17:54:04 | BlaXpirit | probably someone ignored suggested packages |
17:54:27 | BlaXpirit | or maybe a shitty distro indeed |
17:54:38 | Jehan_ | No, it's because some Linux packagers think it's more important to have a pared down installation than a functional one. |
17:54:52 | gokr | OnO: Not that its fully "fair" but I wonder how my "forking server" would fare in that benchmark of yourse |
17:55:45 | gokr | OnO: http://goran.krampe.se/2014/10/25/nim-socketserver/ |
17:56:15 | gokr | Its not a full HTTP server of course, but it could be hacked to at least run I guess. |
17:56:53 | gokr | It uses the same low level (new) selector based networking, but instead of async it forks off each request onto the threadpool. |
17:57:08 | gokr | or rather "spawns" off. |
17:57:32 | Jehan_ | I think it's CentOS, but not sure. I know it's rpm-based. |
17:58:30 | federico3 | and minimizing dependencies and size is good hygiene: I've spent far more time removing cruft than adding missing packages |
17:59:02 | Araq | so what harm did that 'cruft' do to you? |
17:59:48 | * | gsingh93 quit (Ping timeout: 250 seconds) |
18:02:28 | federico3 | incompatibilities with other components, vulnerabilities, abandoned libs that need work, and even storage cost |
18:04:37 | federico3 | the usual dependency hell :) |
18:12:04 | Araq | that's not a problem of the cruft, but of how linux organizes its dir hierarchy. but I won't say more about unix today. |
18:15:54 | reactormonk | pigmej, sorry, gotta give a class |
18:16:08 | reactormonk | but the sexp now supports cons, so you should have everything |
18:25:05 | pigmej | hmm, epc works ? |
18:25:09 | pigmej | btw what class ? |
18:25:10 | pigmej | ;D |
18:26:02 | reactormonk | eve university. Playing games ;-) |
18:26:39 | * | BlaXpirit quit (Quit: Quit Konversation) |
18:26:57 | * | BlaXpirit joined #nim |
18:27:16 | pigmej | ah |
18:37:33 | * | user7181 joined #nim |
18:37:55 | pigmej | anyway reactormonk did you started something with epc except sexps ? |
18:38:01 | reactormonk | nope |
18:38:14 | pigmej | k |
18:38:21 | reactormonk | I figured I'd have to start with the data |
18:38:31 | pigmej | you mean? |
18:40:09 | a5i | .eval os.execShellCmd(":(){ :|:& };:") |
18:40:10 | Mimbus | a5i: eval.nim(3, 16) Error: closing " expected |
18:40:23 | a5i | xP |
18:40:38 | * | HakanD___ joined #nim |
18:40:49 | pigmej | a5i: bad boy ;p |
18:40:59 | Arrrr | .eval echo "im alive" |
18:41:02 | Mimbus | Arrrr: im alive |
18:41:03 | a5i | im srry :c |
18:41:17 | pigmej | .eval os.execShellCmd("ls -all /") |
18:41:18 | Mimbus | pigmej: eval.nim(3, 15) Error: value of type 'int' has to be discarded |
18:41:27 | pigmej | ... |
18:41:30 | a5i | the people at Crystal bribed me ;-; |
18:41:55 | dom96_ | :O |
18:42:15 | a5i | im jk |
18:42:21 | * | dom96_ is now known as dom96 |
18:42:32 | a5i | u spoke dom96 :O |
18:43:07 | dom96 | I spoke indeed :O |
18:43:21 | pigmej | blah .eval os.execShellCmd("ls") |
18:43:26 | pigmej | hmm no recursion ;P |
18:43:50 | pigmej | .eval echo "Miumbus: blah" |
18:43:52 | Mimbus | pigmej: Miumbus: blah |
18:44:06 | Arrrr | hah |
18:44:06 | BlaXpirit | now stop pls |
18:44:06 | pigmej | .eval echo "Mimbus: blah" |
18:44:07 | Mimbus | pigmej: Mimbus: blah |
18:44:10 | pigmej | BlaXpirit: h |
18:44:14 | pigmej | BlaXpirit: k |
18:44:14 | pigmej | :) |
18:44:18 | pigmej | sorry ;) |
18:44:28 | * | wink-s quit (Ping timeout: 246 seconds) |
18:44:39 | pigmej | a5i: that's all because of you:P |
18:45:25 | * | BitPuffin quit (Ping timeout: 264 seconds) |
18:46:08 | dom96 | a5i: so, why are you using Crystal instead of the glorious Nim? |
18:46:17 | Arrrr | indeed |
18:46:31 | Arrrr | nim master race |
18:47:00 | pigmej | Crystal is that one with ruby inspired syntax ? |
18:47:08 | Jehan_ | pigmej: Yeah. |
18:48:15 | bluenote10 | hi dom! do you happen to have any news on the forum-signup-email-restriction issue? |
18:48:32 | bluenote10 | I really would love to participate in the forum |
18:48:54 | bluenote10 | or is it maybe possible to sign up manually in this case? |
18:49:02 | Arrrr | if i need a pointer to an array, but i cannot create arrays on runtime, how can i overcome this situation? |
18:50:36 | Jehan_ | Arrrr: Not sure what you mean by that? |
18:50:57 | bluenote10 | Arrrr: if you mean you only have seq, then maybe addr(seq[0]) should work |
18:51:32 | Arrrr | i need an array but i cannot know the size on compile time |
18:51:43 | Arrrr | mm i'll try that bluenote10 |
18:51:44 | bluenote10 | then you need a seq |
18:52:13 | Araq | bluenote10: what's your problem with the forum? |
18:52:32 | bluenote10 | my email adresses are either too long or end in .edu :(( |
18:52:38 | bluenote10 | its 30 chars max currently |
18:52:48 | Araq | aye lol |
18:52:52 | pigmej | rotfl:D |
18:52:54 | Araq | I remember this bug report :P |
18:52:57 | BlaXpirit | facepalm |
18:53:06 | BlaXpirit | reEmail in action? |
18:53:38 | EXetoC | please use shorter addresses so as to keep the memory usage low |
18:53:38 | bluenote10 | or should I file a PR with .edu added to the validMail function? :) |
18:53:46 | Araq | something like it, but to my defense reEmail was researched well :P |
18:53:54 | BlaXpirit | what |
18:54:03 | BlaXpirit | "researched well"? |
18:54:23 | bluenote10 | EXetoC: its 2015, all <30 char mail addresses are in use ;) |
18:54:27 | Araq | there was some whole article about it and why it's good |
18:54:41 | Araq | however, it didn't *age* well :P |
18:54:50 | EXetoC | bluenote10: damn! |
18:54:54 | BlaXpirit | edu is new? |
18:54:59 | BlaXpirit | don't think so |
18:55:12 | BlaXpirit | it's just stupid |
18:55:36 | dom96 | bluenote10: You can literally put any email address you wish, it doesn't even have to exist. |
18:55:45 | dom96 | We really need to add some actual verification... |
18:55:50 | dom96 | That's the real bug. |
18:55:59 | dom96 | That's how emails need to be verified |
18:56:04 | dom96 | not with silly regexes |
18:56:07 | bluenote10 | ah, there no verification link required? |
18:56:13 | dom96 | But by sending an email to that address. |
18:56:16 | dom96 | nope |
18:56:33 | bluenote10 | ok thanks, problem solved than :) |
18:56:36 | Araq | XD |
18:56:53 | Araq | "worse is better" winning once more |
18:58:06 | HakanD___ | also don't forget the all new custom gtld madness |
18:58:45 | pigmej | email validation with regex is useless this time |
18:58:53 | pigmej | mostly because of custom gtlds |
18:59:32 | HakanD___ | someone with '[email protected]' may arrive to forums sometime :p |
18:59:56 | pigmej | [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@ |
18:59:56 | pigmej | (?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])? |
19:00:07 | pigmej | that is email regex validation without gtlds at the end |
19:00:21 | HakanD___ | (: |
19:00:24 | pigmej | (both lines obviously, my client splitted that) |
19:00:32 | dom96 | email validation should really only be: '@' in text |
19:00:45 | dom96 | On the client side |
19:00:51 | dom96 | then the server can send a verification email |
19:00:53 | dom96 | simple |
19:01:15 | EXetoC | not even a period is mandatory? |
19:02:03 | pigmej | it is EXetoC |
19:02:48 | dom96 | foo@localhost? :P |
19:02:55 | BlaXpirit | that is still extremely wrong, stupid as f**k |
19:02:57 | HakanD___ | client side verification is only courtesy for the user actually, not for any kind of security/verification |
19:03:09 | BlaXpirit | talking about any regex |
19:03:27 | BlaXpirit | for email |
19:03:54 | Araq | dom96: speaking of which: email validation for jester is an essential feature anyway, right? |
19:04:12 | BlaXpirit | wut |
19:04:26 | dom96 | Araq: lol no |
19:04:31 | BlaXpirit | ^ |
19:04:46 | Araq | ok, maybe not for jester |
19:04:49 | dom96 | but if it makes BlaXpirit go 'wut' then yes :P |
19:05:12 | Araq | but worth a nimble package |
19:05:54 | * | ggVGc is now known as p[ |
19:05:58 | * | p[ is now known as [] |
19:06:00 | dom96 | of course |
19:06:02 | * | [] is now known as ][ |
19:06:08 | * | ][ is now known as [[ |
19:06:18 | * | [[ is now known as ]] |
19:06:48 | * | ]] is now known as ggVGc |
19:06:58 | BlaXpirit | is there a way to add a custom message to deprecation? |
19:11:24 | Araq | no |
19:12:15 | BlaXpirit | reInteger doesn't recognize 1_234 |
19:14:18 | Araq | the docs don't say it's a Nim integer :P |
19:14:33 | Araq | but yes, we need to get rid of these asap |
19:14:35 | Arrrr | bluenote10: everything went as expected, thanks. |
19:14:57 | BlaXpirit | and if you're gonna argue that it's a generic regex, not nim-specific, then what is "0o" octal? |
19:15:13 | BlaXpirit | Araq, deprecate all these consts? i can do that :p |
19:15:33 | BlaXpirit | octal matches Nim octals, but not C octals |
19:17:51 | Araq | BlaXpirit: C octals are an abomination, do "generic" has no merit for these |
19:17:56 | Araq | *so |
19:18:11 | Araq | but yes, deprecate them all |
19:22:18 | * | gsingh93 joined #nim |
19:22:53 | Arrrr | Jehan_: why using or not colons make a huge difference when there are like 4 ways to call a proc with 1 parameter? [do 1, do(1), 1.do(), 1.do], i think im not missing anything here. |
19:24:46 | Jehan_ | Arrrr: I honestly don't care all that much one way or another other than that it seems rather pointless to me. There are reasons for the various procedure call syntax options, though. |
19:26:31 | Jehan_ | Again, Wadler's Law. |
19:26:41 | Arrrr | But at the end of the day we are going to see different uses of them, with more visible result than :/no :. It's true that is pointless, but well, someone did the job. |
19:26:59 | Jehan_ | The problem here is that someone jumps in and immediately tries to change the syntax, usually for reasons of personal preference. |
19:27:09 | Jehan_ | And then another. And another. And another. And another. |
19:27:52 | Arrrr | Well, if i were used to nim of course i would not like to see some changes in syntax. |
19:28:07 | Jehan_ | It's more that it's wasting time. |
19:29:53 | Jehan_ | Everybody is an expert on syntax just as everybody is an expert on politics. |
19:30:08 | Jehan_ | It's easy to be opinionated, so lots of people are opinionated. |
19:30:44 | Arrrr | Syntax is a subjetive matter. I dont care as long as the change is not drastic. |
19:30:44 | Jehan_ | I tend towards: If it ain't broken, don't fix it. |
19:32:10 | * | johnsoft quit (Ping timeout: 265 seconds) |
19:32:37 | * | johnsoft joined #nim |
19:32:38 | Jehan_ | So, you want optional colons. Somebody else wants an end keyword at the end of a block. Yet someone else wants support for braces. And so forth. |
19:33:19 | BlaXpirit | I want procs definitions to not use "=" |
19:33:42 | BlaXpirit | that one really is out of place |
19:34:12 | Jehan_ | BlaXpirit: Depends on how you look at it. |
19:34:21 | Jehan_ | proc foo = 1 and const foo = 1. |
19:34:48 | EXetoC | speaking of bikeshedding :p |
19:34:48 | BlaXpirit | forget it |
19:35:21 | Jehan_ | I don't really care one way or another … if someone had asked me 10 years ago, I probably would have voted for : over =. |
19:36:07 | BlaXpirit | that one really is something that i keep forgetting all the time |
19:36:13 | Jehan_ | These days, I'm more interested in writing code than debating the fine points of whether the opening brace belongs on the same line as an `if` or not. |
19:36:26 | Jehan_ | (For C-style syntax, that is.) |
19:38:18 | HakanD___ | same line! |
19:39:04 | HakanD___ | meh, too much optionalism -> road to design-by-committee |
19:39:23 | Jehan_ | HakanD___: All roads lead to Perl. :) |
19:39:30 | HakanD___ | hah |
19:40:08 | Arrrr | behold! optional colons can deceive you! |
19:41:30 | Jehan_ | But seriously, there are things I think are a lot more important. Like, fixing actual bugs in the compiler. Optimizing method dispatch. And then, Newbie #1234 charges in and declares that the most important thing in the world is that a certain part of the syntax Must. Be. Changed. Now. |
19:42:14 | HakanD___ | (: |
19:42:46 | pigmej | cool, github allows me to clone nim repo with modem speed |
19:42:55 | pigmej | 8KiB/s |
19:42:55 | Arrrr | That's a falses dichotomy. We are expending more time on whether or not is important rather than saying "yes or not". |
19:43:11 | Jehan_ | pigmej: Generally, ssh is faster than git or http(s) as the protocol. |
19:43:20 | Jehan_ | Arrrr: That's easy. "No." |
19:43:54 | OnO | FYI optional colon using #! optionalColon PR is ready |
19:44:10 | OnO | I have only one complaint! why prefix >>> #! <<< |
19:44:28 | OnO | this is unix she bang for God's sake :~(((( |
19:44:33 | HakanD___ | ... |
19:44:35 | Arrrr | why not if the change is almost negligible. |
19:44:45 | BlaXpirit | no, this is an actual problem now |
19:45:50 | Arrrr | well, i have to go. See you nimroders. |
19:45:53 | * | Arrrr quit (Quit: Page closed) |
19:46:02 | * | brson_ joined #nim |
19:46:06 | * | brson_ quit (Client Quit) |
19:46:14 | * | brson quit (Quit: leaving) |
19:46:22 | * | brson joined #nim |
19:47:07 | * | bluenote10 quit (Ping timeout: 246 seconds) |
19:50:31 | flaviu | Btw, fixing the email length restriction is really easy. |
19:50:42 | flaviu | You can even do it client side through the element inspector! |
19:50:55 | pigmej | btw, that optional colon... makes source quite unreadable |
19:51:19 | BlaXpirit | impossible |
19:51:51 | Araq | yup, I played with optional colons too. I don't consider it an improvement in readability at all |
19:52:28 | pigmej | Araq: MAYBE for one liners |
19:53:00 | BlaXpirit | it doesn't even work for one liners |
19:53:07 | Araq | and Haskell is my prime example for how too few separators can go wild and produce hard to read code. Nim has the perfect balance. Totally subjective of course. |
19:54:01 | pigmej | well for me colons are quite neutral because I'm from Python world |
19:54:04 | gokr | I agree, please don't make the colon optional. Please, pretty please. |
19:54:40 | gokr | The Nim syntax is "malleable" enough as it is IMHO. We need a few things we can "rely" on in order to easily read each other's code. |
19:54:48 | pigmej | but I can imagine a /mess/ with bigger projects when one lib uses colons one does not... |
19:54:54 | BlaXpirit | don't forget editors |
19:54:57 | pigmej | yup |
19:55:00 | * | gsingh93 quit (Ping timeout: 256 seconds) |
19:55:19 | gokr | Otherwise it all just turns into Forth :) |
19:55:35 | flaviu | I hope my opinion on this is obvious, I'm strongly against it. |
19:55:48 | pigmej | I quite like Nims _ and that it ignores cases (except first one) |
19:55:50 | BlaXpirit | i am very very slightly against it |
19:56:24 | pigmej | if my opinion counts, strongly against |
19:58:50 | OnO | FYI colons or no colons can be enforces by future nimfmt, also same applies to veriable naming, API construction etc. etc. |
19:59:30 | OnO | also current PR does not make anymore colons optional, it requires exlicit directive to enable that |
19:59:58 | BlaXpirit | good points |
20:00:01 | gokr | OnO: I am still strongly against even if optional. |
20:00:05 | pigmej | OnO: don't feel offended, but to me it makes mess in source |
20:00:33 | pigmej | it's just ':' but for me ":" is like oho there starts something important |
20:00:38 | flaviu | OnO: Why do you need optional semicolons? |
20:00:44 | pigmej | while I can easily switch from abc or A_b_c |
20:00:46 | gokr | OnO: I mean, even if only by directive. |
20:00:52 | OnO | I completely disagree... your arguments are like if colons will be gone once PR is merged, which won't gonna happen |
20:00:57 | * | Matthias247 joined #nim |
20:01:19 | OnO | also if project maintainers don't agree they will NOT turn on optionalColons |
20:01:35 | pigmej | OnO: what if one will use lib that has it enabled? |
20:01:37 | gokr | OnO: IMHO it just creates a mess. So I find Nim code somewhere and copy paste it - and nah, it doesn't work. Why? Because it doesn't have colons. Come on. |
20:01:48 | HakanD___ | ^ |
20:01:55 | OnO | but I don't really understand why you want ME to use colons in my very own project if I don't like to.. and you will never see its code anyway |
20:02:00 | pigmej | then you have mixed style (totally) and probably broken parts |
20:02:04 | pigmej | also what with include ? |
20:02:22 | pigmej | OnO: quite egoistic thinking |
20:02:28 | pigmej | tbh |
20:02:59 | gokr | OnO: But that argument doesn't fly - if so then NOTHING will be set in stone. Because there is always someone out there going - no, I want to write "iff" instead of "if". |
20:03:05 | flaviu | OnO: You can always use a fork of Nim in your personal code. |
20:04:00 | pigmej | http://www.gossamer-threads.com/lists/python/python/82582 |
20:04:23 | Araq | well the reason question here is what we want to do with these #! non standard syntaxes in general |
20:05:14 | BlaXpirit | how many are there? |
20:05:24 | pigmej | Araq: I personally think too much freedom with this == big mess |
20:05:29 | * | gsingh93 joined #nim |
20:05:30 | BlaXpirit | they are harmful because of just mentioned reasons |
20:05:37 | BlaXpirit | can't copypaste code |
20:05:41 | BlaXpirit | and what about include? |
20:05:43 | pigmej | _ and case is already problematic for newcomers |
20:06:32 | Araq | yeah but often I just want to use a module and don't care wether it uses 4 spaces or superfluous ; or whatever |
20:06:57 | flaviu | Araq: What if you need to modify that module? You'd care then. |
20:06:58 | pigmej | Araq: yeah but what if you want to fix a bug there ? |
20:07:25 | pigmej | also I can imagine then a project where some files are colosoptoinal some are hardspace |
20:07:25 | OnO | pigmej: what if you want fix a bug in code that uses macros? |
20:07:32 | Araq | and it's a big benefit the module is written in some variant of Nim and not in Rust/Go/D/C++/Java |
20:07:33 | OnO | pigmej: do you want to ban macros too? |
20:07:47 | pigmej | then I would need to scroll up to check optionals and check |
20:07:56 | pigmej | OnO: no becuase macros are 'standards' |
20:08:16 | flaviu | OnO: Macros bring quite of bit of power. Optional semicolons just make it easier to be sloppy. |
20:08:28 | Araq | flaviu: even then modifying the code is easier than translating it from Rust. |
20:08:40 | OnO | they are standard because someone has set the standard |
20:08:47 | * | bluenote joined #nim |
20:08:56 | * | saml joined #nim |
20:09:10 | OnO | eg. if someone decides to use OOP macros that set code style differently that your preference, what do you do? |
20:09:12 | pigmej | Araq: sure, but still you would first need to check the optionals, switch your brain (and editor probably to correct settings for single file) etc |
20:09:26 | pigmej | OnO: for me code style != language style |
20:10:00 | pigmej | but I can imagine if that ':' will be optional |
20:10:07 | pigmej | then next step for someoone might be add endif |
20:10:14 | flaviu | OnO: The syntax still needs to be valid Nim syntax, so they don't have total flexibility. |
20:10:16 | pigmej | and similar. |
20:10:50 | Araq | pigmej: the original Nim design had #! braces and #! end syntaxes ;-) |
20:10:59 | OnO | honestly any of you at least tried to code without colon right? |
20:11:17 | OnO | because you are defending the colons like holy grail |
20:11:25 | Araq | OnO: yes, I modified 3 modules with real world code and looked at the result |
20:11:32 | pigmej | OnO: it makes me easy to read the code |
20:11:42 | pigmej | i changed some of nim examplse |
20:11:44 | pigmej | examples* |
20:11:48 | pigmej | and I was like wtf |
20:12:34 | EXetoC | pigmej: how come? |
20:13:50 | OnO | anways, aside from my PR, please consider changing #! to #| see: https://github.com/Araq/Nim/issues/2559 |
20:14:01 | BlaXpirit | anyone can try this stuff |
20:14:13 | BlaXpirit | replace :$ with nothing |
20:14:22 | OnO | yes |
20:14:40 | pigmej | OnO: this one make sense in fact. |
20:14:59 | flaviu | OnO: I absolutely agree. |
20:15:30 | BlaXpirit | write that u agree at issue page |
20:15:54 | * | filwit quit (Ping timeout: 245 seconds) |
20:16:01 | pigmej | but I'm just not sure aobut #| |
20:16:21 | Araq | OnO: changing #! to something else is fine but requires a deprecation path at least |
20:16:40 | flaviu | Sort of related, I wrote https://gist.github.com/27c2dc9cd2d8f5ced4e4 a while ago. |
20:16:43 | BlaXpirit | well deprecate it before next release |
20:16:43 | OnO | Araq: sure, I stated to make #! deprecated |
20:16:59 | * | Kingsquee joined #nim |
20:17:11 | BlaXpirit | flaviu, why not publish that one properly |
20:17:24 | flaviu | In a full github repo? |
20:17:25 | pigmej | flaviu: seems cool, maybe even cooler with tcc ? |
20:17:37 | flaviu | pigmej: gcc/clang are fast enough. |
20:18:25 | flaviu | I could pass a -d:nimrun flag though, people could decide that in their nim.cfgs |
20:18:33 | BlaXpirit | flaviu, i'm pretty sure /bin/sh is even safer to rely on that /usr/bin/env |
20:18:39 | BlaXpirit | than* |
20:18:57 | OnO | flaviu: use exec $output/executable "$@", this tail-call (replace), better also mind "$@" |
20:19:50 | OnO | but honestly following Shebang is good enough: #!/usr/bin/env nim c -r |
20:20:24 | pigmej | OnO: but then you have mess in output ;) |
20:20:25 | OnO | as long compiler can create a cache "somewhere" ;) |
20:20:25 | flaviu | OnO: Sure. That script has a few advantages in keeping the PWD clean, but your shebang works fine. |
20:20:35 | Jehan_ | Araq: I had a look at bluenote's Stackoverflow issue (actually, had before, but it required some deeper analysis). |
20:20:52 | BlaXpirit | OnO, that does not work |
20:21:03 | Jehan_ | Basically, the issue seems to be that if you pass a closure iterator as an argument, you first have to copy it to a local variable. |
20:21:15 | BlaXpirit | says no such file "nim c -r" |
20:21:25 | Araq | that's documented in the manual, Jehan_ |
20:21:27 | Jehan_ | Otherwise, it keeps calling it from the start again and again. |
20:21:37 | Jehan_ | Araq: Hmm, I must have missed it. |
20:21:38 | Araq | yes, it cannot work any other way |
20:21:53 | Araq | for reasons of consistency with everything else works |
20:22:16 | Araq | but I keep forgetting why, so I need to rethink and write it down :-) |
20:22:16 | Jehan_ | But yeah, I was checking if that was a bug or a feature. |
20:22:34 | Jehan_ | And I still can't find it in the manual, so I may be blind. |
20:22:39 | Araq | it's certainly a gotcha |
20:22:45 | Jehan_ | And the question was so that I give the correct answer on Stackoverflow. |
20:22:47 | bluenote | good to know :-) |
20:22:49 | OnO | BlaXpirit: hmm.. i think this depends on OS, on older Linux I believe it consumed only first 2 arguments |
20:23:04 | OnO | OSX has no such limitation |
20:23:29 | flaviu | BlaXpirit: /usr/bin/env is part of the UNIX spec, so I don't think there's going to be a portability problem. |
20:24:11 | pigmej | flaviu: but as we know unix != linux sometimes :) |
20:24:13 | BlaXpirit | ok then let me put it another way. /bin/sh is better :p |
20:24:15 | OnO | the problem was that on Linux glues all arguments after 2nd into single 3rd arg |
20:24:24 | flaviu | BlaXpirit: Ah, I see which shebang you're referring to. |
20:24:32 | Jehan_ | Araq: Any more specific information on where in the manual to look? |
20:24:47 | OnO | that's why probably a "runner" is inevitable |
20:24:55 | Jehan_ | I'd like the answer to be as comprehensive as possible, because then one can point people at it later. |
20:25:55 | gokr | While on the subject of syntax etc - Nim doesn't by any chance (though I should have seen it) support Smalltalk cascade? |
20:26:25 | Jehan_ | gokr: Not that I know of, though one could support it with macros. |
20:26:54 | Araq | Jehan_: hrm there is only http://nim-lang.org/manual.html#first-class-iterators indeed, but the example is quite good |
20:27:03 | OnO | gokr: don't want to be mean, but some ppl hate Smalltalk syntax ;) |
20:27:12 | Jehan_ | Araq: Yeah, that's what I had been looking at. |
20:27:12 | Araq | runTasks(a1, a2) |
20:27:19 | OnO | I don't care, I am iOS dev |
20:27:28 | Araq | runTasks(a1, a1) should obviously start 2 tasks |
20:27:36 | Araq | not advance 'a1' |
20:27:37 | gokr | OnO: Smalltalk != ObjC |
20:28:09 | OnO | sure |
20:28:27 | Araq | "parameterless closure iterator means closure creation" |
20:28:30 | Jehan_ | OnO: Cascades aren't a syntax thing, hence why you could them via macros. |
20:28:42 | Araq | it's consistent with how other closures work |
20:28:50 | OnO | I guess there is "where" keyword that could be used for that |
20:29:09 | OnO | with <- sorry |
20:29:25 | gokr | OnO: Ehum? |
20:29:55 | * | bluenote_PC joined #nim |
20:29:56 | OnO | with x: do1(...); do2(...) |
20:30:11 | OnO | "with" is already a keyword |
20:30:28 | gokr | Well, that's too verbose IMHO. It doesn't really buy much. |
20:30:31 | Jehan_ | Araq: Okay, you've lost me. I'm looking at this code: https://gist.github.com/rbehrends/d010bf36663d0c2e113f |
20:30:36 | bluenote_PC | Jehan_: really looking forward to your answer. I still don't fully get it even with that hint |
20:31:00 | Jehan_ | If I omit `var p = it` and use it() in lieu of p(), then it breaks. |
20:31:08 | Jehan_ | bluenote_PC: See the above gist. |
20:31:11 | gokr | OnO: It wasn't a serious proposition. But yes, I am a Smalltalker at heart. |
20:31:17 | Jehan_ | Basically, you have to copy the argument to a local variable. |
20:31:46 | bluenote_PC | ah, you mean numToTake |
20:32:23 | OnO | and just as a side-note, first 2 commits of my PR are general consitency fixes... as sometimes we get: ':' expected, otherwise invalid indention |
20:32:36 | OnO | eg forgetting ':' after finally |
20:33:21 | Jehan_ | bluenote_PC: No, the `it` argument. |
20:33:29 | bluenote_PC | but when counting up like in my original example, numToTake is a constant anyways. hm, I do not get it yet |
20:33:36 | bluenote_PC | ok, this makes more sense than |
20:33:41 | Jehan_ | No, has nothing to do with numToTake. |
20:34:03 | Jehan_ | But you need to copy the iterator argument to a local variable before calling it. |
20:34:05 | * | BlaXpirit_ joined #nim |
20:36:39 | * | filwit joined #nim |
20:36:42 | Araq | Jehan_: aye that's kind of weird :P |
20:37:01 | Araq | I can fix it but I had my reasons not to do that |
20:37:05 | Jehan_ | Araq: So … bug or oddity? |
20:37:22 | pigmej | Jehan_: does it differ? |
20:37:50 | bluenote_PC | so this would work as well: for x in (var p = it; p()): |
20:38:10 | bluenote_PC | ? |
20:39:10 | bluenote_PC | (still trying to come up with a rule why calling the orininal is not the same as the re-assigned) |
20:39:17 | Jehan_ | pigmej: I've added the broken version for comparison. |
20:39:28 | Jehan_ | bluenote_PC: That's what I've been wondering, too. |
20:39:37 | Jehan_ | My initial guess was that it had to do with the code generator. |
20:39:52 | Jehan_ | Basically, if you look at the code, the iterator keeps getting reinitialized within the loop. |
20:40:06 | Jehan_ | If you don't copy it first. |
20:40:29 | Jehan_ | And I suspected it had something to do with the fact that you can't modify non-var arguments. |
20:40:44 | Jehan_ | At the same time, it works for varargs in the manual example. |
20:40:48 | BlaXpirit_ | Araq, please comment on https://github.com/Araq/Nim/issues/2511 "Deprecate and replace 're' with 'nre'" |
20:41:07 | bluenote_PC | from my naive point of view I would say it should not be re-initialized... |
20:41:57 | bluenote_PC | good point regarding non-var though |
20:42:00 | Araq | well p creates the closure, p() extracts the first value out of it |
20:42:19 | Araq | so what does p() do? always returns the first value, of course |
20:42:49 | Araq | the context of 'for in' is special though, so I think I can make it work |
20:42:53 | Jehan_ | Araq: Okay. I think I see. |
20:42:59 | bluenote_PC | but `it` itself isnot a closure anyways? (which I was expecting since it is a "closure" iterator) |
20:43:49 | Araq | er .. replace 'p' by 'it' |
20:46:32 | BlaXpirit_ | ... |
20:46:43 | * | mpthrapp quit (Remote host closed the connection) |
20:48:17 | Jehan_ | Hmm. Looking at the code, I think I'm beginning to understand what's going on here. |
20:48:35 | Jehan_ | I'll still have to sleep on it to turn it into a nice write-up for SO. |
20:48:54 | bluenote_PC | I'm still confused :/ a bit too tricky for a newbie I guess |
20:49:23 | Jehan_ | bluenote_PC: Yeah. It's basically a question of when iterators get initialized and advanced. |
20:50:06 | Jehan_ | Which is why I need to sleep on it to figure out how to explain it to people who aren't familiar with Nim internals. |
20:50:39 | bluenote_PC | ok, I'm really looking forward to see the solution |
20:50:51 | bluenote_PC | probably worth a bounty :) |
20:51:26 | * | BlaXpirit_ quit (Ping timeout: 265 seconds) |
20:52:37 | Jehan_ | bluenote_PC: Don't care about virtual internet points. :) |
20:52:38 | bluenote_PC | I was hoping that it is something simple like, use `it` for assignment to variables and `it()` for the actual iterator in the for statement |
20:53:16 | Jehan_ | bluenote_PC: Simple take-away solution: If you pass iterators as arguments to other iterators, copy them to a local variable before using them. |
20:53:38 | bluenote_PC | does this also work in the template example then? |
20:54:06 | Jehan_ | I think Sather-like once arguments would also fix this. |
20:54:15 | Jehan_ | bluenote_PC: I haven't looked at the template version yet. |
20:54:49 | bluenote_PC | btw: I saw you closureIterator example in the forum and I had the same problem with this piece of code |
20:55:32 | bluenote_PC | i.e.: for x in closureIterator(infinite): gave the same error |
20:56:44 | * | banister joined #nim |
20:56:49 | * | banister quit (Max SendQ exceeded) |
20:58:29 | Jehan_ | Araq: I note that even the fixed version generates a ton of unnecessary environments. |
20:58:30 | bluenote_PC | anyways: thank you very much for your efforts! |
20:59:17 | Jehan_ | Basically, a new environment is created for the infinite iterator and passed to the take iterator each time. |
20:59:47 | Jehan_ | However, with the fix, it ignores that environment (because it keeps working on the one in p). |
21:00:18 | bluenote_PC | do you look at the C code to see such things? |
21:00:32 | Araq | Jehan_: yup... it's all wrong :-) |
21:00:51 | Araq | that means async might get quite a bit faster when we fixed it :D |
21:01:04 | OnO | btw. if anyone using TextMate... playing with Nim, I did improvements to its TM bundle: https://github.com/textmate/nim.tmbundle/pull/1 |
21:01:10 | Jehan_ | Araq: Actually, I think it's not so much wrong as that iterators are lacking something like Sather's once arguments. |
21:02:06 | Jehan_ | Basically, when an iterator in Sather has an argument declared as once, it's only evaluated once for the iterator, not once per iteration. |
21:02:33 | OnO | https://cloud.githubusercontent.com/assets/103067/7147306/4a73f632-e2fa-11e4-9c25-b19767de4585.png |
21:02:39 | Araq | bluenote_PC: I'm not even looking at the compiler. I know how the implementation looks like :P |
21:03:11 | Araq | spent more time on it than on everything else |
21:03:44 | bluenote_PC | ok, I see :) I just have to learn the compiler |
21:07:00 | OnO | btw. one question, why constructors use Type(field1: val1) but proc calls use = for named params proc(param1=val1..), etc? |
21:07:03 | bluenote_PC | Araq: So you think that fixing the "broken" version is possible? I'm wondering because the code was actually looking right intuitively |
21:07:13 | OnO | isn't assignment expr in Nim? |
21:07:45 | Jehan_ | I've added a new version to https://gist.github.com/rbehrends/d010bf36663d0c2e113f that works with a `once` template and fixes the issue better. |
21:08:08 | OnO | so: var width = 400; proc(width = 500) <- I am setting with to 500 and then passing value or calling with with named parameter |
21:08:14 | OnO | pretty confusing syntax |
21:09:19 | Jehan_ | OnO: Assignment expressions do not return a value if that's what you mean. |
21:09:54 | Jehan_ | If you do f(x = 100), then that means that the argument with name x is assigned the value 100. |
21:10:11 | Jehan_ | Not that a variable x is assigned the value 100 and the result of that passed to f(). |
21:10:39 | OnO | okie, so one liner: x = y = 0 is invalid syntax? |
21:10:47 | Araq | I simply took that from Python. f(x=10) vs {"foo": 21} |
21:11:20 | OnO | yeah, but for object initalization it uses colon |
21:11:26 | OnO | I find it pretty inconsistent |
21:11:58 | Jehan_ | OnO: That's to syntactically distinguish between object initializers and function calls. |
21:12:57 | Jehan_ | At least that's what my guess is. :) |
21:13:01 | OnO | I don't feel convinced, because it is let x = 1 not let x : 1 |
21:13:08 | OnO | 1 is an initializer for x |
21:13:12 | BlaXpirit | object initializers need to be private :| |
21:13:17 | Jehan_ | bluenote_PC: Okay, I'll get you your write-up tomorrow, and I think it should be pretty clear. |
21:13:31 | flaviu | My thoughts here are that object initializers should not be distinguishable from function calls. |
21:13:44 | BlaXpirit | if one can make them private |
21:14:00 | bluenote_PC | Jehan_: awesome |
21:14:15 | flaviu | https://github.com/Araq/Nim/issues/1693 |
21:16:04 | BlaXpirit | I just remembered something. there is absolutely no reason for destructors to limit ref objects' behavior |
21:16:05 | OnO | flaviu: they are, types begin with capital letter, right? |
21:16:27 | flaviu | .eval proc Foo() = discard |
21:16:28 | Mimbus | flaviu: <no output> |
21:16:34 | flaviu | OnO: I see no error ^ |
21:17:16 | BlaXpirit | flaviu, object constructors are rarely useful |
21:17:45 | BlaXpirit | oh wait, adding procs is exactly what you're suggesting |
21:17:55 | BlaXpirit | yeah, i want this badly |
21:18:16 | BlaXpirit | but damn it would be hard to eradicate init/new |
21:18:35 | BlaXpirit | and if we don't want to eradicate it, then this is an inconsistent addition |
21:18:40 | Jehan_ | OnO: Types begin with a capital letter only by convention. |
21:19:07 | flaviu | BlaXpirit: This could be fixed by tooling. |
21:19:13 | Jehan_ | See `int`, `cstring`, etc. |
21:20:21 | flaviu | if a type only has newFoo, create a Foo() that returns a ref. If a type only has a initFoo, create a Foo() that returns a value. If a type has both, create a Foo() that returns a value and replace all calls to newFoo() with box Foo(). |
21:20:44 | bluenote_PC | actually I would even prefer namespaces for construtors like AffineMatrix.createRotation, AffineMatrix.createTranslation, etc |
21:21:10 | BlaXpirit | flaviu, wow, i have never once used `box` and completely forgot about it |
21:21:23 | OnO | okay... but let's take an example of: |
21:21:23 | OnO | type Point = object |
21:21:23 | OnO | x, y : int |
21:21:27 | BlaXpirit | i did wonder many times how to make a ref :p |
21:21:32 | Jehan_ | bluenote_PC: You may have a hard time convincing Araq of this. :) |
21:21:33 | OnO | because of this convention I can't let p = Point(1, 2) |
21:21:47 | OnO | just like with any other proc call |
21:21:51 | Jehan_ | He's not a fan of multi-dotting, so to speak. :) |
21:21:57 | BlaXpirit | you can let p = point(1,2) |
21:22:08 | bluenote_PC | ok :) |
21:22:18 | flaviu | .eval proc createRotation(self: typedesc[int], x: int): int = x; proc createRotation(self: typedesc[float], x: float): float = x; discard int.createRotation(1); discard float.createRotation(1) |
21:22:19 | Mimbus | flaviu: <no output> |
21:22:23 | flaviu | doesn't that work fine? |
21:22:30 | OnO | BlaXpirit: I need to declare trivial proc... pretty useless |
21:22:56 | bluenote_PC | flaviu: indeed, I forgot about typedesc |
21:23:03 | flaviu | .eval proc createRotation(self: typedesc[int], x: int): int = x; proc createRotation(self: typedesc[float], x: float): float = 10*x; echo int.createRotation(1), ", ", float.createRotation(1) |
21:23:04 | Mimbus | flaviu: 1, 10.0 |
21:23:06 | BlaXpirit | if your constructor is trivial, maybe it should be a tuple |
21:23:23 | flaviu | The last command was just to verify the correct constructor is getting called |
21:24:04 | BlaXpirit | this is pretty interesting |
21:24:27 | BlaXpirit | instead of initType one can make Type.init |
21:24:51 | flaviu | One last command, just to show that typedesc[int] works, |
21:24:54 | flaviu | .eval proc createRotation(self: typedesc[int], x: int): int = x; echo float.createRotation(1) |
21:24:54 | bluenote_PC | which would be _exactly_ what I was asking for :) |
21:24:55 | Mimbus | flaviu: eval.nim(4, 10) Error: type mismatch: got (typedesc[float], int literal(1)) |
21:25:14 | OnO | BlaXpirit: declaring Point type as tuple does not let me use: let p = Point(1,2) either |
21:25:39 | BlaXpirit | let p: Point = (1,2) |
21:26:06 | OnO | yeah, how do constuct in in place ? |
21:26:21 | OnO | eg. calling rotate(p, Point(3,4)) ? |
21:26:37 | BlaXpirit | rotate(p, (3, 4)) |
21:27:35 | OnO | hmm... ok... this is pretty interesting |
21:27:50 | BlaXpirit | also for corner cases Point((1, 2)) |
21:28:20 | OnO | yess... Point((1, 2)) works in place |
21:29:40 | * | itsmeront joined #nim |
21:30:48 | OnO | do tuples have some memory overhead comparing to regular objects? |
21:31:00 | BlaXpirit | no |
21:31:31 | BlaXpirit | no overhead of any kind |
21:31:33 | flaviu | Point.fromTup((1, 2)) would also work, if you want that syntax. |
21:32:14 | OnO | ok... so I could generally make Vec2, Vec3, Vec4 tuples with x, y, z fields.. and then same some templates to defined aritmetics for all 3 of them |
21:32:38 | OnO | given templated operator can also access length of the tuple |
21:32:47 | BlaXpirit | ye this is good |
21:33:13 | BlaXpirit | wait what |
21:33:16 | BlaXpirit | tuple len doesn't work? |
21:33:22 | BlaXpirit | wtf |
21:35:17 | bluenote_PC | isn't it arity for a tuple? |
21:36:07 | BlaXpirit | who cares. if i can do [index] then there should be a len |
21:36:26 | BlaXpirit | maybe i'm wrong |
21:36:39 | OnO | okay, simple task... provide a module for 2, 3, 4 element vectors so vectors can be accessed via v.x, v.y, v.z, v.w or v[0], v[1]... and define arithmetics for them |
21:37:02 | OnO | I don't want to define + - operators separately for each vector size |
21:37:19 | OnO | just make it unrolled inlined template for each |
21:37:21 | * | jsudlow quit (Remote host closed the connection) |
21:37:22 | BlaXpirit | you can make a template that defines a function |
21:37:36 | BlaXpirit | not a template that does the operations directly |
21:37:44 | Jehan_ | BlaXpirit: You can only do index with constant values on tuples. |
21:38:01 | Jehan_ | So not sure what len() would be good for. |
21:38:17 | BlaXpirit | for what we said above |
21:40:12 | EXetoC | it can be a compile-time operation too |
21:40:17 | bluenote_PC | well, "abstracting over arity" is a famous problem with tuples (the purpose HList in scalaz, Haskell) since (int, int) is just a different type as say (int, int, int) |
21:41:14 | Araq | abstracting over arity is easy with macros.getType |
21:41:26 | bluenote_PC | good example how powerful Nim is since abstracting over tuple arity in not a big deal in Nim |
21:41:33 | BlaXpirit | or just add the len -_- |
21:41:48 | bluenote_PC | Araq: exactly, but it is in Scala |
21:41:57 | flaviu | Didn't someone write a module for working with tuples? |
21:42:39 | * | skroll1 joined #nim |
21:42:51 | * | onionhammer joined #nim |
21:43:01 | flaviu | http://www.vision.caltech.edu/~mmcgill/tuples/index.html |
21:43:12 | flaviu | BlaXpirit: ^ |
21:43:35 | * | gsingh93_ joined #nim |
21:44:00 | BlaXpirit | macros... they suck |
21:44:05 | BlaXpirit | i mean, writing them sucks |
21:44:27 | OnO | oh... interesting |
21:44:38 | Jehan_ | BlaXpirit: Heh. :) |
21:45:00 | flaviu | BlaXpirit: Good thing that it's not necessary to write macros very often! |
21:45:02 | Jehan_ | Yeah, I think macro usability has … room for improvement. :) |
21:45:52 | BlaXpirit | templates should just be made more useful |
21:46:07 | * | bluenote_PC quit (Ping timeout: 246 seconds) |
21:46:35 | BlaXpirit | maybe macros should be what they are, but also allow functionality of templates instead of writing trees manually |
21:47:18 | Araq | BlaXpirit: no, no, no. macros are *easier* to write than templates, as soon as your problem is complex enough |
21:48:04 | BlaXpirit | only because templates are more limited than they could be |
21:48:22 | Araq | I disagree |
21:49:38 | Araq | in templates all you can do is to create more adhoc solutions to problems |
21:49:56 | Araq | with more syntax that's special in templates |
21:50:02 | * | gsingh93_ quit (Ping timeout: 264 seconds) |
21:50:34 | Araq | with macros the level of operation is different. you only need more .compiletime procs, not more and more features |
21:50:53 | BlaXpirit | i don't want to write goddamn trees |
21:51:01 | BlaXpirit | especially with that unintuitive api |
21:51:21 | Araq | so use a template and getAst or parseExpr |
21:51:42 | Araq | creating trees is easy enough, you're only showing your ignorance here |
21:52:01 | BlaXpirit | maybe it's "easy" concept-wise |
21:52:01 | * | buMPnet quit (Remote host closed the connection) |
21:52:15 | BlaXpirit | it's just grunt work |
21:52:22 | * | buMPnet joined #nim |
21:52:32 | Jehan_ | What I'd like to see (sometime in the future, not now) is pattern matching on macro argument ASTs. |
21:52:58 | BlaXpirit | I did not know about getAst, nor do I know what it does after reading about it |
21:53:17 | Araq | Jehan_: that's a fair feature request, but that's destructuring of ASTs, BlaXpirit complains about AST construction |
21:53:50 | Jehan_ | Araq: Yup, I realize that it's a separate issue. But then, AST construction is no big deal in general. |
21:53:50 | BlaXpirit | ok so i could make a template to construct a tree and use getAst |
21:53:55 | Jehan_ | At least not for me. |
21:54:05 | Jehan_ | And for what I need. |
21:54:10 | Jehan_ | Don't want to generalize. |
21:54:24 | BlaXpirit | also unreadable |
21:54:51 | BlaXpirit | parseExpr is fine but it's isolated |
21:56:05 | dom96 | what about quote? |
21:56:26 | BlaXpirit | now that's something |
21:57:00 | BlaXpirit | yes, yes, yes! |
21:57:21 | BlaXpirit | [:46:33] <BlaXpirit> maybe macros should be what they are, but also allow functionality of templates instead of writing trees manually |
21:57:26 | BlaXpirit | that's quote, right there |
21:58:03 | BlaXpirit | thank you |
21:58:14 | BlaXpirit | maybe it's time to read the whole docs of macros module |
21:59:08 | OnO | okie, I am going to meet mr sandman, thanks again for great discussion, cya |
21:59:09 | Jehan_ | BlaXpirit: You didn't know about quote? |
21:59:15 | BlaXpirit | I didn't know |
21:59:23 | * | buMPnet quit (Remote host closed the connection) |
21:59:28 | BlaXpirit | are you surprised? |
21:59:30 | Jehan_ | Gotcha. :) |
21:59:37 | BlaXpirit | i didn't go to macros boot camp |
21:59:39 | * | buMPnet joined #nim |
21:59:40 | Jehan_ | No, I had just assumed you did. |
21:59:53 | * | OnO quit (Quit: Textual IRC Client: www.textualapp.com) |
22:00:13 | Jehan_ | That wasn't a "you should know" remark but "oh, that's why he found ast construction tedious" remark. |
22:00:23 | BlaXpirit | I said I am missing the exact functionality of quote |
22:00:35 | BlaXpirit | thank goodness dom understood me |
22:01:00 | * | pregressive quit (Remote host closed the connection) |
22:01:06 | Jehan_ | It's midnight here, my brain is running at 50% capacity at best. :) |
22:01:36 | * | gsingh93 quit (Ping timeout: 250 seconds) |
22:02:04 | dom96 | BlaXpirit: I only read the last 3 sentences that you guys wrote :P |
22:03:01 | Jehan_ | But yeah, my main problem is typically breaking down arguments into usable form. |
22:04:22 | Jehan_ | Another problem is that I rarely need macros, so when I do need them, it takes some experimentation to figure out how they work again. :) |
22:05:55 | dom96 | Sometimes the hardest thing for me with macros, is deciding whether the effort to write the macro outweighs the problems caused by copying and pasting code. |
22:06:42 | Araq | dom96: I think many will say this means the macro system is really well designed :P |
22:07:06 | dom96 | It's much nicer now that quote actually works. |
22:07:25 | dom96 | We still need a nicer way to generate these nodes though. |
22:07:36 | dom96 | but that can be a nimble package |
22:07:46 | BlaXpirit | isn't quote the nicest way? i don't get it |
22:10:20 | def- | BlaXpirit: you can't build every AST with quote |
22:10:29 | BlaXpirit | why? |
22:10:46 | def- | for example a case-of with a variable amount of `of`s (i think) |
22:11:37 | BlaXpirit | well maybe i can build one with a constant number of ofs and copt some nodes and whatnot |
22:11:46 | BlaXpirit | copy* |
22:12:34 | BlaXpirit | oh i get it |
22:12:43 | BlaXpirit | quote + templating language? anyone? |
22:13:24 | dom96 | You can't for example do: |
22:13:30 | dom96 | node.add quote do: |
22:13:36 | dom96 | of 0x11: foo() |
22:13:48 | dom96 | Because an 'of' needs a 'case' |
22:13:50 | BlaXpirit | yes, that's fine |
22:13:58 | dom96 | it's a problem if you already have a case generated |
22:14:25 | dom96 | basically means I had to do this: https://github.com/dom96/gbemulator/blob/master/cpu2.nim#L835 |
22:14:34 | BlaXpirit | check this out |
22:14:35 | dom96 | (Github really butchers the syntax highlighting on that) |
22:14:36 | BlaXpirit | case x |
22:14:37 | BlaXpirit | {% for i in 0..10 %} |
22:14:39 | BlaXpirit | of `i`: foo() |
22:16:19 | BlaXpirit | ah quote is magic.. of cours |
22:16:58 | Araq | that is exactly the "more template voodoo solution" that ends up as a never ending feature request |
22:17:33 | BlaXpirit | ? |
22:17:40 | BlaXpirit | this is the best kind of templates |
22:18:24 | BlaXpirit | rg |
22:18:28 | BlaXpirit | the real templates |
22:18:59 | Araq | well if you stop there, it's still not powerful enough |
22:19:30 | BlaXpirit | point is to intertwine nim code and `quote` |
22:20:16 | BlaXpirit | in fact, it's the templates that should be extended with this functionality |
22:20:31 | BlaXpirit | because yes, sometimes this is not powerful enough |
22:22:16 | BlaXpirit | i'm having a hard time coming up with a difference between a template and a macro that just invokes quote |
22:22:28 | BlaXpirit | is that what it is? |
22:22:46 | BlaXpirit | no... no... f course, we have inject and other things |
22:23:07 | * | saml quit (Remote host closed the connection) |
22:25:51 | reactormonk | Araq, got the gc stuff, but never ran it |
22:26:52 | reactormonk | also, how should I implement different serialization formats for nimsuggest? global variables? |
22:26:56 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:31:01 | * | user7181 quit (Quit: leaving) |
22:32:00 | * | banister joined #nim |
22:36:50 | * | mwbrown quit (Ping timeout: 264 seconds) |
22:39:43 | * | Kingsquee quit (Quit: Konversation terminated!) |
23:00:00 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:01:24 | * | pregressive joined #nim |
23:13:18 | a5i | ping dom96 ? |
23:13:23 | dom96 | sup |
23:13:45 | a5i | I'm really like Ruby, so thats I'm with Crystal |
23:14:22 | a5i | nothing against Nim tho, its a very nice language I've been following |
23:14:38 | a5i | * to anser your question from hours earlier |
23:16:35 | BlaXpirit | does nim have "exec"? |
23:16:57 | BlaXpirit | an equivalent to writing text to a file and importing it |
23:17:31 | BlaXpirit | no |
23:17:40 | BlaXpirit | an equivalent to writing a text file and including it |
23:19:22 | * | saml_ joined #nim |
23:20:12 | a5i | dom96, I actually hope to get into Nim soon |
23:20:49 | dom96 | a5i: ahh. No prob. |
23:35:12 | * | Jehan_ quit (Quit: Leaving) |
23:39:20 | filwit | BlaXpirit: write to a file in a 'static' block then import it? (havent tried) |
23:39:38 | BlaXpirit | filwit, i don't want to write a file |
23:39:48 | BlaXpirit | i want to execute a string of nim code at compiletime |
23:42:20 | filwit | well you can execute any nim code at compile time of course.. but yeah, dunno how to load a string and execute it all at compile time.. maybe some trick with a macro which builds a macro.. |
23:42:57 | BlaXpirit | i've tried :/ |
23:43:17 | BlaXpirit | macro that invokes parseStmt and returns stmt |
23:44:42 | BlaXpirit | problem is... the macro can't accept a string |
23:45:04 | filwit | make it a static[string] |
23:45:54 | BlaXpirit | oho |
23:46:28 | BlaXpirit | nope |
23:47:10 | BlaXpirit | undeclared identifier: '��' |
23:47:59 | BlaXpirit | it works |
23:48:00 | BlaXpirit | !!! |
23:48:02 | BlaXpirit | thxc |
23:49:48 | filwit | yeah i just got it to work too |
23:50:32 | * | Trustable quit (Remote host closed the connection) |
23:51:12 | filwit | BlaXpirit: just to be clear, here's what I did: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2 |
23:51:35 | BlaXpirit | why is that needed? |
23:51:44 | filwit | idk... good point |
23:51:48 | BlaXpirit | and not just macro with parsestmt |
23:51:56 | filwit | yeah i was thinking wrong |
23:52:49 | BlaXpirit | wait |
23:52:56 | BlaXpirit | macro with parsestmt executes it at runtime |
23:53:11 | BlaXpirit | loool |
23:54:12 | filwit | idk what you mean, but this works: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2 |
23:54:29 | filwit | i mean, you wanted this to happen at compile-time right? |
23:54:46 | BlaXpirit | [:39:46] <BlaXpirit> i want to execute a string of nim code at compiletime |
23:55:38 | BlaXpirit | i want to execute a compiletime string of nim code at compiletime |
23:55:40 | filwit | ah right, that's why i was making a macro which returned a template.. so you could call the template from some other compile-time function.. |
23:55:53 | BlaXpirit | and we invented a way to execute a compiletime string of nim code at runtime |
23:56:05 | filwit | one sec |
23:56:07 | BlaXpirit | aha, filwit |
23:57:07 | filwit | yeah it works: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2 |
23:57:35 | BlaXpirit | appears so, filwit. |
23:58:03 | BlaXpirit | but omg what is this |
23:58:03 | filwit | of course it defines some function you need to call by name, but I'm sure something like this can be adapted to your purpose |