00:03:32 | JinShil | Hello foks. I'm exploring Nim for use in bare-metal firmware. |
00:04:00 | JinShil | I'm wondering, is it possible to have Nim generate all the necessary code for the cruntime. |
00:04:12 | JinShil | For example crt0.o and friends. |
00:04:15 | JinShil | ?? |
00:04:55 | JinShil | I exploring the idea of using Nim without libc or the cruntime, and rather generate that code with Nim itself. |
00:06:51 | Araq | JinShil: kokozedman has some experience with this I think |
00:07:14 | Araq | but you should start with --os:standalone |
00:07:31 | Araq | and make yourself familiar with panicoverride etc |
00:08:24 | JinShil | yeah, I expect to have port some of the Nim runtime to my platform. That's ok. I did some experiments yesterday using -lib:. and adding my own system.nim. |
00:08:59 | Araq | nice |
00:09:37 | JinShil | I'm just wondering are there any dependencies on libc baked into the compiler, does all code originate with .nim files. |
00:09:55 | JinShil | ?? |
00:10:25 | Araq | there are not C files written by hand except nimbase.h |
00:11:03 | Araq | the memory manager uses mmap, but it's not hard to patch to use something else |
00:12:01 | Araq | so yes, Nim's core is the nim files in system/ |
00:12:35 | JinShil | ok, sounds promising. |
00:13:00 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
00:13:17 | JinShil | Can you elaborate just a little more on what os:standalone does? |
00:13:48 | JinShil | I can guess, but I'm looking for a little more detail. |
00:13:59 | Araq | not much, it disables lots of stuff in system.nim |
00:14:06 | Araq | you can grep for it |
00:16:23 | flaviu | > XXX This is a hack, but PCRE does not export its "free" function properly. |
00:16:36 | flaviu | Looks good to me: PCRE_EXP_DECL void pcre_free(void *); |
00:16:51 | flaviu | Can someone elaborate as to what is meant? |
00:18:32 | Araq | flaviu: pcre evolved. |
00:18:33 | * | dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:18:35 | * | aw1231 quit (Quit: Page closed) |
00:19:07 | flaviu | Ok, should pcre.nim be regenerated? |
00:19:52 | Araq | no. just add the free |
00:20:49 | * | brson quit (Ping timeout: 255 seconds) |
00:21:13 | flaviu | Interesting: http://www.pcre.org/changelog.txt |
00:21:27 | flaviu | not directly useful right now, but in 1-2 years.. |
00:24:02 | * | shodan45 quit (Ping timeout: 244 seconds) |
00:24:48 | * | yglukhov_____ quit (Quit: Be back later ...) |
00:25:49 | * | dapz joined #nim |
00:26:52 | * | infrashortfoo joined #nim |
00:29:40 | flaviu | Looks like pcre's free was changed in v8.30, so Nim doesn't support Debian Squeeze's libpcre3 |
00:29:49 | flaviu | Not that it matters much. |
00:30:00 | flaviu | err, will matter much. |
00:30:29 | flaviu | I'm getting ahead of myself. |
00:31:11 | * | infrashortfoo quit (Ping timeout: 256 seconds) |
00:36:50 | JinShil | flaviu, I just wanted to follow up on your experiment yesterday minimizing hello world |
00:37:08 | JinShil | It turns out if you add -t:-flto -l:flto you can get it reduced even more. |
00:38:20 | JinShil | Also, I found out that if you comment out `registersignalhandler_19608();` in the generated system.c file, you can get it even smaller. |
00:38:25 | JinShil | I was able to get it down to 7K. |
00:40:09 | gmpreussner | not bad |
00:40:22 | gmpreussner | time to start writing 64k demos in nim :) |
00:43:29 | JinShil | gmpreussner, I'm just exploring right now, but if Nim keeps my interest, I don't see why we can't have hello world on the order of 10s of bytes and demos less than 16k. |
00:47:10 | Araq | echo "hi" save as '.sh' or '.bat' # 9 bytes |
00:47:35 | Araq | here you go, Nim's hello world only takes 9 bytes. beat that. :P |
00:47:49 | Triplefox | write "hello world" on a sheet of paper. zero bytes |
00:48:04 | flaviu | Araq: You need to include the compiler size in that to be fair. |
00:48:16 | flaviu | While we're at it, might as well as include the OS :P |
00:48:48 | Lordovos | hallo welt |
00:49:54 | Araq | JinShil: you can do the same with -d:noSignalHandler |
00:51:11 | Lordovos | do executables that nim produces when compiled statically link to libgcc? |
00:51:30 | JinShil | Araq: That's great. I didn't see that documented. That gets me down to 7k on nim commandline |
00:51:43 | JinShil | nim c -d:nosignalhandler -d:release --gc:none --stacktrace:off -t:-flto -t:-ffunction-sections -l:-flto -t:-fdata-sections -l:-Wl,--gc-sections hello.nim |
00:51:58 | JinShil | Some of those switches may not be necessary. I'm still exploring. |
00:52:56 | gmpreussner | JinShil: i think it would be super awesome if you could write a blog post with your findings |
00:55:19 | JinShil | I hope to when I actually finish my experiments. If I can get `proc echo` to print with inline assembly syscalls, I may write something up. I did something similar with D. |
00:56:19 | gmpreussner | do we have any guidelines on writing wrappers for third party libraries? i looked a few that are linked on the wiki, and it looks like there is no common naming convention, folder structure or style |
00:58:30 | gmpreussner | the most consistent repositories i found are in nim-lang |
00:58:39 | gmpreussner | i guess i will just follow that? |
00:59:07 | gmpreussner | dom96: any insights on this? |
01:04:34 | * | Nimbus joined #nim |
01:10:13 | Araq | gmpreussner: c2nim now knows about NEP-1 |
01:12:38 | gmpreussner | Araq: sorry, what is NEP-1? |
01:12:42 | * | imapiekindaguy joined #nim |
01:12:56 | Araq | our PEP-8 |
01:13:04 | gmpreussner | also, i'm not a fan of source code mixed in with other stuff in the root directory. i like how dom96 has a /src subdirectory in his repos to keep things clean |
01:13:20 | Araq | the official style guide |
01:13:24 | gmpreussner | ah |
01:13:39 | Araq | gmpreussner: yeah but I'm not a fan of directories :P |
01:14:41 | gmpreussner | do subdirectories have any implications for the import statements? |
01:15:35 | gmpreussner | NEP-1 has no guidelines for modules as far as i can tell |
01:15:42 | Varriount | gmpreussner: You can use strings literals in import statements, and use paths |
01:16:06 | gmpreussner | well, i wouldn't want to have: import src/wrapper.nim |
01:16:14 | Varriount | gmpreussner: And why should it? Everyone has their own view on how modules should be configured. |
01:16:29 | gmpreussner | Varriount: surely they must be some best practices? |
01:16:51 | gmpreussner | i dont want to force anyone to use a particular style. im just wondering what proved convenient so far. |
01:16:55 | onionhammer | import src.wrapper |
01:17:15 | gmpreussner | onionhammer: i think you can use both / or . |
01:17:18 | Araq | you don't have to do that , onionhammer |
01:17:29 | onionhammer | im just saying you can use either or |
01:17:37 | onionhammer | . or / |
01:18:07 | Varriount | gmpreussner: Aside from *not* emulating java, and using common sense, I really don't know |
01:18:29 | Araq | gmpreussner Nimble documents some best practices |
01:18:34 | dtscode | ldlework, ping |
01:18:43 | gmpreussner | so, for example, i'm looking at nim-lang/opengl. if i want to import the 'opengl' module, do i have to write 'import src/opengl' because opengl.nim is in the /src subdirectory? |
01:18:54 | Araq | no, you don't |
01:19:00 | Araq | and nobody does that |
01:19:10 | flaviu | doesn't nimble have a sourcedir option? |
01:19:21 | Araq | nimblepath deals with this but I don't remember the details |
01:19:41 | Araq | all I know is that I wrote that part 3x and then everybody was happy |
01:19:45 | gmpreussner | i see, so nimble will search all subdirectories |
01:19:58 | EXetoC | no |
01:20:00 | gmpreussner | and i only need 'import opengl' |
01:20:11 | EXetoC | you set the source dir in the package file |
01:20:24 | gmpreussner | ah, got it! |
01:20:27 | gmpreussner | thanks EXetoC |
01:20:37 | gmpreussner | yeah, it's in the opengl.babel file |
01:20:46 | gmpreussner | ok, now everything is clear :) |
01:20:54 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
01:21:55 | Araq | good night |
01:22:09 | Varriount | Goodnight. |
01:22:38 | EXetoC | bb |
01:22:54 | EXetoC | maybe there should be a sub-dir |
01:23:56 | gmpreussner | g'nite Araq |
01:25:32 | * | rpag quit (Ping timeout: 265 seconds) |
01:30:12 | * | z1y joined #nim |
01:30:35 | * | infrashortfoo joined #nim |
01:34:54 | * | imapiekindaguy quit (Quit: WeeChat 1.0-rc3) |
01:35:03 | * | meanfish joined #nim |
01:35:27 | * | infrashortfoo quit (Ping timeout: 264 seconds) |
01:44:32 | * | dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:44:52 | * | dapz joined #nim |
01:45:12 | * | flaviu quit (Remote host closed the connection) |
01:45:42 | * | flaviu joined #nim |
01:49:20 | * | z1y quit (Quit: Leaving.) |
01:49:51 | * | dapz quit (Ping timeout: 264 seconds) |
02:13:14 | * | yglukhov_____ joined #nim |
02:18:03 | * | yglukhov_____ quit (Ping timeout: 264 seconds) |
02:21:35 | * | aw1231 joined #nim |
02:21:46 | * | aw1231 quit (Client Quit) |
02:23:52 | * | Nimbus quit (Ping timeout: 240 seconds) |
02:33:10 | * | infrashortfoo joined #nim |
02:34:13 | * | z1y joined #nim |
02:38:02 | * | infrashortfoo quit (Ping timeout: 265 seconds) |
02:39:55 | * | Lordovos quit (Quit: Leaving) |
02:46:09 | * | JinShil quit (Ping timeout: 252 seconds) |
02:50:03 | * | kapil__ joined #nim |
02:51:55 | * | hasenj joined #nim |
03:05:11 | MrOrdinaire | is there any way to generate an expression easily in the codegen module of the compiler? |
03:09:59 | * | infrashortfoo joined #nim |
03:13:01 | * | VinceAddons quit (Read error: Connection reset by peer) |
03:13:47 | * | willwillson_ joined #nim |
03:14:01 | * | willwillson quit (Ping timeout: 244 seconds) |
03:14:22 | * | infrashortfoo quit (Ping timeout: 240 seconds) |
03:15:44 | * | JinShil joined #nim |
03:18:25 | * | willwillson_ quit (Ping timeout: 264 seconds) |
03:18:55 | * | willwillson joined #nim |
03:26:26 | * | darkf joined #nim |
03:33:38 | Varriount | MrOrdinaire: Hm? |
03:33:55 | Varriount | MrOrdinaire: Wht kind of expression? |
03:36:32 | MrOrdinaire | Varriount: I want to generate something like `s.high`. However, at this phase, the compiler has substituted other `s.high`s with something like `high_123(s_1234)`, so simply putting simple symbols like `s` and `high` won't work. |
03:39:08 | Varriount | MrOrdinaire: Hm, tricky... |
03:39:43 | Varriount | Let's look at the compiler code, and see what we can uncover, eh? |
03:39:47 | Varriount | :P |
03:40:04 | MrOrdinaire | okay |
03:44:21 | Varriount | MrOrdinaire: Perhaps we should find where the compiler translates 's.high' into `high_123(s_1234)`? |
03:46:39 | JinShil | How does one get a pointer from a string? |
03:47:36 | Varriount | JinShil: Pointer, or reference? What are you trying to do? |
03:48:27 | JinShil | I want to pass the address of a string to an inline assembly procedure. Essentially I want the address of the first character. |
03:48:34 | JinShil | ref mystring? |
03:48:49 | Varriount | JinShil: Use addr(myString[0]) |
03:49:48 | Varriount | JinShil: *Don't* take the direct address of a string, it contains stuff other than characters (length data, etc) |
03:50:17 | * | hasenj quit (Ping timeout: 245 seconds) |
03:50:20 | Triplefox | the idiom is the same with an array too |
03:51:13 | * | willwillson quit (Ping timeout: 244 seconds) |
03:52:57 | Varriount | MrOrdinaire: We might have to wait until araq is awake. He just went to bed unfortunately. |
03:54:30 | Varriount | MrOrdinaire: Would another possibility be to defer updating the length of the sequence? |
03:55:31 | Varriount | From what I understand, the bug is caused by the sequence being extended, then s.high being taken. This wouldn't be a problem if extending the sequence didn't affect s.high() and s.len() |
03:56:07 | MrOrdinaire | hmm |
03:58:01 | Varriount | JinShil: The idiom makes sense as soon as you think of a string as a pascal string, rather than a C string |
03:58:48 | Varriount | Also, since a string is a ref, taking the address of the variable holding a reference isn't what you usually want. |
04:02:14 | * | yglukhov_____ joined #nim |
04:02:17 | JinShil | Ok, I'm not familiar with Pascal strings, but I understand what you're saying. |
04:02:31 | JinShil | But I want the address of a string literal. Is that possible? |
04:03:06 | JinShil | I tried const s = "Hello" follwed by addr(s[0]) |
04:03:15 | JinShil | But I get "expression has no address" |
04:05:26 | Triplefox | it does that with const declarations although i don't know the exact reasons |
04:06:02 | JinShil | How about something equivalent to addr("Hello"[0]) |
04:06:03 | JinShil | ? |
04:06:31 | * | yglukhov_____ quit (Ping timeout: 256 seconds) |
04:06:32 | MrOrdinaire | Varriount: can you put that as a comment on the github issue #1832? I am going to work now. Talk to you later. |
04:07:37 | Varriount | Bye. Thanks for all the help MrOrdinaire |
04:08:13 | Triplefox | the closest i know of is to use var, however i doubt that's exactly what you want |
04:09:19 | * | MrOrdinaire left #nim (#nim) |
04:09:32 | JinShil | Triplefox, that would be ok, but it seems to do a string copy on assignment. Since I'm targeting a very resource constrained platform, I want to try to elminate such things. |
04:11:08 | Triplefox | there might a pragma that lets you get at literals...it's way out of my knowledge though |
04:13:06 | JinShil | I wonder if the inability to get the address of a string literal is a bug. It should be stored in the rodata segment, so there should be a valid address for it. |
04:16:07 | * | z1y quit (Remote host closed the connection) |
04:16:36 | * | z1y joined #nim |
04:24:13 | JinShil | var s: cstring = "Hello" addr(s[0]) seems to do well enough. I think anyway. Still trying to get other things to build. |
04:27:38 | Triplefox | yeah, maybe ask araq about it when he's awake. either there's a way to force it or a different equivalent idiom |
04:27:44 | Triplefox | (or it's an oversight) |
04:30:20 | Varriount | JinShil: You can mark a string with the shallow proc, or use shallowAssign, to prevent the copy on assignment |
04:31:24 | Varriount | JinShil: What environment are you targetting? |
04:33:11 | JinShil | Well, at first I'll be targetting ARM Cortex-M. |
04:33:37 | JinShil | But I may also try and AVR microcontrollers. |
04:34:54 | JinShil | Right now I'm just exploring to see what can be done using my PC. |
04:35:10 | Varriount | JinShil: Well, I'm reasonably sure that compilation and such should work. I know we have at least one build target running that tests on an armv6 or v7 architecture. |
04:35:59 | JinShil | Varriount: That's encouraging to hear. |
04:38:46 | * | jefus__ joined #nim |
04:42:22 | * | jefus_ quit (Ping timeout: 245 seconds) |
04:48:41 | JinShil | Ok, I'm making progress (Thanks for the help everyone), but I'm still hitting some roadblocks. Please check out this simple nim code: http://pastebin.com/PhME0hLC |
04:49:04 | JinShil | It generates this C code: http://pastebin.com/6vRbuuSs |
04:49:33 | JinShil | Am I doing something wrong in the assembly syntax? The C code doesn't look right. |
04:49:41 | JinShil | And I know this assembly code works. |
04:51:57 | * | ARCADIVS joined #nim |
04:56:16 | * | BitPuffin quit (Ping timeout: 265 seconds) |
05:15:51 | * | z1y quit (Ping timeout: 264 seconds) |
05:29:54 | * | kniteli quit (Ping timeout: 244 seconds) |
05:32:44 | gmpreussner | i have a compile time check of the form: when not defined(android). the compiler warns: Warning: undeclared conditional symbol; use --symbol to declare it: android [User]. how do i fix that? obviously, i DONT want to define 'android' |
05:39:38 | * | gsingh93 joined #nim |
05:44:01 | JinShil | Well, I finally got it to work, but had to put my asm on on one line. My hello world is now 2.5K. If I use similar techniques with C, I can get it down to 1.6K. Regardless I'm satisfied. |
05:44:13 | JinShil | I have to go now. Thanks everyone for the help. |
05:45:06 | * | JinShil quit (Quit: Konversation terminated!) |
05:51:13 | * | yglukhov_____ joined #nim |
05:53:10 | dv- | BBS, or Bodu Bala Sena, otherwise known as Buddhist Power Force, is a Buddhist supremacist group accused of stirring sectarian hatred in Sri Lanka. |
05:55:53 | * | yglukhov_____ quit (Ping timeout: 256 seconds) |
05:56:06 | * | z1y joined #nim |
06:00:18 | gmpreussner | flaviu: you around? |
06:04:58 | * | JinShil joined #nim |
06:17:14 | * | ARCADIVS quit (Quit: ARCADIVS) |
06:48:05 | * | JinShil quit (Quit: Konversation terminated!) |
06:51:17 | * | JinShil joined #nim |
06:51:34 | * | kapil__ quit (Quit: Connection closed for inactivity) |
06:53:03 | * | yglukhov_____ joined #nim |
06:55:38 | * | yglukhov_____ quit (Read error: Connection reset by peer) |
06:56:00 | * | yglukhov_____ joined #nim |
07:01:59 | * | kapil__ joined #nim |
07:10:06 | * | yglukhov_____ quit (Quit: Be back later ...) |
07:13:15 | * | JinShil quit (Remote host closed the connection) |
07:14:14 | * | gour joined #nim |
07:23:35 | * | infrashortfoo joined #nim |
07:31:05 | * | infrashortfoo quit (Remote host closed the connection) |
07:38:57 | * | repax joined #nim |
07:45:52 | * | bjz joined #nim |
07:51:07 | * | bjz quit (Ping timeout: 245 seconds) |
07:52:03 | * | BitPuffin joined #nim |
07:56:38 | * | BitPuffin quit (Ping timeout: 244 seconds) |
08:01:57 | * | yglukhov_____ joined #nim |
08:03:57 | * | infrashortfoo joined #nim |
08:05:31 | * | bjz joined #nim |
08:09:52 | * | EXetoC quit (Ping timeout: 245 seconds) |
08:23:52 | * | Sphax joined #nim |
08:50:01 | * | bjz quit (Read error: Connection reset by peer) |
08:52:01 | * | JinShil joined #nim |
08:52:41 | * | z1y quit (Ping timeout: 256 seconds) |
08:53:49 | * | z1y joined #nim |
09:00:00 | * | JinShil quit (Quit: Konversation terminated!) |
09:01:18 | * | bjz joined #nim |
09:07:25 | * | minciue joined #nim |
09:07:29 | * | khmm joined #nim |
09:09:40 | * | gokr_ quit (Read error: Connection reset by peer) |
09:18:58 | * | BlaXpirit joined #nim |
09:25:39 | * | khmm quit (Ping timeout: 245 seconds) |
09:26:41 | reactormonk | Araq, hey hey, don't go full Linus |
09:31:03 | * | khmm joined #nim |
09:37:11 | * | khmm quit (Ping timeout: 244 seconds) |
09:39:58 | * | khmm joined #nim |
09:50:10 | * | bjz quit (Read error: Connection reset by peer) |
09:50:16 | * | khmm_ joined #nim |
09:50:18 | * | khmm quit (Remote host closed the connection) |
09:50:28 | * | khmm_ quit (Read error: Connection reset by peer) |
09:50:46 | * | bjz joined #nim |
09:50:49 | * | khmm joined #nim |
09:53:27 | * | khmm quit (Remote host closed the connection) |
09:57:59 | ekarlso- | reactormonk: :P |
10:00:59 | * | z1y quit (Remote host closed the connection) |
10:02:23 | * | infrashortfoo quit (Read error: Connection reset by peer) |
10:02:45 | * | infrashortfoo joined #nim |
10:04:35 | * | khmm joined #nim |
10:05:16 | * | bjz quit (Read error: Connection reset by peer) |
10:05:25 | * | z1y joined #nim |
10:15:46 | * | khmm quit (Remote host closed the connection) |
10:19:43 | Triplefox | which library should i use for 3d matrix game math |
10:20:54 | * | dyu joined #nim |
10:24:42 | * | bjz joined #nim |
10:30:27 | * | yglukhov______ joined #nim |
10:31:38 | * | yglukhov_____ quit (Ping timeout: 244 seconds) |
10:36:47 | * | MajorTennis joined #nim |
10:36:52 | * | bjz quit (Ping timeout: 240 seconds) |
10:37:02 | * | MajorTennis quit (Changing host) |
10:37:02 | * | MajorTennis joined #nim |
10:40:54 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
10:43:08 | * | JinShil joined #nim |
10:44:31 | * | uyppp quit (Ping timeout: 255 seconds) |
10:44:42 | * | minciue_ joined #nim |
10:45:04 | * | minciue quit (Read error: Connection reset by peer) |
10:45:05 | * | minciue_ is now known as minciue |
10:46:14 | * | uyppp joined #nim |
10:54:30 | * | bjz joined #nim |
11:05:22 | * | bjz quit (Read error: Connection reset by peer) |
11:06:05 | yglukhov______ | Triplefox: I've got a small port of glmatrix C lib here. https://github.com/yglukhov/nimx/blob/master/nimx/matrixes.nim |
11:06:21 | yglukhov______ | This file doesn't have any dependencies. |
11:06:48 | yglukhov______ | There's also a library among nimble packages |
11:06:58 | Triplefox | thanks, i'm seeing a few vector math libraries |
11:08:35 | kokozedman | hey guys ... how do I compile a nim program as a 32-bit binary in a 64-bit Ubuntu? |
11:08:46 | kokozedman | I'm getting the usual error: size of array ‘assert_numbits’ is negative |
11:08:57 | kokozedman | already using --cpu:i386 |
11:09:47 | * | VinceAddons joined #nim |
11:16:37 | * | gour_ joined #nim |
11:19:52 | * | z1y quit (Ping timeout: 240 seconds) |
11:19:55 | * | bjz joined #nim |
11:20:27 | * | gour quit (Ping timeout: 264 seconds) |
11:20:31 | gokr | kokozedman: See http://goran.krampe.se/2014/11/03/squeak-to-nim/ |
11:20:38 | gokr | Search down for "i386" |
11:23:51 | * | Demon_Fox quit (Quit: Leaving) |
11:37:15 | * | bjz quit (Ping timeout: 244 seconds) |
11:38:03 | * | Mimbus joined #nim |
11:44:54 | * | minciue quit (Quit: minciue) |
11:48:27 | wtw | when compiling the master branch of nim under FreeBSD I'm getting |
11:48:28 | wtw | compiler/nimcache/cgen.o: In function `cgenwritemodules_592360': |
11:48:30 | wtw | cgen.c:(.text+0x22e30): undefined reference to `writemapping_203894' |
11:48:50 | wtw | is there something I can do about that? |
11:51:36 | * | bjz joined #nim |
11:56:43 | kokozedman | gokr: thanks, but I used --cpu:i386 --passC:-m32 --passL:-m32 |
11:57:10 | gokr | kokozedman: Which is what I wrote in that article :) |
11:57:21 | kokozedman | gokr: :) ok |
11:57:23 | kokozedman | thanks |
11:57:33 | gokr | I also wrote some other details that may be of interest. |
11:57:56 | gokr | Like making sure you also compile nimrtl.nim as 32 bits, see article. |
11:58:27 | gokr | You need this if you need GC, which I guess you do :) |
11:58:50 | gokr | Oh, may perhaps only be relevant for .so generation. |
11:58:54 | * | bjz quit (Read error: Connection reset by peer) |
11:59:19 | kokozedman | gokr: well, I compile to executable not .so, and it works without the nimrtl.nim thingy |
11:59:30 | gokr | Yeah. |
11:59:44 | kokozedman | but I sure will try to remember that when creating a .so ... thanks for the pointer |
12:03:10 | * | yglukhov______ quit (Quit: Be back later ...) |
12:05:25 | * | yglukhov______ joined #nim |
12:12:54 | BlaXpirit | what would be an idiomatic way to translate something that uses values True, False, None |
12:13:30 | BlaXpirit | 2 overloaded procs actually... nevermind |
12:16:20 | * | JinShil quit (Quit: Konversation terminated!) |
12:16:51 | * | JinShil joined #nim |
12:29:16 | * | bjz joined #nim |
12:35:01 | * | bjz quit (Read error: Connection reset by peer) |
12:39:45 | * | NimBot joined #nim |
12:44:28 | * | areckizb quit (Ping timeout: 246 seconds) |
12:49:13 | * | JinShil quit (Quit: Konversation terminated!) |
12:54:20 | * | BitPuffin joined #nim |
13:02:51 | * | z1y joined #nim |
13:03:17 | * | jefus__ is now known as jefus |
13:04:44 | * | bjz joined #nim |
13:06:58 | * | Trustable joined #nim |
13:14:11 | * | bjz quit (Ping timeout: 244 seconds) |
13:23:35 | * | bjz joined #nim |
13:35:54 | * | MrOrdinaire joined #nim |
13:42:03 | * | MrOrdinaire quit (Remote host closed the connection) |
13:42:22 | * | gokr quit (Quit: Leaving.) |
13:43:02 | * | MrOrdinaire joined #nim |
13:48:52 | * | MrOrdinaire quit (Remote host closed the connection) |
13:50:15 | * | MrOrdinaire joined #nim |
13:51:34 | * | kapil__ quit (Quit: Connection closed for inactivity) |
13:53:13 | * | bjz quit (Ping timeout: 264 seconds) |
13:54:07 | * | bjz joined #nim |
13:55:32 | * | MrOrdinaire quit (Remote host closed the connection) |
13:57:47 | * | MrOrdinaire joined #nim |
13:59:22 | * | gokr_ joined #nim |
14:00:26 | gokr_ | I wonder if "Illegal type" can be made to be more informative |
14:02:27 | * | Trustable quit (Remote host closed the connection) |
14:03:17 | * | MrOrdinaire quit (Remote host closed the connection) |
14:05:30 | * | MrOrdinaire joined #nim |
14:05:54 | * | z1y quit (Remote host closed the connection) |
14:06:27 | * | z1y joined #nim |
14:07:08 | MrOrdinaire | Araq: do you have a favorite among the three proposed solutions? |
14:07:33 | MrOrdinaire | regarding https://github.com/Araq/Nim/pull/1896 |
14:08:04 | * | bjz quit (Ping timeout: 264 seconds) |
14:15:45 | renesac | the "asm" statement is compiler specific? |
14:17:13 | * | gokr_ quit (Ping timeout: 264 seconds) |
14:21:59 | * | MrOrdinaire quit (Remote host closed the connection) |
14:22:19 | * | MrOrdinaire joined #nim |
14:22:57 | * | MrOrdinaire quit (Remote host closed the connection) |
14:23:04 | * | jpoirier quit (Quit: Leaving) |
14:24:56 | * | bjz joined #nim |
14:36:25 | * | gmpreussner_ joined #nim |
14:36:39 | * | gmpreussner quit (Ping timeout: 256 seconds) |
14:38:04 | * | bjz quit (Ping timeout: 255 seconds) |
14:39:04 | * | jefus_ joined #nim |
14:39:06 | gmpreussner_ | i'm having trouble linking to a dynamic library on Linux. the .so file is in /usr/lib, but i'm getting a runtime error on program startup that the lib couldn't be loaded. if i try to link statically with --dynlibOverride, gcc logs "error: libspnav.so: No such file or directory". do i have to configure anything else for this to work? |
14:40:47 | * | gokr joined #nim |
14:41:01 | BlaXpirit | gmpreussner_, hmmmm it's a bit hard to diagnose such things |
14:41:07 | BlaXpirit | what is the name of your library? |
14:41:16 | * | gokr1 joined #nim |
14:41:33 | BlaXpirit | libspnav.so or is that a dependency |
14:41:53 | * | jefus quit (Ping timeout: 252 seconds) |
14:45:39 | * | gokr quit (Ping timeout: 264 seconds) |
14:47:20 | * | bjz joined #nim |
14:56:13 | * | gokr1 quit (Ping timeout: 264 seconds) |
14:56:16 | gmpreussner_ | BlaXpirit: yes, that is the library. it has no dependencies other than libc.so |
14:57:48 | * | gokr joined #nim |
14:58:04 | BlaXpirit | gmpreussner_, there should be no problem |
14:58:18 | gmpreussner_ | btw this is the very first time i'm trying to link anything on linux, so i may just be missing something non-Nim related? |
14:58:25 | BlaXpirit | maybe your code is wrong, why not show it? |
14:58:55 | gmpreussner_ | BlaXpirit: https://github.com/nimious/io-spacenav |
14:59:13 | gmpreussner_ | the third party library was installed through pacman on ArchLinux |
14:59:22 | gmpreussner_ | it does not ship with my code |
14:59:39 | BlaXpirit | gmpreussner_, maybe cdecl is needed? |
15:00:45 | BlaXpirit | i added cdecl, doesn't work even then |
15:01:11 | gmpreussner_ | yeah, i think the problem is that the .so is not found (or perhaps rejected) in the first place |
15:01:30 | BlaXpirit | there is no reason for it to be not found |
15:01:57 | gmpreussner_ | the /usr/lib directory is not in PATH directory |
15:02:08 | gmpreussner_ | maybe that is the problem |
15:02:15 | gmpreussner_ | *not in PATH |
15:02:33 | BlaXpirit | i used a lib like that |
15:02:36 | BlaXpirit | exactly like that |
15:03:12 | * | irrequietus joined #nim |
15:05:06 | gmpreussner_ | BlaXpirit: even if i copy the .so into my project directory, it doesn't find it |
15:05:18 | BlaXpirit | it doesn't find it even if it worked |
15:05:36 | BlaXpirit | at least we eliminated the possibility that the mistake is in your code |
15:05:47 | gmpreussner_ | oh wait, i just made some progress |
15:06:03 | gmpreussner_ | if i copy it to the root of my project (which is where Nim runs from) then it finds the lib |
15:06:15 | BlaXpirit | weird |
15:06:52 | BlaXpirit | are you sure you didn't just return to initial problem? |
15:07:28 | ekarlso- | is it ok to not include a packages versions / releases in GET /packages ? |
15:08:33 | gmpreussner_ | BlaXpirit: i gotta go to work now. i will look into this some more this evening. if you have any other ideas, please lemme know! |
15:08:34 | * | gokr quit (Ping timeout: 245 seconds) |
15:08:43 | BlaXpirit | gmpreussner_, have no other ideas. |
15:09:27 | ekarlso- | noone cares for the packages crud ? :D |
15:10:05 | BlaXpirit | noone is here |
15:10:09 | ekarlso- | :P |
15:14:38 | ekarlso- | is it a bad thing to use method() for stuff ? |
15:19:58 | onionhammer | for what stuff? |
15:21:12 | * | bjz quit (Read error: Connection reset by peer) |
15:32:57 | * | gmpreussner__ joined #nim |
15:33:16 | * | bjz joined #nim |
15:33:57 | * | gmpreussner_ quit (Ping timeout: 252 seconds) |
15:36:29 | * | kniteli joined #nim |
15:39:13 | * | darkf quit (Quit: Leaving) |
15:47:45 | * | bjz quit (Read error: Connection reset by peer) |
15:52:18 | * | bjz joined #nim |
15:54:46 | * | jefus_ is now known as jefus |
15:55:24 | * | jpoirier joined #nim |
15:55:53 | * | EXetoC joined #nim |
15:57:19 | * | dyu quit (Quit: Leaving) |
16:05:13 | * | bjz quit (Read error: Connection reset by peer) |
16:05:54 | * | z1y quit (Remote host closed the connection) |
16:06:30 | * | gour_ is now known as gour |
16:06:34 | * | z1y joined #nim |
16:08:21 | * | z1y quit (Client Quit) |
16:12:43 | * | z1y joined #nim |
16:15:24 | * | bjz joined #nim |
16:15:49 | * | Trustable joined #nim |
16:26:49 | saml | http://nitlanguage.org/ is nit successor of nim? |
16:27:31 | BlaXpirit | no |
16:27:41 | BlaXpirit | "nin" is the successor of "nim" |
16:28:55 | novist | nit has "then" clause. what a disaster.. |
16:29:23 | * | repax quit (Ping timeout: 240 seconds) |
16:29:53 | novist | and "end". they did it wrong |
16:30:08 | BlaXpirit | whatever. |
16:30:11 | novist | they should have made it "THIS_CLASS_TERMINATES_RIGHT_HERE_DO_YOU_SEE" |
16:30:33 | novist | not like longer keywords break writs and kill puppies |
16:30:41 | BlaXpirit | ... ruby |
16:31:32 | novist | another fine example of horrible stuff yes |
16:31:40 | BlaXpirit | whatever. |
16:34:37 | * | z1y quit (Ping timeout: 264 seconds) |
16:38:50 | * | jefus_ joined #nim |
16:40:59 | * | AMorpork is now known as BuyingMorpork |
16:42:47 | * | jefus quit (Ping timeout: 245 seconds) |
16:46:46 | * | gokr joined #nim |
16:46:54 | * | gokr quit (Read error: Connection reset by peer) |
16:47:25 | * | gokr joined #nim |
16:58:37 | * | yglukhov______ quit (Ping timeout: 264 seconds) |
17:01:15 | * | brson joined #nim |
17:02:59 | * | shodan45 joined #nim |
17:03:34 | * | Epic|gmpreussner joined #nim |
17:03:52 | * | gmpreussner__ quit (Ping timeout: 264 seconds) |
17:09:05 | * | bjz quit (Ping timeout: 256 seconds) |
17:10:24 | * | bjz joined #nim |
17:11:10 | * | infrashortfoo quit (Remote host closed the connection) |
17:11:15 | * | brson quit (Quit: leaving) |
17:11:47 | * | jefus_ is now known as jefus |
17:12:03 | * | willwillson joined #nim |
17:13:33 | * | infrashortfoo joined #nim |
17:17:10 | * | Matthias247 joined #nim |
17:18:09 | * | infrashortfoo quit (Ping timeout: 256 seconds) |
17:23:59 | * | bjz quit (Ping timeout: 265 seconds) |
17:27:32 | ldlework | dtscode: sup |
17:29:46 | * | shodan45 quit (Quit: Konversation terminated!) |
17:29:54 | * | shodan45 joined #nim |
17:37:11 | * | vendethiel- joined #nim |
17:39:01 | * | BuyingMorpork is now known as AMorpork |
17:40:16 | * | jpoirier quit (Quit: Page closed) |
17:40:46 | * | vendethiel quit (Ping timeout: 255 seconds) |
17:41:09 | * | vendethiel joined #nim |
17:42:03 | * | vendethiel- quit (Ping timeout: 264 seconds) |
17:45:50 | * | Sphax quit (Quit: ZZZZZzzzzz) |
17:45:50 | ldlework | Araq: so can you remind me what the reason for crashing unless -d:release is provided? |
17:49:38 | * | infrashortfoo joined #nim |
17:53:06 | * | bjz joined #nim |
17:54:16 | * | Sergio965 joined #nim |
17:55:36 | * | MajorTennis quit (Quit: Leaving) |
17:57:14 | * | infrasho_ joined #nim |
17:58:21 | * | yglukhov______ joined #nim |
17:58:46 | * | Varriount|Busy joined #nim |
17:59:17 | * | infrash__ joined #nim |
17:59:17 | * | brson joined #nim |
17:59:31 | * | infrashortfoo quit (Ping timeout: 252 seconds) |
18:01:55 | * | infrasho_ quit (Ping timeout: 255 seconds) |
18:02:45 | * | infrashortfoo joined #nim |
18:03:52 | * | gmpreussner joined #nim |
18:04:10 | * | Epic|gmpreussner quit (Ping timeout: 255 seconds) |
18:05:40 | * | infrash__ quit (Ping timeout: 264 seconds) |
18:06:26 | * | infrasho_ joined #nim |
18:07:55 | * | infrash__ joined #nim |
18:09:12 | * | infrashortfoo quit (Ping timeout: 244 seconds) |
18:09:23 | * | infrashortfoo joined #nim |
18:11:21 | * | infrasho_ quit (Ping timeout: 265 seconds) |
18:11:21 | * | infras___ joined #nim |
18:12:18 | * | infrash__ quit (Ping timeout: 244 seconds) |
18:14:15 | * | infrashortfoo quit (Ping timeout: 265 seconds) |
18:17:13 | * | infras___ quit (Ping timeout: 264 seconds) |
18:20:06 | * | enquora joined #nim |
18:24:23 | * | bjz quit (Ping timeout: 240 seconds) |
18:25:33 | * | bjz joined #nim |
18:26:35 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:29:49 | * | irrequietus quit (Ping timeout: 255 seconds) |
18:36:02 | * | bjz quit (Read error: Connection reset by peer) |
18:38:30 | * | vendethiel quit (Quit: q+) |
18:41:57 | * | SplinterOfChaos quit (Ping timeout: 245 seconds) |
18:41:58 | ldlework | quiet in here today |
18:43:15 | renesac | yeah |
18:43:27 | renesac | I can't install c2nim via nimble |
18:43:50 | renesac | it gives the following compilation error: postprocessor.nim(18, 25) Error: type mismatch: got (PIdent) but expected one of: renderer.isKeyword(s: string): bool |
18:44:35 | BlaXpirit | renesac, that's a relatively minor problem :p |
18:44:54 | BlaXpirit | renesac, i saw in commit history something that says it now only works with latest devel |
18:45:02 | BlaXpirit | also i heard yesterday that devel is broken |
18:45:04 | BlaXpirit | so yeah |
18:45:11 | renesac | minor problem... |
18:45:24 | BlaXpirit | well i have "llstream not found" |
18:45:50 | BlaXpirit | renesac, u can also get an earlier commit of c2nim |
18:46:22 | renesac | I know @#HEAD |
18:46:34 | BlaXpirit | that's ... not what u want |
18:46:38 | BlaXpirit | it's head anyway |
18:46:53 | renesac | well, that @#HEAD allowed me to install aporia |
18:47:37 | BlaXpirit | ok but that's because aporia has tags |
18:47:41 | BlaXpirit | c2nim does not have tags |
18:47:49 | renesac | hum |
18:47:49 | BlaXpirit | so it always goes for head anyway |
18:47:54 | renesac | right |
18:47:56 | BlaXpirit | so i suggest u try @#1625c5ab7781a8cc9798edebc05276a654985444 |
18:48:47 | renesac | fails saying it's an empty git directory |
18:49:25 | renesac | should I try to update to the last nim devel compiler? |
18:49:36 | renesac | or is it really seriously broken? |
18:49:36 | BlaXpirit | [:45:01] <BlaXpirit> also i heard yesterday that devel is broken |
18:49:40 | BlaXpirit | i have no idea though |
18:49:52 | BlaXpirit | i gave up on c2nim |
18:50:10 | * | Sphax joined #nim |
18:50:31 | Varriount|Busy | BlaXpirit: Hm? |
18:50:37 | BlaXpirit | Hm? |
18:51:04 | renesac | I have a bunch of C code with inline assembly here and hoped it could translate most of it to nimrod style |
18:51:21 | * | bjz joined #nim |
18:51:25 | renesac | not sure if it is supported by c2nim though |
18:51:31 | Varriount|Busy | renesac: Are you running Windows? I might have a c2nim binary on my system. |
18:51:43 | Varriount|Busy | Although, I'm away from my desktop... |
18:51:48 | renesac | I'm on linŭ |
18:51:51 | renesac | linux |
18:51:58 | Varriount|Busy | :< |
18:52:24 | renesac | well, it is not urgent |
18:52:27 | BlaXpirit | Varriount|Busy, do u maybe know how to get a previous commit? |
18:52:32 | renesac | I imagine that the devel won't stay broken for long |
18:52:39 | BlaXpirit | I don't know the syntax for it |
18:52:44 | BlaXpirit | maybe # is not needed |
18:53:01 | BlaXpirit | yeah, actually, renesac, try that commit i gave you without # symbol |
18:53:04 | Varriount|Busy | BlaXpirit: I use a GUI frontend for git. If I recall correctly, you use revision hashes |
18:53:05 | renesac | BlaXpirit: it seems to be needed |
18:53:17 | renesac | "unexpected char in version range" |
18:53:24 | def- | BlaXpirit: i always just used "git checkout hash && nimble install" |
18:53:41 | BlaXpirit | that's actually an OK option |
18:53:48 | BlaXpirit | but with modification |
18:54:00 | BlaXpirit | well ok |
18:54:23 | renesac | I like that nimble downloads all those projects into a defined folder |
18:54:26 | BlaXpirit | just that nimble says it can install a specific commit |
18:54:32 | renesac | I would need to go there to execute that command, right? |
18:54:51 | BlaXpirit | yes, or download it yourself... |
18:55:11 | def- | renesac: no, i don't think so. nimble doesn't check out the entire repo |
18:55:28 | def- | from what i see |
18:55:49 | renesac | hum |
18:56:01 | renesac | anyway, I think I will wait the devel compiler be unbroken |
18:56:07 | BlaXpirit | maybe it is unbroken |
18:57:24 | ldlework | don't think so |
18:57:40 | reactormonk | So, how do I use the compiler tests again to see if my changes break something? |
18:59:28 | gmpreussner|work | Varriount|Busy: do you know anything about linking third party libs on Linux? i'm having some trouble :/ |
19:01:47 | def- | gmpreussner|work: always worked for me. what's going wrong? |
19:11:58 | Varriount|Busy | gmpreussner|work: No idea. |
19:12:18 | Varriount|Busy | gmpreussner|work: Nim, by default, uses dynamic library loading. |
19:14:26 | BlaXpirit | gmpreussner's problem was that libspnav.so wouldn't load |
19:14:36 | BlaXpirit | i made this example https://bpaste.net/show/91c3f73711c8 and it doesn't load for me either |
19:17:32 | gmpreussner|work | perhaps it's a problem with the library |
19:18:30 | gmpreussner|work | what's strange is that the error is that the file could not be found, both when linking dynamically or statically |
19:18:39 | BlaXpirit | gmpreussner|work, umm no? |
19:18:45 | BlaXpirit | it doesnt say file could not be found |
19:19:19 | gmpreussner|work | gcc said something along the lines of 'no such file or directory' |
19:19:33 | * | EXetoC quit (Quit: WeeChat 1.0.1) |
19:19:35 | gmpreussner|work | you're right, the dynamically linked version shows 'could not load' on startup |
19:19:37 | BlaXpirit | gmpreussner|work, maybe when you started doing some shenanigans |
19:20:03 | gmpreussner|work | if i copy the .so into the directory that Nim is running from, then it can link the .so |
19:21:53 | gmpreussner|work | although then i get messages for unresolved X11 symbols |
19:22:08 | gmpreussner|work | i think another possibility is that the library was compiled with X11 support enabled, and that something X11 related is missing |
19:22:19 | gmpreussner|work | perhaps the messages we see are just misleading |
19:22:27 | BlaXpirit | yeah, it's werid |
19:22:47 | BlaXpirit | ah what the heck, i'm gonna try to link it from C and see |
19:22:56 | gmpreussner|work | thanks :) |
19:23:32 | BlaXpirit | yup, getting undefined references |
19:23:45 | BlaXpirit | so the lib depends on X11 but doesn't have it as dependency in .so |
19:23:49 | BlaXpirit | or somerthing like that |
19:24:10 | BlaXpirit | so basically to make it work i used |
19:24:12 | BlaXpirit | -lspnav -lX11 |
19:24:30 | BlaXpirit | i dont know how to give this additional dependency to Nim, but hopefully someone does |
19:24:38 | def- | -passL:-lX11 |
19:24:48 | def- | i think |
19:25:58 | * | alexruf joined #nim |
19:32:56 | gmpreussner|work | awesome, thanks BlaXpirit! |
19:33:33 | * | gmpreussner_ joined #nim |
19:33:56 | * | gmpreussner quit (Ping timeout: 244 seconds) |
19:35:27 | * | gokr quit (Quit: Leaving.) |
19:39:12 | renesac | well, I managed to install c2nim updating to the last devel compiler |
19:39:29 | * | Sphax quit (Quit: ZZZZZzzzzz) |
19:39:44 | renesac | but it is useless, it complains about missing ';' in every function definition |
19:40:12 | BlaXpirit | :| |
19:40:55 | renesac | ok, he don't likes "static" |
19:41:28 | renesac | nor __inline__ |
19:41:57 | renesac | and now "Error: '*' expected" |
19:42:13 | BlaXpirit | we get it |
19:42:18 | renesac | refering to the asm block |
19:42:32 | renesac | is it normal? |
19:42:39 | renesac | or it is broken? |
19:42:41 | BlaXpirit | broken is broken |
19:42:45 | * | Sphax joined #nim |
19:42:48 | renesac | :/ |
19:43:12 | * | goobles joined #nim |
19:44:10 | * | goobles quit (Client Quit) |
19:47:09 | * | vendethiel joined #nim |
19:48:45 | * | Sphax quit (Quit: ZZZZZzzzzz) |
19:49:44 | BlaXpirit | no, i don't get it for real |
19:50:52 | * | rpag joined #nim |
19:52:32 | BlaXpirit | https://github.com/BlaXpirit/nim-csfml/blob/v2.1.0/src/csfml_graphics_gen.nim#L4175 vs https://github.com/LaurentGomila/CSFML/blob/2.1/include/SFML/Graphics/VertexArray.h#L124 |
19:52:46 | ekarlso- | so, if you declare a proc foo and a proc bar below but call bar from foo u get a unknown identifier ? |
19:52:50 | * | Sphax joined #nim |
19:53:03 | BlaXpirit | calling append causes garbage items to appear in VertexArray, but same code works in C |
19:53:19 | willwillson | ekarlso-: use a forward declaration |
19:53:33 | BlaXpirit | ekarlso-, haven't read the tutorial yet, eh? |
19:53:43 | ekarlso- | BlaXpirit: I have part 1 |
19:54:01 | BlaXpirit | http://nim-lang.org/tut1.html#forward-declarations :| |
19:54:02 | ekarlso- | missed that part though :( |
19:54:17 | BlaXpirit | i've read the stuff like 3 times |
19:55:16 | ekarlso- | think i'll do that too before continuing :P |
19:56:20 | BlaXpirit | goddammit something is wrong |
19:57:31 | BlaXpirit | how can this function signature https://github.com/BlaXpirit/nim-csfml/blob/v2.1.0/src/csfml_graphics_gen.nim#L4175 cause such code: Dl_106214(triangle_110022, (&v1_110028)); |
19:59:05 | * | BlaXpirit_ joined #nim |
19:59:10 | BlaXpirit_ | I just disconnected |
20:00:14 | BlaXpirit_ | so is this gonna be yet another nim bug |
20:01:53 | * | BlaXpirit quit (Ping timeout: 240 seconds) |
20:03:45 | BlaXpirit_ | whom can I annoy about C FFI? |
20:09:17 | arekzb | BlaXpirit: did you auto-generate this file? csfml_graphics_gen.nim or did you hand write it ? |
20:09:48 | * | Sphax quit (Quit: ZZZZZzzzzz) |
20:10:09 | BlaXpirit_ | arekzb, I generated |
20:10:32 | BlaXpirit_ | readmes contain some information |
20:11:19 | willwillson | could you use {.bycopy.} maybe? |
20:11:32 | BlaXpirit_ | bycopy, eh |
20:11:39 | BlaXpirit_ | that.... is probably it |
20:11:51 | BlaXpirit_ | it might be the only struct that is just large enough to cause this stuff |
20:12:05 | willwillson | isn't it anything larger than a pointer? |
20:12:09 | BlaXpirit_ | but it's not supposed to be that way because this is cimport |
20:12:32 | BlaXpirit_ | but thanks for extremely valuable input, willwillson |
20:12:38 | BlaXpirit_ | i'm gonna report it anyway |
20:13:02 | willwillson | didn't someone ask from a bycopy annotation at the call site (think it was on the forum) |
20:13:15 | BlaXpirit_ | ? |
20:13:45 | willwillson | i remember sonce feature request... myabe it it was on the proc declaration |
20:14:04 | BlaXpirit_ | willwillson, aaaand it immediately works |
20:14:19 | BlaXpirit_ | thank you very much |
20:14:26 | BlaXpirit_ | i think i'm very lucky that someone noticed this |
20:15:17 | willwillson | nice binding by the way :D |
20:15:21 | BlaXpirit_ | thx |
20:15:57 | arekzb | willwillson: I see the manual entry on .bycopy., can you expand on why you thought it work in this instance ? |
20:19:14 | * | Sphax joined #nim |
20:19:35 | * | gokr joined #nim |
20:19:55 | * | rpag quit (Quit: Leaving) |
20:23:08 | * | Sergio965 quit (Quit: Bye! :)) |
20:23:53 | arekzb | I see the forum post about someone else's fix with .bycopy. here: http://forum.nimrod-lang.org/t/702 . I'm still not sure on what is happening |
20:24:10 | BlaXpirit_ | ok thx, arekzb |
20:24:51 | BlaXpirit_ | so i will have to scan issues then |
20:25:14 | willwillson | arekzb: his vertex object was being passed by reference, the c function signature showed it needed to be passed by value |
20:25:46 | BlaXpirit_ | not only that, but the function signature itself came out wrong, with a pointer |
20:25:57 | BlaXpirit_ | (well i guess it wouldn't compile otherwise) |
20:32:04 | * | Varriount|Busy quit (Ping timeout: 246 seconds) |
20:32:16 | wtw | when compiling the master branch of nim under FreeBSD I'm getting |
20:32:20 | arekzb | ok, BlaXpirit: so did you add a {.bycopy.} on your object definition and did you adjust the append procedure ? |
20:32:22 | wtw | compiler/nimcache/cgen.o: In function `cgenwritemodules_592360': |
20:32:22 | wtw | cgen.c:(.text+0x22e30): undefined reference to `writemapping_203898' |
20:32:22 | wtw | collect2: error: ld returned 1 exit status |
20:32:30 | BlaXpirit_ | arekzb, i didnt adjust anything |
20:32:30 | wtw | something i can do about that? |
20:32:35 | BlaXpirit_ | just added bycopy to every objecty |
20:32:48 | arekzb | oh, |
20:32:51 | arekzb | I see |
20:33:10 | BlaXpirit_ | arekzb, do you understand what's happening? |
20:33:16 | BlaXpirit_ | because i sure do now |
20:33:20 | * | gmpreussner__ joined #nim |
20:33:23 | arekzb | I'm almost there |
20:33:37 | * | gmpreussner_ quit (Ping timeout: 245 seconds) |
20:33:47 | BlaXpirit_ | it just generates function with a pointer as if it was a normal function on a normal object without bycopy |
20:38:40 | arekzb | ok, I think i see now. you added bycopy to all the objects like CircleShape, VertexArray etc. and then the generated procedures in don't use pointer notation |
20:39:17 | BlaXpirit_ | i didnt add it to VertexArray, no |
20:39:23 | * | bjz quit (Ping timeout: 240 seconds) |
20:39:23 | BlaXpirit_ | just to Vertex and all CSFML structs |
20:39:42 | BlaXpirit_ | ok basically i added bycopy to objects, but not to ptr objects |
20:40:00 | BlaXpirit_ | because they actually must not be bycopy |
20:40:39 | * | bjz joined #nim |
20:40:45 | arekzb | ok now I see |
20:43:51 | BlaXpirit_ | https://github.com/Araq/Nim/issues/1908 |
20:45:21 | * | irrequietus joined #nim |
20:45:50 | arekzb | neat |
20:48:55 | * | irrequietus quit (Remote host closed the connection) |
20:49:47 | Varriount | arekzb: Did you get my comments from yesterday? |
20:50:20 | Varriount | (You were the one who wanted a critique on the string matching procedure, right? |
20:50:30 | arekzb | Varriount: yes, thank you for the input |
20:51:09 | arekzb | i have made some adjustments on local repo and I'm still profiling using the nim profiler |
20:51:36 | * | irrequietus joined #nim |
20:52:02 | arekzb | i'm benchmarking that code against Lua and C++, it is very comparable |
20:52:05 | * | bjz quit (Read error: Connection reset by peer) |
20:52:07 | * | bjz_ joined #nim |
20:52:55 | Varriount | arekzb: If you want any reviews on newer versions of the code, feel free to ask. |
21:00:18 | * | nande joined #nim |
21:02:34 | * | repax joined #nim |
21:09:26 | * | gour quit (Quit: Leaving) |
21:14:47 | * | Sphax quit (Quit: ZZZZZzzzzz) |
21:15:35 | * | meanfish quit (Ping timeout: 256 seconds) |
21:16:39 | * | repax quit (Quit: repax) |
21:18:24 | * | bjz_ quit (Ping timeout: 265 seconds) |
21:19:12 | * | Sphax joined #nim |
21:28:59 | * | Demon_Fox joined #nim |
21:29:16 | * | shodan45 quit (Quit: Konversation terminated!) |
21:34:42 | * | sepisoad joined #nim |
21:34:45 | * | z3744817276842 quit (Remote host closed the connection) |
21:38:06 | * | jpoirier joined #nim |
21:42:40 | * | rpag joined #nim |
21:44:11 | sepisoad | is there a debugger for nim? |
21:46:15 | BlaXpirit_ | gdb :| |
21:46:15 | ldlework | sepisoad: gdb I hear |
21:49:01 | * | sepisoad quit (Ping timeout: 256 seconds) |
21:51:08 | * | Matthias247 joined #nim |
21:52:37 | renesac | you guys could have linked this discussion about debugger: http://forum.nimrod-lang.org/t/680 |
21:55:53 | * | BitPuffin quit (Ping timeout: 240 seconds) |
21:57:28 | flaviu | BlaXpirit_: GDB isn't that bad |
21:57:38 | BlaXpirit_ | :| |
21:57:43 | flaviu | As I keep saying, the hardest part is just getting started |
21:58:00 | BlaXpirit_ | it's bad enough that it's much easier to do by hand |
21:58:52 | flaviu | Print out a cheat sheet and you'll get the hang of it quickly |
21:59:19 | Araq | there are lots of frontends available for gdb |
21:59:45 | Araq | renesac: learn about #def for c2nim, I'm using it to wrap thousands of lines of C++ code |
21:59:56 | flaviu | Yep, use one of those if you're not l33t h@x0r enough for gdb :P |
22:00:07 | ldlework | lol |
22:00:26 | Araq | but yeah it's "broken". lol. works much better than any comparable tool. |
22:00:43 | * | Varriount|Mobile joined #nim |
22:01:21 | * | sepisoad joined #nim |
22:03:55 | * | Epic|gmpreussner joined #nim |
22:04:05 | * | gmpreussner__ quit (Ping timeout: 252 seconds) |
22:06:27 | * | BitPuffin joined #nim |
22:08:30 | Araq | Epic|gmpreussner: --symbol:foo is not --define:foo |
22:08:47 | Araq | but this warning will disappear in the next version anyway |
22:09:05 | Araq | was only for transition of existing code to the new defined vs declared split |
22:14:18 | * | brson quit (Quit: Lost terminal) |
22:14:27 | * | brson joined #nim |
22:16:50 | * | leavengood joined #nim |
22:18:46 | * | sepisoad quit (Quit: Leaving) |
22:19:38 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
22:19:46 | kokozedman | at this stage ... what are the flags to produce a final binary without any checks and optimized for speed? |
22:20:07 | kokozedman | I used: -d:release --opt:speed --checks:off |
22:20:07 | def- | -d:release |
22:20:11 | kokozedman | those enough? |
22:20:47 | kokozedman | def-: are --opt and --checks still relevant? |
22:20:47 | def- | -d:release implies --opt:speed and --checks:off |
22:20:56 | kokozedman | oh, ok |
22:20:59 | def- | you can see it in config/nim.cfg |
22:21:03 | def- | -d:release is defined there |
22:21:32 | kokozedman | ok, thank |
22:21:35 | kokozedman | thanks* |
22:23:24 | def- | if it's still too slow, I'm always interested in investigating why |
22:24:31 | gmpreussner|work | Araq: ah, thanks for clarifying! |
22:37:15 | wtw | sry for reposting: I get the following error when doing ./koch boot -d:release on FreeBSD |
22:37:18 | wtw | compiler/nimcache/cgen.o: In function `cgenwritemodules_592360': |
22:37:20 | wtw | cgen.c:(.text+0x22e30): undefined reference to `writemapping_203898' |
22:37:23 | wtw | collect2: error: ld returned 1 exit statu |
22:37:28 | wtw | anybody knows a cure? :) |
22:40:58 | BlaXpirit_ | wtw, a few days ago i heard that a guy had to use an old version of nim, that was ported to freebsd. that may mean nim doesn't normally work on freebsd |
22:41:56 | wtw | i suppose that guy was me, I'm on 0.9.2 currently because this is the latest available version |
22:42:03 | BlaXpirit_ | oh :p |
22:42:07 | wtw | :) |
22:42:28 | wtw | however, I found some mentioning of freebsd in various build files so I supposed there must be some way |
22:43:08 | * | rpag quit (Quit: Leaving) |
22:43:10 | def- | wtw: what compiler are you using? |
22:43:14 | def- | c compiler* |
22:43:32 | wtw | clang, but gcc exhibits the same problem |
22:43:54 | wtw | but clang is the default on freebsd |
22:44:32 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:44:44 | BlaXpirit_ | wtw, make sure to try both master and latest release |
22:44:50 | BlaXpirit_ | i can't help :| |
22:44:59 | wtw | ok I haven't tried latest before, but will |
22:45:17 | wtw | strangely, the compiling seems to work fine, only the linking step fails |
22:53:54 | def- | wtw: strange, where does writemapping come from? |
22:55:04 | def- | ah, it should be from compiler/nimcache/extccomp.c |
22:58:08 | wtw | ah, I have a N_NIMCALL(void, writemapping_203894) |
22:58:29 | wtw | the number doesn't match, the linker is missing writemapping_203898 |
22:58:34 | def- | ok, somehow the number became wrong, strange |
23:00:23 | wtw | funny how this generated code looks :D |
23:00:27 | wtw | 6 if (!!(((gglobaloptions_169118 &(1<<((((NU8) 12))&31)))!=0))) goto LA3; |
23:02:44 | wtw | I just renamed the writemapping_203894 to writemapping_203898 |
23:02:54 | wtw | now it's missing writemapping_203894... |
23:03:08 | def- | nim will probably overwrite the file if you just run it again |
23:03:32 | def- | koch* |
23:03:34 | * | gokr quit (Ping timeout: 245 seconds) |
23:04:01 | wtw | my change is still there but apparently something else goes wrong |
23:04:07 | * | gmpreussner joined #nim |
23:04:22 | def- | i guess you should've done the change the other way around |
23:04:25 | * | Epic|gmpreussner quit (Ping timeout: 244 seconds) |
23:05:34 | wtw | i.e.? :) |
23:05:48 | def- | writemapping_203898 to writemapping_203894 |
23:06:19 | BlaXpirit_ | lol what |
23:06:40 | * | gsingh93 joined #nim |
23:07:07 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:07:23 | * | BlaXpirit joined #nim |
23:08:02 | wtw | did the change on the "other side" (cgen.c) |
23:08:25 | * | gokr joined #nim |
23:08:25 | wtw | now it's missing writemapping_203898 |
23:08:34 | wtw | arg :/ |
23:08:34 | def- | alright, no idea |
23:08:48 | wtw | thanks anyway |
23:12:06 | BlaXpirit | i'm pretty sure if u fixed this one tiny thing, 100 more would come afterwards |
23:13:09 | wtw | yeah, quite likely :/ |
23:17:53 | BlaXpirit | where the heck is fowl though |
23:32:18 | * | yglukhov______ quit (Quit: Be back later ...) |
23:32:52 | Araq | wtw: dunno why it fails on FreeBSD for you. likely some config is weird for "koch csources" |
23:33:09 | Araq | I will have a look later |
23:36:22 | wtw | tell me if/how I can help, I'll be away (in bed) now, however ;) |
23:38:00 | wtw | I'd also be willing to "adopt" the nim port for freebsd if the current maintainer doesn't want to continue, but I'll talk to him some time soon |
23:38:21 | Araq | yeah good, I was about to suggest that |
23:42:07 | * | JinShil joined #nim |
23:42:35 | * | Var|Mobile joined #nim |
23:43:22 | * | yglukhov______ joined #nim |
23:46:32 | * | Varriount|Mobile quit (Ping timeout: 245 seconds) |
23:47:49 | * | yglukhov______ quit (Ping timeout: 244 seconds) |
23:49:31 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:56:01 | onionhammer | so araq... how about adding that new new syntax to system.nim :P |
23:57:15 | Araq | nah. it solves no problem whatsoever |
23:57:22 | onionhammer | it's sugar |
23:58:11 | onionhammer | using new() right now is a pain imo |
23:58:49 | ldlework | onionhammer: the one where you can initialize fields when creating a ref type? |
23:59:12 | onionhammer | ldlework when using a non-ref type |
23:59:27 | onionhammer | if you have a ref type you can just use myrefType(field: 5) |
23:59:35 | ldlework | wait really? |
23:59:47 | ldlework | jsudlow: go refactor our game |