00:00:53 | * | Demos joined #nimrod |
00:03:31 | BitPuffin | yeah I think I'm gonna do that |
00:03:33 | BitPuffin | night! |
00:03:46 | * | BitPuffin quit (Quit: WeeChat 0.4.2) |
00:04:10 | * | Icefoz quit (Quit: leaving) |
00:05:06 | * | Icefoz joined #nimrod |
00:05:34 | * | Icefoz left #nimrod (#nimrod) |
00:06:01 | * | Icefoz joined #nimrod |
00:10:48 | * | Amrykid quit (Excess Flood) |
00:11:18 | * | Amrykid joined #nimrod |
00:17:40 | * | ics quit (Ping timeout: 246 seconds) |
00:20:36 | * | ics joined #nimrod |
00:31:48 | * | Hannibal_Smith quit (Quit: Sto andando via) |
00:32:22 | * | zielmicha quit (Ping timeout: 246 seconds) |
00:49:22 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:06:27 | * | boydgreenfield quit (Quit: boydgreenfield) |
01:50:33 | * | DAddYE quit (Remote host closed the connection) |
01:51:07 | * | DAddYE joined #nimrod |
01:55:19 | * | DAddYE quit (Ping timeout: 246 seconds) |
02:03:09 | * | webskipper quit (Ping timeout: 246 seconds) |
02:03:43 | * | brson quit (Quit: leaving) |
02:06:05 | OrionPKM | varriount you here? |
02:12:39 | * | Demos quit (Quit: Textual IRC Client: www.textualapp.com) |
02:36:06 | Varriount | OrionPKM, yeah |
02:36:26 | Varriount | I was playing a fullscreen game, sorry. |
02:36:39 | OrionPKM | np |
02:37:30 | OrionPKM | never mind, I was going to ask you something, but it doesn't matter anymore |
02:37:34 | Varriount | Oh? |
02:41:10 | OrionPKM | yeah. at the gym now though, so can't talk |
02:44:03 | OrionPKM | I'm working on babel integration when I get back tho |
03:50:42 | * | EXetoC quit (Quit: WeeChat 0.4.2) |
03:53:07 | * | DAddYE joined #nimrod |
03:57:26 | * | DAddYE quit (Ping timeout: 240 seconds) |
04:16:31 | * | fundamental quit (Read error: Operation timed out) |
04:32:18 | * | fundamental joined #nimrod |
04:51:09 | * | mflamer joined #nimrod |
04:54:20 | * | DAddYE joined #nimrod |
04:58:51 | * | ics joined #nimrod |
04:59:50 | * | DAddYE quit (Ping timeout: 240 seconds) |
05:21:00 | Varriount | Araq, how would one do nimrod/python style indentation in the peg parser? Is it possible? |
05:21:10 | Varriount | *with the peg parser module |
05:56:37 | * | DAddYE joined #nimrod |
06:00:38 | * | DAddYE quit (Ping timeout: 240 seconds) |
06:00:50 | * | ics quit (Ping timeout: 246 seconds) |
06:02:26 | * | ics joined #nimrod |
06:57:43 | * | DAddYE joined #nimrod |
07:03:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
07:18:49 | * | hoverbear quit (Quit: Hibernating, be back soon.) |
07:35:39 | * | boydgreenfield joined #nimrod |
07:59:55 | * | DAddYE joined #nimrod |
08:04:14 | * | DAddYE quit (Ping timeout: 240 seconds) |
08:15:07 | * | webskipper joined #nimrod |
08:16:40 | * | dymk quit (Ping timeout: 245 seconds) |
08:21:51 | * | dymk joined #nimrod |
08:37:21 | * | _dymk joined #nimrod |
08:37:45 | * | dymk quit (Ping timeout: 245 seconds) |
08:46:58 | * | boydgreenfield quit (Quit: boydgreenfield) |
09:00:48 | * | DAddYE joined #nimrod |
09:00:58 | * | webskipper quit (Ping timeout: 240 seconds) |
09:05:11 | * | DAddYE quit (Ping timeout: 252 seconds) |
09:19:13 | * | silven joined #nimrod |
09:27:14 | * | shodan45 quit (Quit: Konversation terminated!) |
09:49:04 | * | io2 joined #nimrod |
10:02:01 | * | DAddYE joined #nimrod |
10:06:20 | * | DAddYE quit (Ping timeout: 240 seconds) |
10:42:23 | * | _dymk quit (Quit: ZNC Bouncer Quitting) |
10:43:59 | * | dymk joined #nimrod |
10:44:38 | * | mflamer quit (Ping timeout: 240 seconds) |
11:00:13 | * | PortablePuffin joined #nimrod |
11:03:20 | * | DAddYE joined #nimrod |
11:05:50 | * | BitPuffin joined #nimrod |
11:06:03 | BitPuffin | Araq: But openarrays are for parameters! |
11:06:05 | BitPuffin | anyways |
11:07:26 | * | DAddYE quit (Ping timeout: 240 seconds) |
11:07:28 | BitPuffin | Araq: I think I'm gonna need to send pretty big quantities of data through channels and that's apparently slow. Is there a good option to this though? maybe having some global seq that one can write and one can read and you send a message to read and push it in to that stack and pop it after reading maybe? |
11:11:18 | BitPuffin | guess it would be the reverse of push and pop |
11:11:22 | BitPuffin | but you get the idea |
11:12:44 | fowl | hi BitPuffin |
11:12:51 | fowl | hows life |
11:13:07 | BitPuffin | fowl: hey fow |
11:13:10 | BitPuffin | l |
11:13:14 | BitPuffin | stressful, and yours? :) |
11:17:48 | BitPuffin | Araq: well I guess it isn't like video files I'm gonna be passing arounds. But say 250 000 vertices? so with float32's that's 4*4*250000 bytes |
11:18:14 | BitPuffin | 3906.5kb |
11:18:52 | BitPuffin | ~3.8 MB |
11:18:59 | BitPuffin | Is that too much to pass through a channel? |
11:19:06 | BitPuffin | dom96: opinion plox |
11:19:25 | BitPuffin | and fowl if you know this stuff |
11:27:27 | fowl | what are you doing |
11:27:33 | fowl | with so much data |
11:31:24 | BitPuffin | fowl: terrain |
11:32:36 | BitPuffin | that's only one vertex per meter, I'm experimenting with interpolating via the geometry shader |
11:32:57 | BitPuffin | ofc geometry shaders aren't the fastest things so that's why it is experimenting |
11:33:04 | BitPuffin | but that allows me to send less data to the gpu |
11:36:39 | fowl | how are channels "apparently slow" did you do actually try it |
11:50:18 | BitPuffin | fowl: not yet, but there are warnings on the site and dom96 freaked out |
11:52:17 | fowl | BitPuffin, do you have libjit installed |
11:52:52 | BitPuffin | fowl: no |
11:52:55 | BitPuffin | or well let me check |
11:53:23 | BitPuffin | don't think so no |
11:54:40 | BitPuffin | nope |
11:56:04 | fowl | o |
11:57:17 | PortablePuffin | fowl: Why do you ask? |
11:58:03 | fowl | im getting a segfault running an example from the tutorial (in nimrod) |
11:58:18 | fowl | it compiles and runs fine from c |
11:58:34 | PortablePuffin | hm. That's weird |
11:59:03 | PortablePuffin | fowl: look at the generated c source I guess |
12:04:52 | * | DAddYE joined #nimrod |
12:07:38 | BitPuffin | who the hell is PortablePuffin |
12:08:01 | PortablePuffin | BitPuffin: yo moma |
12:08:06 | BitPuffin | 'kay |
12:08:18 | PortablePuffin | : |
12:08:18 | BitPuffin | D |
12:09:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
12:11:49 | fowl | the generated c is fine |
12:12:25 | BitPuffin | fowl: gdb it? :P |
12:12:31 | fowl | i dunno how :( |
12:17:14 | BitPuffin | fowl: this one is a decent introduction http://youtu.be/sCtY--xRUyI |
12:24:41 | BitPuffin | NOOB CAN'T EVEN CODE FACTORIAL |
12:26:18 | * | Hannibal_Smith joined #nimrod |
12:28:59 | fowl | well |
12:29:13 | fowl | that doesnt help |
12:29:23 | fowl | a function thats imported is segfaulting |
12:32:06 | * | Kristina_ is now known as kristina |
12:32:29 | BitPuffin | fowl: well you can also use gdb to dissassemble |
12:32:39 | BitPuffin | fowl: disassemble* |
12:32:58 | BitPuffin | fowl: so you could compare the asm of the c and nimrod versions |
12:33:06 | BitPuffin | maybe that can give you some hints on what's going on |
12:33:59 | fowl | but the c version works |
12:34:20 | BitPuffin | fowl: yeah, that's the point, you can compare the C version that works with the nimrod version that doesn't |
12:34:28 | BitPuffin | you are drunk today aren't you |
12:35:30 | fowl | no :( |
12:35:36 | fowl | i ran out of money, no beer |
12:37:49 | BitPuffin | no beer is probably a good thing |
12:39:23 | BitPuffin | http://cgdb.github.io/ is also really cool |
12:46:28 | Araq | hi PortablePuffin welcome |
12:46:39 | Araq | BitPuffin: just send a 'ptr' then |
12:46:43 | BitPuffin | Araq: that's just me on my phone but thanks :P |
12:47:01 | Araq | no, he's your mum |
12:47:08 | BitPuffin | oh yes |
12:47:09 | BitPuffin | true |
12:47:11 | BitPuffin | I am my own mother |
12:47:28 | Kooda | D: |
12:47:35 | fowl | BitPuffin, its no use unless i recompile libjit with debugging symbols |
12:47:58 | BitPuffin | Araq: okay maybe a ptr could work. I guess ref is forbidden because the GC only works on local threads? |
12:48:19 | BitPuffin | fowl: well libjit obviously works so there is some difference in your code |
12:48:30 | fowl | nope there is none |
12:48:34 | Araq | 'ref' is not forbidden but causes a copy of the whole thing |
12:48:57 | BitPuffin | ah yeah true. I remember it saying that there is a deep copy |
12:49:03 | Araq | and yes ... if the data structure contains cycles stuff crashes |
12:49:20 | BitPuffin | Araq: do you think sending ca 3.8mb is that slow though? |
12:49:35 | Araq | I think it's stupid, yes |
12:49:48 | BitPuffin | alright |
12:49:56 | BitPuffin | well after its creation the data will be static anyway |
12:50:00 | BitPuffin | so what could go wrong :D |
12:50:47 | BitPuffin | in fact it doesn't even have to break gc? Because all the message will trigger is data being sent to the gpu. So I could just get a ptr with addr no? |
12:51:42 | Araq | "level" is a palindrome |
12:53:45 | BitPuffin | haha correct |
12:54:15 | fowl | radar |
12:54:18 | Araq | well the thing is: you're on your own when use 'ptr' |
12:54:39 | Araq | you need to ensure the data lives long enough in the thread that owns the data |
12:54:45 | BitPuffin | Araq: so the gc stops trying the moment I do addr x? |
12:55:15 | Araq | I guess you can say that. The GC doesn't trace addr x |
12:55:22 | * | Hannibal_Smith quit (Quit: Sto andando via) |
12:55:26 | BitPuffin | no but does it keep tracing x? |
12:55:32 | BitPuffin | if x is ref |
12:55:51 | Araq | well it traces 'x' on the heap that 'x' was created |
12:56:29 | BitPuffin | hmm, but I guess it's not a good idea to let the gc keep tracking x at that point |
12:56:39 | Araq | when that thread dies, the memory is freed no matter if other threads access that data |
12:56:40 | BitPuffin | since it could delete x while the receiver of addr is using it |
12:57:01 | BitPuffin | could be less of a problem though |
12:57:27 | Araq | you can also use allocShared |
12:57:37 | Araq | which seems to be easier to use from what I can tell |
12:57:39 | BitPuffin | since that thread with the data will only die when the program dies. And that data will probably be kept in that thread and not freed until you walk too far away from that terrain section |
12:58:19 | BitPuffin | and by then it's obviously already on the gpu |
12:58:27 | BitPuffin | being rendered and stuff |
12:58:38 | BitPuffin | or actually done rendering for the moment |
13:00:22 | BitPuffin | Araq: hmm, well if I send a ptr through a channel doesn't that more or less have the same effect as allocShared? |
13:01:04 | BitPuffin | or an addr or whatever |
13:01:42 | BitPuffin | I guess I could even make it nicely GC'd by creating a finalizer that sends a message to the opengl thread to delete the buffer |
13:01:50 | Araq | no, it's completely different |
13:02:26 | Araq | sending a ptr sends the data but the ownership is still bound to the creating thread |
13:02:50 | Araq | allocShared creates something that has no owner |
13:02:57 | BitPuffin | right |
13:03:09 | BitPuffin | but that doesn't affect the performance I assume? |
13:03:32 | Araq | sue it does, allocShared uses a lock |
13:03:35 | Araq | *sure |
13:03:45 | BitPuffin | but that's no good |
13:04:18 | Araq | well according to you you only allocate once |
13:04:26 | BitPuffin | yeah |
13:04:41 | Araq | so taking a lock for that allocation is irrelevant |
13:04:42 | BitPuffin | guess it wouldn't ever need to lock if everyone is only reading |
13:05:36 | Araq | well just to be clear the code does: aquire(heapLock); result = allocateSomehow(); release(heapLock) |
13:05:59 | BitPuffin | right |
13:06:01 | Araq | you don't have to do anything with that heap lock and it only affects the allocation itself |
13:06:09 | * | DAddYE joined #nimrod |
13:06:18 | BitPuffin | Araq: and reading causes no lock? |
13:07:02 | Araq | what do you mean? myPointer[] surely doesn't lock |
13:07:15 | BitPuffin | yeah that |
13:07:17 | BitPuffin | cool |
13:07:21 | BitPuffin | well hrm |
13:08:00 | BitPuffin | I guess to get the data from thread to thread (even if nobody is owning, just the thread that is really controlling it) I should still send it through a message |
13:09:01 | Araq | you can do that, yes |
13:09:20 | BitPuffin | Araq: does actors have the same kind of inefficiency? Like if I want to generate 100 trees, is it fine to use 100 threads for that? |
13:09:50 | BitPuffin | I'll probably be using both but for different purposes |
13:10:43 | * | DAddYE quit (Ping timeout: 250 seconds) |
13:10:53 | Araq | actors have some shitty thread abstraction, so you create a thread pool of N that work on the tasks |
13:11:36 | Araq | so it would use N threads to work on 100 trees |
13:11:54 | BitPuffin | yeah sure my computer sure as hell don't have 100 cores or whatever |
13:12:21 | BitPuffin | so it doesn't make that much sense to use 100 threads |
13:12:35 | BitPuffin | or oh it doesn't adjust automatically? |
13:12:51 | Araq | nope |
13:14:07 | BitPuffin | well, I guess one could get that with some system call |
13:14:33 | Araq | so why do I say it's a "shitty" abstraction? good question. It's because there is thread-local storage but not task-local storage. |
13:15:09 | BitPuffin | mm gotcha |
13:15:23 | BitPuffin | you mean that multiple actors might be able to access the same memory |
13:15:34 | Araq | and people spend lots of work to make thread local storage as efficient as possible. That's hard to get with task-local storage. |
13:15:53 | BitPuffin | goroutines xD |
13:16:03 | * | BitPuffin prepares to get slapped |
13:16:15 | * | Araq slaps BitPuffin |
13:16:19 | BitPuffin | ouch |
13:18:58 | BitPuffin | I wonder if I should even spend the time to make this game so heavily threaded |
13:19:02 | BitPuffin | I mean it's kind of cool |
13:19:14 | BitPuffin | but really it's not a heavy mega super game |
13:19:28 | Araq | don't thread it then |
13:19:34 | fowl | lets replace error messages with haikus |
13:19:38 | BitPuffin | ofc some things should be threaded |
13:19:46 | BitPuffin | like generating trees etc |
13:19:48 | Araq | especially if you have a deadline to meet |
13:20:00 | BitPuffin | but maybe sending messages etc to a rendering thread is overkill |
13:20:01 | BitPuffin | I do |
13:20:26 | Araq | I'd rather optimize after profiling and still keep everything single threaded |
13:20:41 | Araq | though admittedly somethings are easier when you use threads |
13:20:47 | BitPuffin | how come? |
13:21:15 | Araq | because multithreading in a domain where global state abounds simply is no fun |
13:21:29 | Araq | and games are all about global state |
13:21:42 | BitPuffin | yeah |
13:21:48 | BitPuffin | I mean you can thread some things easily |
13:22:02 | BitPuffin | like loading assets etc |
13:22:40 | fowl | hehe |
13:22:42 | fowl | "ass"ets |
13:23:16 | BitPuffin | but for some reason it can get really difficult to thread things like physics simulation and AI etc. Which is weird considering how those things surely aren't single threaded in real life :P |
13:23:19 | fowl | libjit, if anyone cares: https://gist.github.com/fowlmouth/7841229 |
13:23:43 | BitPuffin | fowl: make something you can sell instead |
13:23:51 | fowl | BitPuffin, are you saying string theory is not threads? |
13:24:55 | fowl | BitPuffin, im not good at selling things |
13:25:04 | fowl | or making things |
13:25:32 | BitPuffin | fowl: sure you are. Just make some lame android/ios game or something and sell it for a buck |
13:25:50 | fowl | but i hate java and dont own the mac |
13:26:18 | BitPuffin | fowl: you don't need java and you don't need mac for android |
13:26:38 | BitPuffin | fowl: use the ndk |
13:26:46 | BitPuffin | set yourself a deadline of like 1 month |
13:26:46 | fowl | im pretty sure you need at least some java for android and i was talking about mac for iso |
13:27:30 | BitPuffin | fowl: well maybe a line or two I dunno. Not something that you need to write yourself, doesn't gradha already have samples for it on github? steal it |
13:27:41 | BitPuffin | https://github.com/gradha/nimrod-on-android |
13:28:31 | Araq | fowl: semicolons? you'll burn in hell for this one ... ;-) |
13:28:47 | fowl | there is like no nimrod in Nimrod/examples/cross_calculator/android |
13:28:58 | BitPuffin | you'll figure it out |
13:29:07 | BitPuffin | stop the excuses and get to it :) |
13:29:39 | BitPuffin | I have to go |
13:29:42 | BitPuffin | but I'll be portable |
13:29:55 | fowl | Araq, its copied from a c example |
13:30:03 | Araq | fowl: I know |
13:30:06 | PortablePuffin | awwwwww yeeeeeee |
13:31:16 | Araq | PortablePuffin: your son surely is straining sometimes |
13:34:07 | * | BitPuffin quit (Ping timeout: 250 seconds) |
13:35:05 | PortablePuffin | Araq: Yes, I'm gonna give him a real beating later on |
13:39:18 | PortablePuffin | fowl: seriously though do some project like that. It can only cause good things! |
13:40:32 | fowl | i dont want to write java |
13:40:41 | fowl | not now, not never |
13:41:31 | Araq | see you later guys |
13:41:36 | PortablePuffin | fowl: *sigh* you only need to bootstrap with java |
13:41:36 | fowl | cya |
13:42:09 | fowl | PortablePuffin, ive talked about this at length with grADHa, you have to write 99% java |
13:42:33 | PortablePuffin | fowl: what! how come |
13:43:34 | PortablePuffin | doesn't sound right |
13:44:06 | PortablePuffin | compile nimrod to java lol |
13:44:38 | PortablePuffin | fowl: jruby? |
13:47:09 | fowl | i thought about that but ive been in ruby channels long enough to see enough complains about jruby to know that it suxx |
13:48:09 | PortablePuffin | haha |
13:48:18 | PortablePuffin | well maybe that's changed |
13:54:42 | * | PortablePuffin quit (Ping timeout: 246 seconds) |
14:02:15 | * | PortablePuffin joined #nimrod |
14:04:34 | * | dyu joined #nimrod |
14:06:09 | * | PortablePuffin quit (Read error: Connection reset by peer) |
14:07:16 | * | io2 quit () |
14:07:43 | * | DAddYE joined #nimrod |
14:11:23 | * | radsoc joined #nimrod |
14:11:50 | * | DAddYE quit (Ping timeout: 240 seconds) |
14:13:50 | radsoc | Hi, has anybody tried 'eval'? I get: Error: undeclared identifier: 'eval'. eval is part of system, no? |
14:27:33 | Kooda | Hm, I have something odd happening at runtime |
14:28:20 | Kooda | I have a type which is an object of 4 uint32, when I try to fill it I get “(invalid data!)” in all the fields, what does it mean? |
14:36:05 | * | dyu quit (Ping timeout: 250 seconds) |
14:40:04 | fowl | Kooda, repr() derps on uints, it always shows (invalid data!) |
14:40:15 | Kooda | Ah… |
14:40:49 | fowl | did you report the bug you found yesterday |
14:41:13 | Kooda | No, I think it already exists |
14:42:00 | Kooda | Well, there’s a lot of integers related PR |
14:45:07 | Kooda | fowl: also, why is the rational behind discouraging the use of unsigned integers? :o |
14:45:11 | Kooda | what is* |
14:45:33 | Kooda | I *have* to work with them, and it’s pretty painful |
14:45:55 | Kooda | (I have to use pointers and unsigned integers of various sizes ^^') |
14:49:37 | fowl | hmm import unsigned |
14:49:46 | Kooda | Yes yes, but why? :Þ |
14:50:11 | Kooda | Also, I use ntohl(), which is for int32 in nimrod but uint32 in C… That’s confusing |
14:50:35 | Kooda | Both should exist, imo. |
14:55:24 | fowl | nimrod has ntohl? |
14:57:45 | Kooda | In sockets |
14:58:30 | fowl | radsoc, eval is disabled |
14:59:50 | radsoc | thanks fowl! Do you know why? I have to use a macro? |
15:00:41 | OrionPKM | jesus, -23 C out |
15:01:21 | fowl | radsoc, what are you trying to do? |
15:03:36 | Kooda | fowl: $ works for pretty printing my structure, where repr() fail |
15:03:42 | Kooda | That’s odd ^^' |
15:06:27 | radsoc | fowl, I need to duplicate a template call for different parameter values. |
15:06:44 | * | webskipper joined #nimrod |
15:07:54 | radsoc | If I use a variable I get: Error: constant expression expected |
15:08:34 | * | DAddYE joined #nimrod |
15:10:23 | fowl | Kooda, I dont see an issue for the repr problem or the uint problem you had from last night |
15:10:59 | fowl | radsoc, you mean calling a template with different parameters? you cant do this? |
15:11:48 | Kooda | fowl: ok, I’ll report them then : |
15:11:49 | Kooda | :) |
15:12:41 | * | PortablePuffin joined #nimrod |
15:13:48 | * | DAddYE quit (Ping timeout: 246 seconds) |
15:13:59 | radsoc | Yes, but I don't want to type: myTemplate(1) myTemplate(2) myTemplate(3) and so on. I'd like to have: for i in 1.100: eval("myTemplate(" & $i &")") |
15:14:48 | fowl | mytemplate(i) doesnt work? |
15:20:21 | radsoc | No, I get: "Info: instantiation from here" and "Error: constant expression expected" because somewhere in my template code I have array[0..i, char]. I want to duplicate the code inside my template so I need multiple const, not a var. |
15:21:26 | radsoc | does it make sense? |
15:21:41 | fowl | radsoc, arrays are fixed sized |
15:21:41 | * | PortablePuffin quit (Read error: Connection reset by peer) |
15:21:48 | * | PortablePuffin joined #nimrod |
15:21:58 | fowl | you cannot say in this iteration i want the array to hold 2, the next one i want it to hold 3 |
15:22:00 | * | EXetoC joined #nimrod |
15:22:37 | fowl | you can replace it with a seq (use newseq[char](i+1) to get the same effect) |
15:22:39 | radsoc | No, I want the code to be duplicated at compile time |
15:25:13 | radsoc | I can't use a seq in my configuration. We had a conversation about that with Araq yesterday. |
15:26:02 | dom96 | Perhaps you should use a macro to generate those template calls. |
15:26:42 | dom96 | You should be able to use 'emit' in a macro to do what you want. |
15:27:44 | fowl | well if you {.unroll.} the loop then you should be able to do this, but i just tested it and it doesnt work |
15:28:03 | radsoc | dom96: I tried emit but I also get Error: undeclared identifier: 'eval' |
15:29:06 | fowl | i will write something for you.. one sec |
15:30:53 | dom96 | radsoc: how did that happen? Are you emitting 'eval'? |
15:31:13 | Araq | I removed system.eval as I couldn't see the point of it |
15:31:21 | Araq | we have 'static' for it now |
15:31:34 | Araq | and "eval" is a confusing name |
15:32:09 | * | joelmo joined #nimrod |
15:33:33 | Araq | hi joelmo welcome |
15:33:46 | fowl | radsoc, try this: https://gist.github.com/fowlmouth/aa06e723494708c8d21b |
15:33:57 | joelmo | hi Araq, thank you :) |
15:34:02 | Araq | radsoc: you surely could use a sequence but I can't see that being faster than a string |
15:34:04 | radsoc | dom96: no I didn't emit an 'eval' but I guess emit calls eval |
15:34:30 | Araq | good point, I'll remove emit too then |
15:35:53 | dom96 | Araq: er, perhaps you should deprecate it? |
15:36:09 | Araq | Kooda: unsigned arithmetic is brain dead, http://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/ |
15:37:30 | Araq | dom96: in general I agree with you, but in this case I find both eval and emit too annoying to provide a deprecation path |
15:37:48 | Araq | I could move 'eval' to macros.nim I guess |
15:38:13 | radsoc | fowl: thanks, I'll try to understand your gist! |
15:38:44 | fowl | radsoc, you can add at the end of the macro "echo(repr(result))" to see the resulting code |
15:39:22 | dom96 | Araq: Fair enough |
15:39:50 | * | PortablePuffin quit (Ping timeout: 240 seconds) |
15:39:58 | Araq | fowl: the 'unroll' pragma does nothing currently |
15:40:08 | Araq | and the docs say so |
15:41:26 | fowl | oh |
15:41:45 | OrionPKM | you shouldnt be too afraid of breaking code :P |
15:41:51 | OrionPKM | it's < 1.0 still |
15:42:16 | * | XAMPP_ quit (*.net *.split) |
15:42:17 | * | noam quit (*.net *.split) |
15:42:17 | * | reactormonk quit (*.net *.split) |
15:43:13 | radsoc | Araq: eval syntax is a lot simpler than macro (from a user point of view) |
15:43:18 | * | PortablePuffin joined #nimrod |
15:43:38 | * | PortablePuffin2 joined #nimrod |
15:43:38 | * | PortablePuffin quit (Read error: Connection reset by peer) |
15:44:09 | radsoc | moving 'eval' to macros.nim would be great |
15:44:11 | Araq | oh really? how come you used it wrong then? :P |
15:44:25 | Araq | (eval takes a block and not a string) |
15:48:22 | * | reactormonk joined #nimrod |
15:48:42 | * | BitPuffin joined #nimrod |
15:49:21 | BitPuffin | hay ho! hay ho! |
15:50:00 | BitPuffin | Araq: eval takes a brock and not a sling |
15:51:32 | radsoc | I tried emit first (with a string) and didn't change when I tried with eval. But BTW none of them works! |
15:51:54 | BitPuffin | radsoc: try using admit instead |
15:53:47 | radsoc | Araq: I don't think anybody needs both (emit & eval) |
15:54:20 | Araq | template emit*(e: expr[string]): stmt = |
15:54:21 | Araq | macro payload: stmt {.gensym.} = |
15:54:23 | Araq | result = e.parseStmt |
15:54:24 | Araq | payload() |
15:54:33 | Araq | now patch your macros.nim, make a pull request and be happy |
15:57:16 | radsoc | Araq: I'd like to but I'm not a github user. (actually I'm not even a real developer) |
15:57:29 | fowl | that's ok, we're not even real people |
15:57:51 | fowl | we're figures of your imagination |
15:58:22 | radsoc | I guess so! |
15:58:26 | Araq | well then wait until somebody did it; I'm working on a different branch and switching branches annoys me :-) |
15:59:45 | BitPuffin | Araq: yeah that annoys me too |
16:00:51 | BitPuffin | in fact git annoys me |
16:00:59 | BitPuffin | so I just use hg :D |
16:07:43 | fowl | git is scary |
16:08:01 | * | XAMPP_ joined #nimrod |
16:08:01 | * | noam joined #nimrod |
16:08:24 | Araq | radsoc: did you try a TCritBitTree or whatever I called it? |
16:08:50 | * | dirkk0 joined #nimrod |
16:09:56 | BitPuffin | in mercurial you do things the way you'd expect to do it |
16:10:02 | BitPuffin | and things are called what you'd expect |
16:10:09 | * | webskipper quit (Ping timeout: 246 seconds) |
16:10:13 | BitPuffin | like subrepository instead of submodule |
16:10:45 | fowl | do they automatically download with the repository when you clone it |
16:10:51 | * | DAddYE joined #nimrod |
16:11:03 | fowl | or do you have to do something like git submodule init |
16:11:30 | Zuchto | Hi, I'm trying to figure out how to statically link a library to my nimrod application. Is there any documentation on this? |
16:11:48 | BitPuffin | fowl: not sure |
16:12:33 | fowl | Zuchto, you have {.passl: "-lyourlib".} and use {.header: "myheader.h".} on things you {.importc.} |
16:12:59 | BitPuffin | "Notably, the 'pull' command is by default not recursive. This is because Mercurial won't know which subrepos are required until an update to a specific changeset is requested. The update will pull the requested subrepositories and changesets on demand. To get pull and update in one step, use 'pull --update'. " |
16:13:02 | * | zielmicha joined #nimrod |
16:13:03 | fowl | Zuchto, heres an example https://gist.github.com/fowlmouth/7841229#file-jit-nim-L19 |
16:13:36 | Zuchto | fowl: ah, ok. Thanks! |
16:13:44 | radsoc | Araq: I tried to copy paste your code but I get: macros.nim(226, 8) Warning: unknown magic 'NGenSym' might crash the compiler [UnknownMagic] / macros.nim(225, 11) Error: implementation of 'macros.genSym(kind: TNimrodSymKind, ident: string): PNimrodNode' expected |
16:14:24 | BitPuffin | fowl: there is an important difference there though, hg update is a common command to changing to different change sets so it would pull the subrepos you need |
16:14:57 | BitPuffin | fowl: update has the aliases up, checkout, c so you know what it is |
16:15:02 | * | DAddYE quit (Ping timeout: 240 seconds) |
16:15:18 | Zuchto | fowl: is the LinkStatically defined by some compiletime switch? |
16:15:48 | BitPuffin | fowl: oh wait this is with pulling |
16:15:54 | BitPuffin | that doesn't answer your question lol |
16:16:51 | BitPuffin | fowl: meh I'll just test it for you |
16:17:24 | fowl | Zuchto, in this example linking statically is enabled by passing -d:linkstatically |
16:17:48 | Araq | radsoc: alright, will have a look later |
16:20:25 | Zuchto | fowl: ok, thanks |
16:21:06 | radsoc | Araq: thanks, no problem |
16:23:36 | BitPuffin | fowl: it clones them by default |
16:24:05 | BitPuffin | fowl: and you can have git and svn subrepos |
16:26:11 | BitPuffin | fowl: also you don't have to add each file before every commit |
16:26:37 | fowl | usually i dont add every file in a commit |
16:26:59 | BitPuffin | well I mean you don't need to do hg add . |
16:27:35 | BitPuffin | ofc if you just want to commit some files you can |
16:27:54 | BitPuffin | hg commit src/graphics/*.nim |
16:28:13 | BitPuffin | hg commit src/io/network.nim src/main.nim |
16:28:18 | fowl | oh |
16:28:32 | fowl | how do you handle wchar_t* |
16:28:45 | BitPuffin | oh wait for the glob syntax you use -I before |
16:28:50 | BitPuffin | or --include |
16:28:52 | * | zielmicha1 joined #nimrod |
16:29:25 | BitPuffin | but you don't need -I for a dir |
16:29:34 | * | boydgreenfield joined #nimrod |
16:29:47 | Araq | zielmicha1: I'd argue for stdout for stack traces ... |
16:30:22 | Araq | "gah, can't read the error messages" |
16:30:29 | * | zielmicha quit (Ping timeout: 250 seconds) |
16:30:30 | Araq | ./foo >output.txt |
16:30:49 | Araq | "wtf? doesn't work?" |
16:31:14 | Araq | "oh right, 'stderr' is the 'correct' way of doing it. thanks for that, gcc" |
16:31:31 | Araq | "how do I redirect stderr again? no idea, let me google it" |
16:31:41 | BitPuffin | Araq: which year were you born? |
16:31:48 | fowl | 2&>1 or something like that |
16:32:25 | Araq | BitPuffin: that's none of your business |
16:33:48 | Araq | input vs output makes some sense, input vs output vs error stream is stupid IMHO |
16:33:52 | BitPuffin | Araq: too bad, I thought it would be nice to have a slogan for you like "Araq, slapping developers since <insert year>" |
16:34:26 | Araq | why errors? what if I have warnings too? |
16:36:02 | zielmicha1 | Araq: then redirects are useless for everything else other than manual inspection |
16:36:12 | * | zielmicha1 is now known as zielmicha |
16:36:43 | Araq | zielmicha: they already are useless, most programs have something like --out:filename |
16:36:44 | zielmicha | Araq: and you know there is "2>&1" and even "&>" in bash |
16:37:14 | Araq | programs dumbing their results on stdout are not common anymore anyway |
16:37:21 | Araq | *dumping |
16:37:41 | zielmicha | so you know any language than prints stacktraces to stdout? |
16:38:37 | Araq | well I know GCC is annoying with its approach to "correctness" |
16:39:18 | zielmicha | well, GCC is a compiler, not a runtime |
16:39:37 | Araq | stack traces are arguably not really part of the runtime |
16:40:15 | Araq | however I can live with a patch that uses stderr but allows me to override with -d:useStdoutForStackTraces or something |
16:40:38 | zielmicha | ok, I will write one |
16:42:28 | zielmicha | and "stackTraceNewLine*: string ## undocumented feature; it is replaced by ``<br>``" is a really bad idea |
16:42:59 | zielmicha | if user can controll error message than he may write <script>doevilthings</script> to html if he manages to cause error |
16:43:04 | zielmicha | unless I'm missing something |
16:43:12 | Araq | it's really nice for cgi apps |
16:43:35 | Araq | which are so uncommon these days that we could remove it, I guess |
16:43:39 | zielmicha | better solution would be "var printBeforeStacktrace" |
16:43:49 | zielmicha | and use printBeforeStackTrace = "<plaintext>" |
16:43:51 | Araq | that misses the point though |
16:43:59 | Araq | oh wait |
16:44:01 | Araq | hmm |
16:44:48 | Zuchto | So, when dynamically linking to a library using the {.dynlib.} pragma it doesn't show up when i then run ldd on the executable. Could someone explain this to me? |
16:44:54 | Araq | well I dunno, I can't see how a user can affect stackTraceNewLine |
16:45:14 | Araq | Zuchto: nimrod uses dlsym to load symbols |
16:47:10 | Zuchto | Araq: ok, is there any way to have nimrod actually add the library as a dynamically linked dependency then? |
16:47:23 | Araq | Zuchto: there are lots of ways |
16:47:54 | Araq | you can use --dynlibOverride:foo and --passL:libfoo.a instead |
16:48:23 | Araq | you can use --verbosity:2 at compile time to see the dependencies |
16:48:45 | Araq | ok ... that's about it I guess ;-) |
16:49:09 | fowl | wchar_t* in nimrod, how? |
16:49:34 | Araq | zielmicha: so users can crack stackTraceNewline but not printBeforeStackTrace? how does that work? |
16:49:55 | zielmicha | Araq: <plaintext> is special, it causes browser to stop interpreting HTML |
16:50:03 | zielmicha | you can't close it |
16:50:22 | zielmicha | thought this is non-standard |
16:50:27 | Araq | zielmicha: so? I can make it <script>evil</script> instead according to you? |
16:51:27 | zielmicha | I mean, if you use: raise newException(MyError, "invalid user input: $1" % [somethingControlledByUser]) |
16:51:40 | Zuchto | Araq: hmm, I think I was unclear about what I was actually asking for :) If I have libfoo.so as a dynamic dependency, is there any way to have this be listed when I do `ldd executable`? |
16:52:08 | zielmicha | and user provides somethingControlledByUser="<script>evil</script>" than it will go to stdout with stacktrace |
16:52:27 | zielmicha | and browser will interpret it (I think, I haven't read cgi module source) |
16:52:28 | Araq | Zuchto: I don't think so, but as I said you can link in a conventional way too |
16:52:48 | fowl | stacktracefilter: proc(x: string): string |
16:52:49 | Zuchto | Araq: ok, thanks for taking your time :) |
16:52:59 | fowl | set it to htmlentities() in cgi.nim |
16:53:20 | zielmicha | Zuchto: maybe {passl: "-lmylib"}? |
16:53:23 | Araq | fowl: that's what I fear too |
16:53:46 | Zuchto | zielmicha: but that would just statically link the library, yes? |
16:54:05 | zielmicha | no (assuming you don't pass -static to compiker) |
16:54:11 | Araq | zielmicha: alright fair point, but that doesn't argue against stackTraceNewLine at all |
16:54:28 | Araq | but against exception messages being not escaped |
16:54:56 | zielmicha | yes, but than we can have fowl's stacktracefilter than will do htmlspecialchars(foo) & "<br>" |
16:55:35 | zielmicha | and do the same without need for stackTraceNewLine |
16:55:50 | zielmicha | and I think this is not enough |
16:55:52 | Zuchto | zielmicha: ah, thanks! |
16:55:59 | Araq | ok, I'm sold |
16:56:22 | zielmicha | Python's cgitb.py has complicated code than closes headers, <script> tags, html comments |
16:56:41 | zielmicha | (i.e. what happens if exception happens when you are echoing <script> tag?) |
16:57:35 | fowl | well you could just replace \L with <br/> in the filter function, or wrap the trace in <pre> or w/e |
17:00:23 | zielmicha | (https://github.com/python-git/python/blob/master/Lib/cgitb.py#L30) |
17:01:42 | * | fundamental2 joined #nimrod |
17:03:42 | Araq | well I dunno. a filter function looks good but requires more discussions/thought |
17:03:48 | Araq | but bbl |
17:05:07 | * | fundamental quit (Ping timeout: 260 seconds) |
17:06:13 | * | q66_ joined #nimrod |
17:06:18 | * | hoverbear joined #nimrod |
17:06:39 | * | q66 quit (Disconnected by services) |
17:06:41 | * | q66_ is now known as q66 |
17:08:45 | * | mflamer joined #nimrod |
17:12:02 | * | DAddYE joined #nimrod |
17:16:14 | * | DAddYE quit (Ping timeout: 240 seconds) |
17:26:48 | * | PortablePuffin2 quit (Ping timeout: 246 seconds) |
17:30:55 | radsoc | fowl: the code you gave me works great. thanks a lot. |
17:37:13 | Zuchto | Ok, yet another question about linking. I can statically link a library using {.passl: "/usr/lib/libfoo.a".} and that works great... but it means I have to actually specify that the library is in /usr/lib... can I somehow tell the compiler to search for the file where it expects to find it? |
17:37:29 | Zuchto | similar to how the "-lfoo" flag works |
17:37:47 | zielmicha | I think you can't, without -static (and then just use -lfoo). |
17:37:48 | fowl | idk, i was under the impression that -lfoo was static linking |
17:37:59 | fowl | <- drunk |
17:38:04 | * | PortablePuffin joined #nimrod |
17:38:06 | zielmicha | but probably there is a script like ldconfig which can find it |
17:38:09 | Zuchto | zielmicha: yeah, only problem with -static is that it statically links _everything_ |
17:38:34 | Zuchto | fowl: no, it just adds it as a dynamic dependency (which is statically listed in the executable :)) |
17:43:45 | Zuchto | oh, figured it out! by passing "-Wl,-static -lfoo -Wl,-Bdynamic" to the compiler it works as it should... at least in gcc :) |
17:58:52 | Amrykid | fowl, I saw your PR |
17:59:04 | Amrykid | merged it |
18:00:38 | * | ics quit (Ping timeout: 250 seconds) |
18:05:35 | * | ics joined #nimrod |
18:13:14 | * | DAddYE joined #nimrod |
18:17:26 | * | DAddYE quit (Ping timeout: 240 seconds) |
18:18:41 | fowl | yay |
18:18:46 | fowl | i contributed^^; |
18:20:50 | EXetoC | BitPuffin: I don't know when you added the warning to TStream, but pointer should be the same thing as void*: both are pointers to untyped memory |
18:21:33 | EXetoC | I'm trying to port one of the examples now. some error is being raised though |
18:21:57 | * | Hannibal_Smith joined #nimrod |
18:22:45 | BitPuffin | EXetoC: I haven't added a warning :o |
18:22:59 | BitPuffin | or do you mean a comment? |
18:23:28 | * | boydgreenfield quit (Quit: boydgreenfield) |
18:23:39 | EXetoC | BitPuffin: ok warning comment |
18:24:44 | BitPuffin | EXetoC: uh, I can't remember what the reasoning I came up with was |
18:24:45 | Araq | thinking about it some more ... we need an "exceptionMessageFilter" instead |
18:25:06 | BitPuffin | EXetoC: I know that there is one place that takes a *void though and 2 or so that takes **void |
18:25:06 | Araq | it doesn't make sense to filter stack traces the same way as user level error messages |
18:25:15 | BitPuffin | so TStream = pointer |
18:25:20 | BitPuffin | used where it's a *void |
18:25:26 | BitPuffin | and PStream = ptr TStream |
18:25:31 | BitPuffin | used where it's a **void |
18:25:33 | BitPuffin | or something like that |
18:26:29 | BitPuffin | EXetoC: would be awesome if you figured out the error and patched it if there is a problem with the binding |
18:26:53 | EXetoC | yes, so PStream only serves as documentation. still useful in other words |
18:27:08 | BitPuffin | I'm currently working on graphics for my engine since you guys are only horny for screenshots and not soundshots |
18:27:21 | * | mflamer quit (Ping timeout: 246 seconds) |
18:27:24 | BitPuffin | EXetoC: Yeah and sprinkling some typing on it or something like that |
18:27:26 | fowl | protip: dont use type X = pointer because type X functions match for other generic pointers |
18:27:33 | fowl | use "ptr object" |
18:27:36 | EXetoC | I don't think there's anything wrong with the related types in the binding, but I will try the C example |
18:28:03 | EXetoC | fowl: when the equivalent in C is void*? |
18:28:24 | EXetoC | which it is, but I'll see if it makes sense to introduce a dummy type |
18:28:38 | Araq | but ... generating stack traces and making them part of the generated HTML is horrible really. I guess CGI needs a stderr stream lol |
18:29:37 | Araq | oh well who uses cgi in production these days anyway |
18:29:39 | fowl | EXetoC, at least use distinct pointer, the downside to thise is you have to borrow functions like isNil whereas ptr object just works |
18:31:01 | Araq | fowl: people should pay you for giving "nimrod - best practices" |
18:32:04 | fowl | i know right |
18:32:18 | fowl | mail me the change you found under your couch, you werent using it |
18:48:33 | fowl | Zuchto, thanks |
18:50:27 | * | radsoc quit (Ping timeout: 250 seconds) |
18:50:58 | Araq | fowl: there is system.WideCString |
18:51:27 | Araq | and newWideCString("foo") |
18:52:11 | fowl | i dont see wideCstring in system |
18:52:37 | Araq | well there is system/widestrs.nim and it's included |
18:52:43 | Araq | but maybe only on windows :P |
18:53:44 | Zuchto | fowl: likewise |
18:58:43 | * | webskipper joined #nimrod |
19:07:03 | zielmicha | maybe something like Python's sys.excepthook would make sense, instead of filters |
19:07:18 | zielmicha | sys.excepthook is a function that is called when interpreter would print stacktrace |
19:08:31 | zielmicha | the cgi one could, for example "<pre>"getStacktraceToString().htmlspecialchars |
19:08:44 | zielmicha | and than echo it |
19:09:22 | zielmicha | it's better than message filter in that it could for example generate html by inspecting frames manually (if it's supported) |
19:10:26 | fowl | so the default exception hook would be stderr.write(backtrace())? |
19:13:06 | zielmicha | yes |
19:13:42 | zielmicha | (other possible use case: error reporting to central error reporting service like Sentry) |
19:14:12 | Araq | actually we already have a raiseHook for that |
19:14:28 | * | DAddYE joined #nimrod |
19:16:55 | * | PortablePuffin quit (Ping timeout: 246 seconds) |
19:18:40 | * | DAddYE quit (Ping timeout: 246 seconds) |
19:19:02 | Araq | and btw hooks suck for verification |
19:20:46 | zielmicha | localRaiseHook and globalRaiseHook are not the same |
19:21:30 | zielmicha | they are called even if there are pending try..except, if I understand code correctly |
19:23:07 | * | viteqqq joined #nimrod |
19:23:10 | Araq | hmm true |
19:23:15 | Araq | hi viteqqq welcome |
19:24:47 | viteqqq | hi there |
19:32:06 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
19:33:37 | OrionPKM | araq are there any examples of using CaaS TCP server? |
19:33:57 | Araq | there are lots of tests |
19:34:24 | OrionPKM | I see the tests folder, but none of them seem to actually show connecting to the service, maybe i'll look more closely |
19:38:11 | fowl | http://adamralph.com/2013/12/06/ndc-diary-day-3/?1 |
19:38:14 | fowl | new stuff in c# |
19:41:34 | Hannibal_Smith | I'm a C# programmer, and I can't find anything that would make my code better |
19:42:41 | * | DAddYE joined #nimrod |
19:42:44 | * | DAddYE quit (Remote host closed the connection) |
19:42:50 | * | DAddYE joined #nimrod |
19:43:19 | fowl | now your one line functions don't need braces |
19:43:44 | Hannibal_Smith | And create more style inconsistency |
19:45:34 | Hannibal_Smith | Previous version of the language, at least added some good addiction for "daily use" code |
19:45:46 | Hannibal_Smith | Like Linq, async, dynamic... |
19:45:56 | Hannibal_Smith | Now I have nothing |
19:46:06 | fowl | you still have those things :D |
19:46:14 | Hannibal_Smith | Probably there is more that MS are keeping secrets |
19:46:37 | Hannibal_Smith | fowl, after using C++...I really like generic programming |
19:47:11 | Hannibal_Smith | fowl, probably now the think I would like is a jit like the OracleVM one |
19:47:22 | Hannibal_Smith | Not more language features |
19:48:02 | Hannibal_Smith | *the thing |
19:50:16 | Hannibal_Smith | Ah fowl and probably, some people migrated from C# to F# |
19:51:06 | Hannibal_Smith | Probably the same people who in the past would use some of these new features |
19:51:34 | Hannibal_Smith | But now get directly a better language |
19:51:52 | Hannibal_Smith | And not a "blob" that is C# |
20:19:40 | * | PortablePuffin joined #nimrod |
20:21:45 | Zuchto | Question: If you want to pass a structure as through a function in a C library that will populate the structure with information (in other word, the C function doesn't store a pointer to the structure) would there be any case where the structure (in nimrod) still has to be a ptr rather than a ref? |
20:26:25 | EXetoC | PortablePuffin: ok I hear some horrible noise now |
20:26:38 | EXetoC | should sound like a saw wave, but at least it's working |
20:27:55 | * | Hannibal_Smith quit (Quit: Sto andando via) |
20:46:25 | Araq | Zuchto: when you can 'new' it, you can make it a 'ref' |
20:49:35 | Zuchto | Araq: Yes, but I guess what I'm asking for is if there are any sneaky edge-cases where you would think you could use a ref but you really should use a ptr... but I guess it's a bit too wide question for it to be meaningful. |
20:49:56 | OrionPKM | araq couldnt find anything about testing the caas tcp server |
20:50:03 | OrionPKM | just stdin |
20:51:51 | Araq | how do you start a new terminal? clicking on your shortcut icon in the task bar was the old way |
20:52:15 | Araq | now I have to type in "cmd" in the search field to get a fresh terminal. Thank you Microsoft. |
20:52:51 | Araq | And thank you too Apple for showing the world how to ruin a task bar. |
20:53:09 | Araq | of cource everybody needs to copy Apple's braindead and utterly broken approach. |
20:53:35 | OrionPKM | i'm hitting it from python |
20:54:10 | Araq | OrionPKM: now that I got a new terminal, I could grep for it ;-) |
20:54:21 | Araq | have a look at compiler/service.nim |
20:54:44 | EXetoC | Zuchto: can't think of any reasons why it'd cause any problems in that case |
20:54:50 | EXetoC | anyway, maybe you could wrap the pointer |
20:56:02 | OrionPKM | araq hmm, ok |
20:56:02 | Araq | Zuchto: it really depends on who allocates the memory. If the C library allocates, you can't use a 'ref' |
20:56:44 | Araq | good libraries provide both Foo* newFoo() and void initFoo(Foo* f) |
20:57:10 | Araq | unfortunately there are barely any good libraries around |
20:57:13 | Zuchto | then i really wish more libraries where good :P |
20:57:37 | Zuchto | ok, thanks for answering my very vague question :) |
20:58:23 | Araq | hey, it's C everything can talk to C. No need for good libraries when you're building on a fundament of ignorance. |
20:58:58 | OrionPKM | araq huh.. it crashes when I run from cmd line vs running it from a subproc in ST |
20:59:49 | Araq | OrionPKM: well the people who could develop it further are busy patching Nimrod to become more like haskell. ;-) |
21:00:02 | OrionPKM | lol |
21:03:04 | * | brson joined #nimrod |
21:05:40 | * | brson_ joined #nimrod |
21:08:47 | * | oszo joined #nimrod |
21:08:53 | Araq | hi oszo welcome |
21:09:10 | OrionPKM | araq, getting this: 'N_NOINLINE' # define N_NOINLINE(rettype, name) rettype __attribute__((noinline)) name |
21:09:14 | OrionPKM | runtime error |
21:09:26 | * | brson quit (Ping timeout: 240 seconds) |
21:09:38 | * | oszo quit (Client Quit) |
21:09:55 | Araq | OrionPKM: idetools is supposed to run the C compiler |
21:09:59 | Araq | *is not |
21:10:24 | OrionPKM | strange then |
21:10:34 | OrionPKM | gcc.exe: error: E:\Development\IRCFamiliar\trunk\src\nimcache\trunk_.o: No such file or directory |
21:10:38 | OrionPKM | thats happening at runtime |
21:10:38 | * | viteqqq_ joined #nimrod |
21:12:39 | * | viteqqq quit (Read error: Connection reset by peer) |
21:12:57 | Araq | EXetoC: fyi http://critical.eschertech.com/2010/05/26/specification-with-ghost-functions/ |
21:13:20 | Araq | this has 'pre' and 'post' conditions and they are verified, not sugar for 'assert' |
21:15:03 | Zuchto | so the overload resolution doesn't look at expected return type or if the procedure is exported? |
21:16:17 | Zuchto | oh wait... the problem isn't related to export |
21:16:20 | Zuchto | my mistake |
21:16:24 | * | PortablePuffin quit (Ping timeout: 246 seconds) |
21:27:24 | * | ics joined #nimrod |
21:47:28 | * | PortablePuffin joined #nimrod |
21:51:01 | zielmicha | Araq: what about merging https://github.com/Araq/Nimrod/pull/702 (quoteIfContainsWhite)? Does it need improvements? Or should I squash commits? |
21:52:49 | Araq | make the 'let safeUnixChars' a 'const' please and it's perfectly fine |
21:56:58 | zielmicha | done |
21:59:54 | NimBot | Araq/Nimrod master 5dd5c78 Michał Zieliński [+0 ±2 -0]: Make quoteIfContainsWhite quote argument, so it can be safely passed to shell.... 6 more lines |
21:59:54 | NimBot | Araq/Nimrod master 887466d Andreas Rumpf [+0 ±2 -0]: Merge pull request #702 from zielmicha/master... 2 more lines |
22:00:27 | Araq | thanks for nagging btw, it's bad to not merge pull requests in a timely fashion |
22:01:16 | * | mflamer joined #nimrod |
22:01:41 | Araq | mflamer: you have a new job |
22:01:47 | Araq | congrats |
22:02:07 | Araq | people really want idetools to work ... ;-) |
22:02:31 | Araq | and you're definitely up for the task I think |
22:03:42 | Araq | zielmicha: instaed of let output = when defined(useStdoutForStackTraces): stdout else: stderr |
22:03:53 | Araq | I'd prefer: |
22:04:18 | Araq | when defined(weReallyHateStdErr): |
22:04:29 | Araq | template stdmsg*: expr = stdout |
22:04:30 | Araq | else: |
22:04:35 | Araq | template stdmsg*: expr = stderr |
22:04:53 | Araq | for system.nim :-) |
22:05:21 | zielmicha | maybe you just need to patch kernel to pipe fd 2 to fd 1? |
22:05:22 | EXetoC | https://gist.github.com/EXetoC/528d88cfa5bc2ca69b19 this crashes on line 21. cb is passed to opendefaultstream as you can see. it works when 'output' isn't a var |
22:06:07 | Araq | zielmicha: ultimately indeed I'll write my own OS :P |
22:06:14 | EXetoC | actually, maybe I don't need to modify 'output'. I need to check the C source again |
22:06:54 | EXetoC | it's incremented, right? "*out++ = data->left_phase" |
22:08:30 | Araq | EXetoC: I never checked codegen for a pointer to (a pointer to?) a function |
22:09:09 | Araq | iirc (*fn)() is the same as fn() in C and it wents downhill from there (who said C is good at pointers?) |
22:16:59 | * | PortablePuffin quit (Ping timeout: 246 seconds) |
22:18:37 | Zuchto | Is it possible to dereference a variable that I've declared as a ref? My code is essentially: "var a: ref TFoo ; new(a) ; some_c_function(a) ; result = a" and I want the returning value to be an actual object, not a reference. |
22:23:03 | Araq | some_c_function(a[]) |
22:23:11 | EXetoC | Araq: no, output is "void *outputBuffer", but it doesn't matter because what I was trying to do makes no sense |
22:24:00 | Araq | apperently fn() is the same as (*fn)() but when you need a pointer to that you have no choice but to use (**fn)() |
22:24:39 | * | Araq needs an Ansi C standard under his pillow |
22:26:13 | zielmicha | how does compiler looks for modules? Is there a way to add directory to search path? |
22:26:29 | EXetoC | I don't think we're talking about the same thing, but it doesn't matter anymore |
22:26:48 | EXetoC | zielmicha: see the help output and nimrod.cfg |
22:26:57 | Zuchto | Araq: if a is of type [ref TFoo] then what is the type of a[]? |
22:26:59 | EXetoC | /etc/nimrod.cfg in linux |
22:27:10 | Araq | TFoo? |
22:27:16 | EXetoC | you can also create project-specific configs |
22:27:36 | zielmicha | No way to do this at compile time? |
22:27:42 | zielmicha | from macros, for example |
22:27:47 | Zuchto | Araq: ok, and I need to pass a ref TFoo into the c-function but I want to return a TFoo from the procedure, is this possible? |
22:28:29 | Araq | only with some inefficiency |
22:28:38 | Zuchto | I see |
22:28:57 | Araq | or with hacks ;-) |
22:29:30 | Araq | sounds like you want to make the C function take a ptr TFoo though |
22:29:30 | Zuchto | i guess the easiest way would be to use create a new object and copy all the values from the ref TFoo? |
22:29:44 | Zuchto | Araq: how so? |
22:30:14 | Araq | Zuchto: then you can simply use 'addr' of your TFoo value |
22:31:16 | Zuchto | hmm... ok |
22:31:34 | fowl | myref[].addr |
22:31:42 | fowl | &(*myref) |
22:31:54 | Araq | fowl: yeah but that produces a 'ptr' |
22:32:10 | * | PortablePuffin joined #nimrod |
22:32:16 | Zuchto | the unsafeness of addr wouldn't be a problem since the reference wouldn't be kept outside of the function anyways, right? |
22:32:23 | Araq | right |
22:33:11 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:37:35 | Araq | EXetoC: if proc `+=`*[T:float32|float](x: var T, y: type(x)) provides an implicit conversion of the 2nd argument but (var T, T) does not that's a bug |
22:40:03 | * | mflamer quit (Ping timeout: 246 seconds) |
22:41:29 | EXetoC | I suck at this |
22:42:39 | Araq | zielmicha: what's the status of https://github.com/Araq/Nimrod/issues/701 ? |
22:43:45 | zielmicha | with new quoteIfWhite it's no longer security issue, but the flag is still rather unfortunate |
22:44:06 | EXetoC | I think I tried to shorten the code while fixing the bug, but there's no way to get the un-qualified type, so I guess it can't be done |
22:44:32 | Araq | well I copied it over from FPC, zielmicha |
22:44:44 | zielmicha | I plan to someday add poUsePath flag and maybe make code clearer |
22:45:00 | Araq | that would be nice, osproc is my nightmare |
22:45:18 | zielmicha | Ah, I mentally copy everything from Python :) |
22:45:29 | Araq | whenever I change something there I break things for some obscure OS |
22:47:11 | Araq | took me a good deal amount of time to figure out how to use posix_spawn |
22:48:28 | Araq | was happy when I got it to work. I learned later that posix_spawn is not supported on Posix compatible OSes |
22:49:25 | OrionPKM | blarg im getting those errors with stdin as well |
22:52:03 | EXetoC | Araq: So, only the second parameter should be generic, right? and then I need to add additional overloads |
22:52:41 | * | zielmicha quit (Ping timeout: 250 seconds) |
22:53:37 | Araq | EXetoC: well I think (var T, T) should work and provide the implicit conversion for T |
22:53:57 | Araq | especially when 'type(x)' already seems to provide it |
22:54:05 | Araq | makes no sense they behave differently |
22:55:06 | * | dirkk0 quit (Quit: This computer has gone to sleep) |
22:58:49 | * | mflamer joined #nimrod |
22:59:11 | EXetoC | Araq: what I said makes no sense, and I guess you're referring to a compiler bug |
22:59:49 | Araq | lol yes |
23:03:51 | * | mflamer quit (Ping timeout: 246 seconds) |
23:17:31 | * | PortablePuffin quit (Ping timeout: 260 seconds) |
23:20:32 | * | BitPuffin quit (Quit: WeeChat 0.4.2) |
23:25:26 | EXetoC | Araq: should other procs me merged when this works? might as well just separate these functions otherwise, and not have to deal with this 'type' bug in this case |
23:27:40 | Araq | dunno. there is an important edge case which I forgot. |
23:28:13 | Araq | all I remember is that it's really important to consider "this" |
23:28:46 | Araq | where "this" is what I forgot :P |
23:30:54 | EXetoC | ok, well I'll give it a go once this is fixed |
23:31:20 | Araq | check if it already is please |
23:31:37 | Araq | I remember a change in the compiler affecting this |
23:36:18 | EXetoC | if it is a compiler bug that you were referring to, doesn't this imply that you just tested it? |
23:36:54 | EXetoC | do integers need those two sets of compiler magics, compared to the ones for all float types, that end with F64? |
23:37:44 | * | PortablePuffin joined #nimrod |
23:38:47 | Araq | gah, don't ask me now |
23:38:56 | Araq | I'm working |
23:40:51 | * | mflamer joined #nimrod |
23:47:57 | * | mflamer quit (Ping timeout: 246 seconds) |
23:49:07 | EXetoC | ok, cya later |
23:53:48 | * | mflamer joined #nimrod |
23:56:19 | * | PortablePuffin quit (Ping timeout: 260 seconds) |