00:00:18 | Araq | zezba9000: ah so you're filwit's brother |
00:00:52 | zezba9000 | am I? Never! ... yes I am :) |
00:01:51 | Demos_ | wait... why the hell did they put #pragma pack(1) on a struct with all unsigned char members |
00:03:13 | renesac | Demos_, for packing them tightly on a vector? |
00:04:17 | Araq | zezba9000: converting c# to nimrod is ... a challenging task |
00:04:55 | Araq | many of C#'s concepts do not map directly to nimrod |
00:05:20 | zezba9000 | Araq: Not to much, iv'e already done prototyping for converting C# to C++, HLSL and GLSL ect... But Nimrod as a great GC, so it should not be to hard, just time consuming. |
00:05:28 | Demos_ | but a struct filled with 8bit data members is gunna be aligned |
00:05:33 | * | EXetoC quit (Quit: WeeChat 0.4.3) |
00:05:55 | Araq | zezba9000: how do you translate interfaces? |
00:06:57 | renesac | Demos_, aligned by n bytes, right? they probably don't want this alignment |
00:07:21 | zezba9000 | I need to look at Nimrod more to give you a better answer, but there is always a way. |
00:07:21 | zezba9000 | Nimrod doesn't support object inheritance? |
00:07:34 | Araq | it does but no MI, no interfaces |
00:07:44 | Demos_ | they are using #pragma pack(1) which says to align everything to single bytes, and the natural alignment of a bunch of bytes is that |
00:07:44 | Araq | you can implement interfaces via closures |
00:08:02 | renesac | how many 8bit data members are there? |
00:08:07 | Demos_ | three |
00:08:08 | Araq | which is surprisingly hard to grasp for many people ... I wish I knew why |
00:08:24 | renesac | so, in a vector they will probably be aligned by 4 or 8 bytes |
00:08:32 | renesac | wasting space |
00:08:44 | Demos_ | if I just let the library deal with allocation I should be fine though |
00:08:47 | renesac | with no benefit if you are acessing them one byte at a time |
00:08:57 | zezba9000 | Araq: It doesn't need to support C# fully... C++ doesn't and it could be done. As long as Nimrod supports virtual methods it should be fine |
00:09:17 | Demos_ | nimrod's "virtual methods" are different than c#'s |
00:09:26 | zezba9000 | In what way? |
00:09:50 | Araq | Demos_: I think they are close enough |
00:09:51 | Demos_ | they are multimethods |
00:09:56 | renesac | Demos_, as long as you are not sharing vectors containing that struct with the C code, maybe |
00:10:14 | Araq | Demos_: c# has multi methods too btw. nobody noticed though. |
00:10:19 | zezba9000 | If they both support virtual methods the logic is can be converted to be the same |
00:10:23 | Demos_ | Araq: with dynamic right? |
00:10:38 | Araq | yup |
00:11:02 | Varriount | Araq: Haiku's filesystem layout is quite... refreshing |
00:12:11 | zezba9000 | For C# system libraries, for say the "System.IO.FileStream" object I would make shims in Nimrod that emulate the C# system APIs |
00:12:55 | zezba9000 | So after conversion, you could lay the C# code next to the Nimrod version and the logic would be identical for the most part. |
00:14:29 | Araq | zezba9000: well you seem to have quite some experience with it and a subset of C# seems fine so go ahead. |
00:14:47 | Varriount | Araq: Couldn't interaces be done via typeclasses? |
00:15:18 | Araq | Varriount: no typeclasses work at compile-time, interfaces at runtime |
00:20:29 | zezba9000 | Araq: "it does but no MI, no interfaces" -- About this: So your saying I could not convert something like "class A : B, IC, ID" ? |
00:21:11 | zezba9000 | Sorry I guess I could ask FIL to have him fill me in. |
00:21:15 | Araq | you can convert it, but it's gonna be ugly |
00:23:29 | zezba9000 | Well how do you normally do OO in Nimrod then? If I can't do that, it would break casting in the code |
00:23:35 | zezba9000 | **casting types |
00:26:04 | Araq | hmm yeah, I guess you should simulate MI with 'cast' |
00:29:23 | Demos_ | you should probably do MI by implementing the vtbl yourself |
00:29:52 | Demos_ | and the trouble with "real" MI like C++ has is that you have to move the pointer around when you cast to a base |
00:29:57 | Demos_ | I gotta eat |
00:34:22 | * | Demos_ quit (Ping timeout: 264 seconds) |
00:40:09 | * | darkf joined #nimrod |
00:41:14 | Araq | zezba9000: I'm sure we'll come up with enough hacks to make it work good enough |
00:41:15 | * | psquid joined #nimrod |
00:41:18 | Araq | good night |
00:41:44 | zezba9000 | Araq: I'm having Philip show me how it could be done now. |
00:42:05 | zezba9000 | Although he said, someone is making the interface model as well |
00:44:08 | Araq | not sure what that means |
00:44:30 | Araq | people here usually use component systems for games from what I can tell |
00:45:58 | zezba9000 | He said zahary has been working on an interface system thats more similar to C#.. not sure yet... as you said, i'm sure we can figure it out |
00:46:39 | * | Matthias247 quit (Quit: Matthias247) |
00:47:30 | Araq | that would be the typeclasses |
00:47:47 | Araq | which are compile-time entities |
00:47:54 | * | io2 quit () |
00:47:57 | Araq | but perhaps that's enough for your use cases |
00:52:24 | renesac | I get ' Error: named expression expected' in this line: var res: TimeitResult = (best: 0.0, loops: loops, repeats: repeats) |
00:53:22 | renesac | TimeitResult is a tuple |
00:55:33 | Araq | but report, but I already know the cause |
00:55:36 | Araq | *bug |
00:55:44 | Araq | it's in a template right? |
00:55:47 | renesac | yes |
00:55:54 | Araq | yeah yeah yeah |
00:56:04 | renesac | ok, I will open a issue |
00:56:39 | Araq | workaround: rename the 'repeats' parameter |
00:57:06 | renesac | and the loops, right? |
00:57:12 | Araq | right |
00:57:15 | Araq | in fact |
00:57:21 | Araq | it might not be bug |
00:57:49 | Araq | you have to realize templates are stupid and they will substitute their parameters pretty much everywhere |
00:57:57 | Araq | but report it, I'll have a look |
00:58:07 | renesac | well, my work around is defining it, and then setting each one of them separatedly |
00:58:19 | renesac | but now I'm getting another weird error |
00:58:46 | renesac | "Error: identifier expected, but found '3'" |
00:59:08 | renesac | calling the template, that has only int args |
00:59:20 | renesac | and a stmt last arg, of rouce |
00:59:24 | renesac | *course |
00:59:46 | Araq | template t(p): expr = (p: p) |
01:00:03 | Araq | t(3) --> (3: 3) # identifier exprected but found '3' |
01:00:10 | Araq | good night |
01:00:18 | renesac | good night |
01:02:52 | * | Demos_ joined #nimrod |
01:16:56 | * | 16WAA11SD quit (Remote host closed the connection) |
01:20:16 | * | psquid quit (Quit: reboot) |
01:20:37 | * | carum quit (Remote host closed the connection) |
01:23:25 | * | flaviu quit (Remote host closed the connection) |
01:24:03 | * | psquid joined #nimrod |
01:32:09 | * | darkf quit (Quit: Leaving) |
01:32:23 | * | darkf joined #nimrod |
01:37:50 | * | carum joined #nimrod |
01:47:30 | * | carum quit (Remote host closed the connection) |
01:49:16 | * | Demos_ quit (Ping timeout: 265 seconds) |
01:50:22 | Demos | Varriount, ping |
01:57:35 | Skrylar | meep |
02:05:43 | * | Demos_ joined #nimrod |
02:06:29 | * | brson joined #nimrod |
02:22:03 | * | carum joined #nimrod |
02:22:24 | * | zezba9000 left #nimrod (#nimrod) |
02:23:45 | Skrylar | Well that is awkward. The 64-bit offset basis for FNV doesn't actually fit in a 64-bit field |
02:25:35 | fowl | fnv = fallout new vegas? |
02:50:25 | * | Varriount quit (Ping timeout: 240 seconds) |
03:04:49 | Skrylar | fowler-noll-vo hash |
03:12:04 | renesac | Skrylar, have you seen this topic: http://forum.nimrod-lang.org/t/320 |
03:12:05 | renesac | ? |
03:12:48 | Skrylar | renesac: no, and i've already written my siphash code |
03:13:01 | renesac | yeah, I know... |
03:13:43 | Skrylar | i'll probably put that up this evening, i have some other things on this branch to port over |
03:15:44 | * | carum quit (Remote host closed the connection) |
03:16:41 | renesac | and are you sure that you are using an u64 to store this offset basis? |
03:16:57 | renesac | as it should fit.. |
03:17:12 | Skrylar | i told it to and it didn't work; pasted the number in to windows calculator out of curiosity and it didn't fit either |
03:17:28 | renesac | hum |
03:19:16 | renesac | 0x1465_0FB0_739D_0383 <-- is this one? |
03:19:45 | renesac | from 14695981039346656037 |
03:20:49 | * | Demos_ quit (Ping timeout: 240 seconds) |
03:23:13 | Skrylar | that looks like it |
03:23:34 | Skrylar | # 64 bit offset_basis = 14695981039346656037 |
03:23:51 | renesac | yeah, it fits on 64bits |
03:24:05 | Skrylar | Error: number [..] out of valid range |
03:24:30 | renesac | try the hex version |
03:24:49 | Skrylar | i also trie 'u64 and uint64() around that earlier |
03:25:13 | renesac | yeah, the hex version works |
03:25:28 | renesac | I dunno why the normal one don't |
03:26:01 | * | DAddYE joined #nimrod |
03:29:06 | Skrylar | i'm not sure if there is a 'correct' way to hash a number |
03:29:17 | Skrylar | I looked at the templates I used for it, and they just pass it off like binary data |
03:29:34 | Skrylar | which is ignorant of big/little endian, but i'm not sure who is using data hashes in a context where big/little endian matters |
03:30:07 | renesac | well, for hash tables the endiannes don't matters |
03:30:11 | Skrylar | siphash specifically uses little endian internally for its magic numbers, while network byte order (the "correct" endian to use for servers and networking) is big |
03:30:29 | renesac | for MACs, etc, it matters |
03:30:40 | Skrylar | it would not be hard to make the hash functions use a specific one (is there a when 'big endian' in nimrod?) but i'm not sure if that is the correct thing to do |
03:30:41 | renesac | probably because siphash is optimized for intel? I don't know |
03:30:51 | Skrylar | in my experience, hash APIs usually don't ask |
03:31:37 | Skrylar | all though Siphash also has the option of inputting a 16-byte key, which I assume is meant for app-specific use (the key isn't anything cryptographically special, just the interval [0,15]) |
03:31:50 | renesac | the API should not ask, it should use the correct one |
03:32:12 | renesac | in cases where it matters of course |
03:32:16 | Skrylar | I preserved the key parameter; there are both |
03:32:29 | Skrylar | you can do Siphash24(data, length, key) or just Siphash24(data, length) and it uses the 'default' key |
03:32:33 | renesac | for a hash table, you don't want to waste time doing that |
03:32:56 | renesac | is the default key fixed or random? |
03:33:07 | Skrylar | fixed, same key as the reference code |
03:33:47 | Skrylar | it looks like its there in case an app wants to fiddle with their hashes |
03:33:58 | renesac | well, for attack resistence you will want to put your key |
03:34:10 | renesac | it is there to avoid DDOS atacks |
03:34:20 | Skrylar | also a cuckoo hash requires 2+ hashes, so i'll probably use the key field for that |
03:34:23 | renesac | that is the whole point of siphash actually |
03:35:03 | Skrylar | i was reading about cuckoos and there's one other one on wikipedia similar; they're supposed to increase utilization of the buckets pretty well |
03:35:08 | renesac | some atacker can't generate lots of colisions unless he knows the key used in your hash |
03:35:30 | Skrylar | In the past I used this weird two-stage tree thing for unicode, but that required allocating a 65k cell array per plane |
03:35:48 | Skrylar | i figured a hash table would make a better glyph cache if the rumors about asian languages not using all 500k characters has any merit |
03:36:28 | renesac | yeah, they should use less than 3k characters normally |
03:36:57 | renesac | well, I don't know how that translates to unicode code points, but anyway |
03:37:13 | Skrylar | japanese and chinese at least use one CP per kanji |
03:37:27 | renesac | yeah |
03:37:30 | Skrylar | hangul has a special bag of sad |
03:38:04 | renesac | hangul has a few basic parts, but I don't know how that multiplies in unicode |
03:38:19 | Skrylar | the guys who wrote REAPER open sourced their windowing/platform kit.. might peek in there later for inspiration |
03:38:29 | Skrylar | hangul in unicode gets its own algorithm |
03:38:57 | renesac | anyway, you will probably store less than 2^31 itens, so you can split your 64bit hash in two halves |
03:39:22 | Skrylar | i want to say each hangul character still gets its own codepoint but the "more optimal" way of storing it on stream is to compose it |
03:39:30 | Skrylar | i may be wrong because i ignored the asian section for unicode |
03:39:56 | renesac | that is probably right |
03:40:13 | Skrylar | also that guy's siphash is scary |
03:40:20 | Skrylar | he branches for every stage of the last part |
03:40:29 | renesac | I don't like cuckoo hashing much as you need at least two random jumps on memory to try to get your value |
03:40:54 | renesac | Skrylar, yeah... aparently the c compiler was smart to compile it |
03:41:00 | Skrylar | i have a while loop because its one of those "well i hope the optimizer unrolls this" |
03:41:09 | Skrylar | i would *prefer* to put the actual duff device in |
03:41:32 | Skrylar | maybe i should make a forum post arguing for {.fall.} |
03:41:39 | Skrylar | that would pretty much solve the duffing problem |
03:41:42 | fowl | Skrylar, you could always emit the loop |
03:41:51 | Skrylar | i prefer not to emit things |
03:41:55 | renesac | almost a duff device... an duff device would have a while loop inside it |
03:42:06 | renesac | this only use the implicit fall throught |
03:42:08 | fowl | Skrylar, you will have to if you want fallthrough |
03:42:25 | Skrylar | i did a workaround for the time being, still going to bother araq about a fallthrough pragma |
03:42:39 | renesac | create a github issue |
03:42:41 | Skrylar | people are going to look at us like we're dumb if we can't port a duff device without slowing the program down |
03:44:12 | fowl | really |
03:44:15 | renesac | I don't know what he did in that post, but latter he gets one of the best performance from nimrod |
03:44:33 | renesac | after the cast trick |
03:44:37 | Skrylar | GCC magic :\ |
03:44:46 | renesac | yeah, probably |
03:44:51 | Skrylar | I tend not to like relying on 'optimizer magic' when you can't see for sure |
03:45:13 | Skrylar | one of the really old LISP references went on about how you can run (disasm 'this-func) to make sure it actually did what you hoped it would do |
03:45:31 | renesac | true, that is one of the atractives of compiled programs vs JIT ones |
03:45:49 | renesac | predictable performance |
03:45:54 | Skrylar | you could have the same in a compiled IDE too |
03:46:08 | Skrylar | look up the debug symbols and dump the asm in a special view |
03:46:21 | Skrylar | i just don't know of an IDE that has thought to make it a user-friendly feature |
03:47:56 | renesac | anyway, FNV is fast for very short inputs (<8 chars), but going much bigger MMH3 and friends are faster and higher quality |
03:48:51 | renesac | and then there is sipHash that is somewhat slower but can really hide it's seed |
03:48:59 | renesac | from attackers |
03:50:12 | fowl | Skrylar, is there a duffs device in go or rust? |
03:51:41 | Skrylar | i haven't used go in several revisions |
03:55:38 | renesac | I wonder if we can just take the final 256 bits of state from sipHash and output it like it was a 256bit hash |
03:56:48 | renesac | maybe with a siphash-4-8 to make it a bit more higher quality, maybe... |
04:05:58 | Skrylar | i'm not a cryptonerd, i coudln't answer that for you :( |
04:07:14 | Skrylar | i do love templates though, at least nimrod templates |
04:07:40 | Skrylar | its so much nicer being able to just go "yeah this is how you convert ints in to pointers, now put those in the generic pointer hash function" |
04:24:43 | * | eigenlicht quit (Ping timeout: 244 seconds) |
04:56:04 | * | silven_ joined #nimrod |
04:56:49 | * | q66 quit (Quit: Leaving) |
05:22:02 | * | brson_ joined #nimrod |
05:23:52 | * | DAddYE_ joined #nimrod |
05:24:22 | * | DAddYE quit (Excess Flood) |
05:24:22 | * | runvnc quit (Excess Flood) |
05:24:30 | * | brihat1 joined #nimrod |
05:24:37 | * | brihat quit (Excess Flood) |
05:24:37 | * | silven quit (Write error: Broken pipe) |
05:24:37 | * | brson quit (Write error: Connection timed out) |
05:24:51 | * | runvnc_ joined #nimrod |
05:24:51 | * | cark quit (Excess Flood) |
05:24:51 | * | betawaffle quit (Ping timeout: 3092 seconds) |
05:25:44 | * | cark joined #nimrod |
05:25:59 | * | betawaffle joined #nimrod |
05:26:05 | * | Varriount joined #nimrod |
05:45:55 | fowl | "The empty table can be written {:}" |
05:46:00 | fowl | when is this useful to anyone |
05:46:39 | * | zielmicha quit (Quit: Connection closed for inactivity) |
06:24:47 | * | r0b1 quit (Quit: WeeChat 0.4.2) |
06:36:11 | * | brihat1 left #nimrod (#nimrod) |
06:36:22 | * | brihat1 joined #nimrod |
06:36:56 | * | brihat1 left #nimrod (#nimrod) |
06:37:36 | * | brihat joined #nimrod |
06:38:18 | Varriount | Demos: Pong |
06:39:13 | Varriount | fowl: Storing the health status of a player/entity in a game? |
06:40:13 | Demos | Varriount, you still need an image loading library? |
06:40:37 | Varriount | Demos: Yes. |
06:40:44 | Demos | I made a wrapper for freeimage |
06:40:54 | Varriount | Can it be used commercially? |
06:40:59 | fowl | Varriount, wut |
06:41:35 | Demos | Varriount, sure. I choose the to use freeimage under the FIPL, and my wrapper is MPL |
06:41:49 | Varriount | FIPL? |
06:42:05 | Demos | so as long as you put in a disclaimer that you are using freeimage and include the FIPL license text you can do what you want. Freeimage Public License |
06:42:09 | Demos | Freeimage is dual licenced |
06:42:16 | Demos | in face Unity3D uses it |
06:42:24 | Demos | hit up https://raw.github.com/barcharcraz/packages/master/packages.json for the package list |
06:42:33 | Demos | my pr has not gotten into the "real" packages repo |
06:42:48 | fowl | Demos, i will merge it but are you sure you dont want to call the package assimp? |
06:43:27 | Demos | yeah you are right, maybe I should call it assimp |
06:43:31 | Demos | and freeimage |
06:44:29 | Demos | OK changed |
06:44:40 | Varriount | fowl "type Player = object of GameEntity; health: int; status: set[PlayerStatus];" "proc newPlayer(): Player = new(result); result.status = {:};" |
06:45:08 | fowl | Varriount, {:} is an empty dictionary |
06:45:42 | Varriount | Oh, I misread, sorry. |
06:46:01 | Varriount | Can you even add to a "table" like that? |
06:46:05 | fowl | {"x":"y"} == [("x","y")], so {:} is an array length 0 which is not much use |
06:46:38 | fowl | i doubt you can add to it |
06:46:46 | fowl | the array is fixed length |
06:46:55 | fowl | maybe if you do @{"k":"v"} |
06:47:35 | Varriount | At that point, what you really need is the tables module. |
06:47:56 | NimBot | nimrod-code/packages master 0de0ba5 charlie barto [+0 ±1 -0]: added assimp wrapper |
06:47:56 | NimBot | nimrod-code/packages master 13f543c charlie barto [+0 ±1 -0]: added the nim-freeimage freeimage wrapper |
06:47:56 | NimBot | nimrod-code/packages master fc16c49 Charlie Barto [+0 ±1 -0]: Update packages.json |
06:47:56 | NimBot | nimrod-code/packages master 0e67c8c Billingsly Wetherfordshire [+0 ±1 -0]: Merge pull request #48 from barcharcraz/master... 2 more lines |
06:48:00 | Varriount | Demos: How do you code with an infected middle finger? |
06:48:38 | Demos | Varriount, what? |
06:48:42 | fowl | Varriount, its cool though because the table constructors can use the dictionary syntax |
06:48:47 | fowl | {"x": "y"}.toTable |
06:49:56 | Varriount | Demos: My middle finger hurts like the blazes when I touch anything with it. |
06:50:12 | Demos | you should see a doctor |
06:52:55 | Varriount | Hm. I hope we (the community) didn't scare filwit off. |
06:57:12 | Skrylar | Demos, Varriount: you know, SOIL is a thing too :( |
06:57:51 | Varriount | Skrylar: Does it work on Android, and opengl ES? |
06:57:58 | Demos | Skrylar, but I dont /want/ something that reads into a GL texture |
06:58:10 | Demos | I dont think it will give you immutable storage either |
06:58:23 | Skrylar | I don't have the source code memorized so I can't say much about it |
06:58:40 | Skrylar | I know that i used SOIL+stb_truetype in a program once and it made a frighteningly small runtime though |
06:59:02 | Skrylar | SOIL+stb_truetype+Lua and a little ANSI C is scary in how you can end up with a 700kb version of Renpy |
06:59:03 | fowl | devil has image altering functions in the ILU module just saying |
06:59:15 | fowl | devIL used in many commercial games just saying :p |
06:59:39 | Demos | freeimage can load an image and do conversions to whatever pixel format you need, then give you a pointer to the data. Freeimage is maintained, unlike DevIL and SOIL |
06:59:53 | Demos | also the unterface DevIL gives is dumb |
07:00:00 | Demos | and Freeimage is not that big |
07:00:01 | fowl | devil not maintained because its perfected |
07:00:07 | Skrylar | ah pixel conversion |
07:00:17 | Skrylar | i don't look forward to doing that shit when i get to GUI coding |
07:00:20 | fowl | there is a maintained fork, ResIL, i couldnt get it to compile |
07:00:20 | Demos | fowl, then why is there a fork to maintain it |
07:00:42 | Demos | I think making a library that tries to copy the design of OpenGL is a really bad idea |
07:00:58 | Varriount | Demos: You mean, OpenAL? |
07:00:58 | fowl | Demos, why is there only one version released of this fork? devil hasnt been updated since like 2009 |
07:01:20 | Skrylar | I'm not sure what designs one expects from a C library |
07:01:27 | Skrylar | It's not like they have a wide range of patterns to choose from |
07:01:29 | fowl | meh |
07:01:39 | fowl | complaining that you pass around a handle to the image instead of a pointer |
07:01:41 | Skrylar | Look at the nebulous nightmare of GObject |
07:01:48 | * | r0b1 joined #nimrod |
07:02:30 | Skrylar | I wonder if the man-hours which gobject has consumed both in people just getting it to compile + dealing with the copypasta to use it has equated to more time than just using a Better C |
07:02:55 | Demos | but c++ sucks and is slow and sucks and sucks and is to complex and slow |
07:03:06 | Varriount | C++ is slow? |
07:03:13 | Demos | sarcasm |
07:03:18 | Skrylar | Varriount: well it is to the C99 nerds :) |
07:03:38 | Skrylar | I saw a published paper that documented a C++ program wastes about 20% of its runtime on dereferencing the vtables |
07:03:41 | Demos | also why the hell would anyone use C99, if you are in C you presumably want to run on things that are not UNIX |
07:03:47 | * | Varriount wonders if the world needs a 'sarcasm' character. |
07:03:58 | Skrylar | Varriount: :P |
07:04:04 | Demos | Skrylar, well a GObject program could do the same thing |
07:04:17 | Skrylar | Separate statements |
07:04:26 | Skrylar | the vtable thing is separate from the C99 nerding |
07:04:39 | Demos | and c++'s vtables are actually eaiser to optimize sometimes since you are not allowed to change them |
07:04:40 | Skrylar | They could have, I donno, used Obj-C maybe |
07:04:55 | Skrylar | I mean they HAVE an Obj-C compiler. There's OpenStep, GNUStep, they could jank gobject in to that |
07:05:16 | Skrylar | considering all they would had to have done is plugged a runtime under it and they would have already had everything else |
07:05:40 | Skrylar | GObject and ANSI C is not "better" than GNU Obj-C |
07:05:47 | fowl | is there any motivation to use objc on linux |
07:05:54 | Skrylar | fowl: GNUStep |
07:05:57 | fowl | are there any kickass libraries for it |
07:06:02 | Demos | vala is the saddest thing I have ever read about |
07:06:19 | Skrylar | I was just saying they *could* have used the existing Obj-C parser and compiler, and refactored GObject on to it |
07:06:37 | Skrylar | considering gobject spends a great many SLOC doing the exact same damn things |
07:06:42 | fowl | yea definitely |
07:06:44 | Skrylar | with way less readable syntax |
07:06:50 | Varriount | Demos: Genie (A python-like derivative of Vala) looks neat, but under-documented |
07:07:18 | fowl | GNUstep is a free, object-oriented, cross-platform development environment that strives for simplicity and elegance. |
07:07:27 | fowl | is it an IDE or a DE/WM? |
07:07:41 | Skrylar | its a desktop |
07:07:47 | Skrylar | gnustep is an implementation of OpenStep |
07:07:54 | Skrylar | Cocoa on OSX is an advancement of OpenStep |
07:08:29 | Skrylar | But people 'hate' objc because they are being ninnies about the smalltalk syntax and how its slow if you use it poorly |
07:08:30 | Demos | Vala is like "lets reinvent CFrount 20 years too late and not actually include any interesting features" |
07:08:42 | fowl | GNUstep is not... ...a desktop |
07:08:45 | fowl | from the website lol |
07:08:46 | Skrylar | Pet peeve: when someone says objc is slow yet lives by their python interpreter -_- |
07:09:22 | Demos | most of the slow stuff would be the GUI related dispatch, which is human limited anyways |
07:09:23 | Varriount | I have never said that objective c is slow. |
07:09:40 | Skrylar | I didn't say Varriount did, I just said it annoys me when people diss objc for reasons that are silly |
07:09:56 | Skrylar | All though its been deemed anathema by the GNU community in general, so *shrugs* |
07:10:18 | Varriount | And I live with my python interpreter. It lives in my heart, and shares a bunk-bed with the nimrod compiler. |
07:10:43 | Skrylar | python tends to be on my computer because someone else just *had* to go and use it |
07:11:07 | Skrylar | i love the migraine of python 2.7.X and 3.X on the same computer and when two separate programs demand an incompatible python |
07:11:42 | Varriount | Skrylar: Thats why I have python binaries named 'python27.exe' and 'python33.exe |
07:11:45 | Varriount | in my path |
07:11:55 | Skrylar | Varriount: that doesn't help because people just write 'python' in their cmakes |
07:12:24 | Demos | someone has got to have written a huge cmake module for dealing with this |
07:12:28 | Skrylar | "wait, you mean CEGUI wants python 3.x in the path as 'python' but zziplib wants python 2.7 to make docs and I DONT GET TO TURN THAT STEP OFF *selfstabs*" |
07:13:11 | Skrylar | lua is the happiness <3 |
07:13:11 | Demos | I have actually been thinking about how we might be able to use cmake to have babel install native deps on windows |
07:13:13 | Varriount | Skrylar: I found out that CEGUI is used by a recently bought game - torchlight 2 |
07:13:24 | Skrylar | Varriount: CEGUI is used by tons of stuff |
07:13:36 | Skrylar | As is OGRE |
07:13:49 | Skrylar | ogre+cegui is more or less the "i couldn't afford a game engine" crowd, lol |
07:14:14 | Varriount | Skrylar: Anyway I think objective c is disliked by the GNU community for the same reason that some people dislike C# and Java - It's seen as controlled by Apple |
07:14:41 | Skrylar | Varriount: i think they're just C weenies tbh |
07:15:07 | Skrylar | Stallman is a lisper that tries to pretend C is lisp |
07:16:29 | Skrylar | anyway, meh. for the moment nimrod is pascalish enough that it makes me happy |
07:17:34 | Varriount | It's pythonic enough (and almost as importantly, unjava-ish enough) to make me very happy. |
07:17:43 | Demos | nimrod compiles fast... I came to nimrod after getting sick of c++ and essentially saying "sure there I can use all this C code but for each library I use I need to spend 30-45mins dicking around in cmake" |
07:18:09 | Skrylar | Varriount: now we just have to shoo away the "MAKE IT MORE LIKE ..." crowd |
07:18:14 | Demos | generics need fixin though, I really, /really/ like eigen |
07:18:41 | Demos | or a feature where you can pass generic arguments to an importc'd c++ template |
07:18:44 | Skrylar | I sorta feel bad for filwit at the moment |
07:19:08 | Varriount | Skrylar: Yeah, but I don't wanna shoo away filwit - he's a good developer. He turned the (unfortunately awful) original nimrod sight into something that doesn't make my eyes bleed. |
07:19:21 | Skrylar | he's not one of the 'make it more like X' people though |
07:19:37 | Skrylar | well, i guess at times |
07:19:49 | Demos | I dont actually mind his syntax changes. I dont really care that much about the syntax |
07:19:57 | Skrylar | the syntax proposal i don't like because removing : makes it unpascal, but his other changes require doing that or they don't make sense |
07:20:27 | Demos | I am not here for the syntax |
07:20:40 | * | Skrylar slides Demos in to a lisp compiler |
07:21:14 | Varriount | Anyone recall the url of the original nimrod website? Something like 7force.de? |
07:22:47 | fowl | yea |
07:23:35 | Varriount | fowl: I mean, the exact article. I'm trying to see if there's an archive of it anywhere. |
07:23:39 | Varriount | *url |
07:23:51 | * | xenagi quit (Remote host closed the connection) |
07:24:05 | Skrylar | the unittest module confuses me sometimes |
07:24:37 | Skrylar | i thought about trying to port VowsJS to nimrod |
07:25:00 | Demos | well docs for unittest would be kinda nice |
07:25:02 | Demos | I like it though |
07:25:05 | Skrylar | (porting rspec is so.. expected... *goes to pun prison*) |
07:25:06 | Demos | pretty much like gtest |
07:25:17 | fowl | Varriount, you can see the archive of nimrod-code.org |
07:25:41 | Skrylar | Demos: it has some bugbears in it |
07:25:52 | Skrylar | Demos: like var parameters don't get updated outside of a check statement |
07:26:01 | Skrylar | I peered in to that file and its a cobweb of macros |
07:26:32 | Demos | I expect as much, and I dont really care, as long as it works |
07:26:50 | Demos | heck gtest is a cobweb of C macros! |
07:27:14 | Skrylar | i sorta question how complex does a testing lib need to be |
07:27:24 | Skrylar | then again i also looked in the source files for unity.c and theres ghosts in there too |
07:27:25 | fowl | Skrylar, its neat huh |
07:27:35 | Varriount | Skrylar: I love opening up a library that has the potential to be a nimrod wrapper, and finding... macros. Macros, everywhere. |
07:27:43 | fowl | the way that overlapping templates / macros work in unittest |
07:27:53 | fowl | mind boggling and awe-inspiring at the same time |
07:28:15 | Skrylar | i don't care how the implementation is done until i have to open it up to fix it >:E |
07:28:22 | Varriount | fowl: You want mind boggling, try understanding lambdalifting.nim |
07:28:25 | fowl | its not broken |
07:28:34 | fowl | Varriount, yea i know |
07:28:35 | Skrylar | fowl: my github issue would disagree |
07:28:39 | fowl | the compiler is cryptic |
07:28:51 | fowl | Skrylar, most issues are not really issues |
07:29:03 | fowl | like this one https://github.com/Araq/Nimrod/issues/984 |
07:29:11 | Varriount | "It's not a bug - It's a feature!" |
07:29:11 | Skrylar | well Araq agreed that the use-case was bug-behavior fwiw :/ |
07:30:16 | fowl | what # is it |
07:30:21 | Skrylar | https://github.com/Araq/Nimrod/issues/964 |
07:32:00 | Demos | yeah I can see how var vars are needed |
07:32:30 | fowl | Skrylar, ok that might be a real issue |
07:32:35 | Demos | althoug sometimes I worry that we are getting too close to the c++ cvref qualifier zoo |
07:33:20 | * | zahary1 joined #nimrod |
07:39:35 | Varriount | Demos: As far as I see it, a 'var' type parameter is just the implicit passing of a reference. |
07:40:33 | Demos | a ptr probably, and yeah, the thing is if you return a "var" it will collapse into a non-ref |
07:41:03 | Demos | not sure fixing it is worth is though, c++ has totally insane rules for this |
07:41:24 | Varriount | Maybe the best rule is just "use 'var' with care"? |
07:41:37 | fowl | Demos, no |
07:41:57 | fowl | var x = returns_a_var() will make a copy yes but you can do returns_a_var() += 5 |
07:41:57 | Demos | Varriount, I think vars are better than forcing people to use ptr or ref |
07:42:06 | Demos | yeah I knw |
07:42:36 | Demos | you can also say var x = addr returns_a_var() |
07:42:37 | Varriount | Demos: But refs/ptr's are used behind the scenes. |
07:42:53 | fowl | you can also cast a var T to/from a ptr T |
07:42:55 | fowl | lul |
07:43:01 | Demos | I know, but the whole point of var is so that you can write a function without careing about how the memory is handled |
07:43:05 | Demos | also vars are never null |
07:43:08 | Demos | which is nice |
07:43:30 | fowl | var is nice for c functions like sdl_pollevent |
07:43:34 | Varriount | Demos: No. Var parameters are supposed to be used when you want to modify the parameter itself. |
07:43:44 | Demos | yeah I know |
07:43:59 | Demos | so if you want to modify a param you use var, otherwise you use the type |
07:44:16 | Varriount | fowl: Wouldn't using var parameters with C wrapped functions cause wierd issues with the GC? |
07:44:19 | Demos | and because we have var we can modify params without saying "you must be untraced or traced or whatever" |
07:44:29 | Demos | Varriount, no |
07:44:35 | Demos | but for C functions you should use a ptr |
07:44:41 | fowl | Varriount, no, var is just a hidden ptr |
07:44:47 | fowl | Demos, i disagree |
07:45:08 | Demos | I think wrappers should be a close to the C as possible |
07:45:28 | Varriount | Demos: I don't know. Modifying/copying the opengl functions to accepts var int's and such would be highly helpful. |
07:45:28 | Demos | if you are making a higher level interface than go wild with nimrod features |
07:45:41 | Demos | I dont think so |
07:45:46 | fowl | Demos, there are c functions which would use pass-by-ref if they could (sdl_pollevent) |
07:45:47 | Demos | addr is not hard to write |
07:46:11 | Demos | also sometimes you do it wrong, then we have to write cast[var T](nil) and that is terrifying |
07:46:26 | Varriount | True... |
07:46:38 | Varriount | Though, that's more a problem with nil. |
07:46:44 | fowl | that will result in a segfault when the value is dereferenced |
07:46:56 | Varriount | fowl: Not with opengl |
07:47:08 | Varriount | Not if it expects a pointer to NULL |
07:47:30 | fowl | if 0 is acceptable then you shouldnt use var |
07:47:58 | Varriount | fowl: Tell that to the current opengl bindings. |
07:48:26 | Demos | point was that trying to make a C library wrapper "friendly" is just annoying |
07:49:01 | Varriount | Goodnight guys. |
07:49:12 | fowl | what |
07:50:01 | fowl | eventually ptr T will be compatible with var T |
07:51:05 | Demos | dont like that so much, not a huge deal. |
07:51:51 | Skrylar | renesac: you gave me the wrong hex for the offset basis earlier :( |
07:52:06 | Skrylar | i fished out the right hex for it and everythings green now |
07:52:37 | Skrylar | fowl: isn't 'ptr' specifically unmanaged space? |
07:52:56 | Skrylar | i thought the reason ref/ptr/var were separate is because they deal with different memory |
07:53:27 | Demos | well ptr can point anywhere |
07:53:32 | Skrylar | Demos: i should probably write a higher level interface to GL :/ @earlier |
07:53:36 | Demos | var can also point anywhere (except to nil) |
07:53:39 | Skrylar | WON'T THAT BE FUN <no it wont> |
07:53:55 | Demos | Skrylar, writing a higher level interface to GL is hard/not possible |
07:54:11 | Skrylar | game engines do it all the time? |
07:54:34 | fowl | Skrylar, no, you can even get var T by derefing ref/ptr T |
07:55:06 | Skrylar | Demos: the difference between GL4, GL3Core, GLES and GL2.x+Shaders is not much |
07:55:16 | Skrylar | As far as the high level interface regarding binding geometry to objects |
07:55:36 | Skrylar | its' mostly a matter of whether you get the luxury of calling glCreateBlah or if you have to monkey around ARB versions of the same |
07:56:23 | Demos | right, but it is hard to not loose performence. And you want an alternitive to GL not an alternitive to a rendering engine |
07:56:48 | Skrylar | i don't want an alternative to GL. i want an interface that hides the boring parts of GL :) |
07:57:31 | Demos | right, it may be possible, but it would be very hard |
07:57:33 | Skrylar | and with templates and distinct types, you can hide a lot of that for free |
07:57:43 | Demos | true |
07:57:45 | Skrylar | though you do run in to the question of "do you check glError every call?" |
07:57:52 | Demos | no |
07:57:53 | Skrylar | most people *don't* |
07:58:04 | fowl | when defined(debug) broo |
07:58:13 | Skrylar | all though there are times you really *should*, like glCompileShader stuff |
08:00:04 | Skrylar | i still sorta wonder if i should just wrap some winapi stuff for GUIs |
08:00:11 | Demos | yes, but glCompileShader and glLinkProgram have seperate functions to get success |
08:00:14 | Skrylar | all though writing winapis is basically walking head first in to throwaway code |
08:00:34 | Demos | Skrylar, no. Not even microsoft uses winapi for guis these days |
08:00:53 | Skrylar | they do, its buried under mounds of MFC |
08:01:02 | Demos | well not for WPF I think |
08:01:10 | Demos | and MFC is not updated any more |
08:01:12 | Demos | and it is terrable |
08:01:16 | * | Skrylar shoves WPF in to the corner |
08:01:44 | Skrylar | if i was going to use webcrap i'd at least use libcef or something |
08:01:58 | Skrylar | you're wasting about as many resources touching WPF as you do with a chrome process |
08:03:15 | Demos | and wpf has more magic than web I think |
08:03:22 | * | zahary1 quit (Quit: Leaving.) |
08:03:23 | Demos | yeah I dont like wpf |
08:03:32 | Demos | copy qt |
08:04:05 | Demos | I gotta go to bed |
08:04:10 | * | Demos quit (Quit: Leaving) |
08:06:27 | * | DAddYE_ quit (Remote host closed the connection) |
08:06:55 | * | DAddYE joined #nimrod |
08:07:57 | Skrylar | Araq, renesac: https://github.com/Skrylar/Skylight/blob/master/skylight/fnv.nim and https://github.com/Skrylar/Skylight/blob/master/skylight/siphash.nim |
08:11:35 | * | DAddYE quit (Ping timeout: 265 seconds) |
08:13:05 | * | Endy joined #nimrod |
08:20:02 | * | DAddYE joined #nimrod |
08:39:08 | * | r0b1 quit (Ping timeout: 265 seconds) |
09:35:25 | * | [1]Endy joined #nimrod |
09:38:01 | * | Endy quit (Ping timeout: 240 seconds) |
09:38:01 | * | [1]Endy is now known as Endy |
09:56:35 | * | Matthias247 joined #nimrod |
10:06:07 | * | skyfex_ quit (Quit: Computer has gone to sleep.) |
10:09:57 | * | nande quit (Remote host closed the connection) |
10:27:49 | * | DAddYE quit (Remote host closed the connection) |
10:28:15 | * | DAddYE joined #nimrod |
10:32:43 | * | DAddYE quit (Ping timeout: 265 seconds) |
10:33:11 | * | q66 joined #nimrod |
10:40:20 | * | io2 joined #nimrod |
11:27:02 | * | awestroke joined #nimrod |
11:28:48 | * | DAddYE joined #nimrod |
11:29:02 | * | silven_ is now known as silven |
11:33:38 | * | DAddYE quit (Ping timeout: 265 seconds) |
12:01:54 | * | EXetoC joined #nimrod |
12:29:20 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:08:40 | * | darkf quit (Quit: Leaving) |
13:16:18 | * | awestroke quit (Ping timeout: 240 seconds) |
13:18:59 | zahary | Araq, when tuples are matched in sigmatch, the compiler always creates an nkHiddenConv node |
13:19:49 | zahary | why do we do that? |
13:19:49 | zahary | https://github.com/Araq/Nimrod/blob/devel/compiler/sigmatch.nim#L1107 |
13:19:50 | zahary | I have a peculiar problem that stems from the lack of the nkHiddenConv in some situations and I'm not sure how to fix it: |
13:19:50 | zahary | https://gist.github.com/zah/9f925779e27ec515e4b1 |
13:19:55 | * | awestroke joined #nimrod |
13:20:16 | dom96 | It seems it's not possible to `from module import symbol` where `symbol` was exported in `module` from a different module. |
13:46:32 | Araq | zahary I think we can get rid of it, it is a legacy |
13:46:53 | zahary | but do you have an idea why the VM needs it? |
13:47:55 | NimBot | Araq/Nimrod devel d5c1653 Dominik Picheta [+0 ±5 -0]: Fixes to asyncio2 on Linux. |
13:48:10 | Araq | let me see |
13:52:18 | * | awestroke quit (Remote host closed the connection) |
13:56:45 | Araq | it doesn't work either way here |
13:57:07 | Araq | without the nkHiddenConv it doesn't crash, but it doesn't produce the desired output either |
13:57:42 | Araq | *with |
13:59:28 | EXetoC | it's getting hot in here |
13:59:55 | EXetoC | ah yes, still compiling C++ code |
14:01:18 | zahary | well, I have other fixes that are very related - let me push them |
14:06:06 | NimBot | Araq/Nimrod devel bf216b9 Zahary Karadjov [+1 ±8 -0]: implements higher-order inline iterators and return type inference for iterators |
14:06:06 | NimBot | Araq/Nimrod devel 3c8992a Zahary Karadjov [+0 ±3 -0]: implicit auto return type for inline iterators |
14:06:06 | NimBot | Araq/Nimrod devel 7a84d7a Zahary Karadjov [+2 ±1 -0]: fix #966... 2 more lines |
14:06:06 | NimBot | Araq/Nimrod devel 06cf888 Zahary Karadjov [+0 ±12 -0]: Merge branch 'devel' of github.com:Araq/Nimrod into devel |
14:06:06 | NimBot | 2 more commits. |
14:06:37 | zahary | I meant to say * that are not very related * |
14:06:57 | Araq | well I have to go now |
14:07:17 | Araq | to debug the vm, I use |
14:07:19 | Araq | c.echoCode(start) |
14:07:25 | Araq | in evalConstExprAux |
14:07:32 | Araq | to see the produced bytecode |
14:08:01 | zahary | yeah, I figured that part |
14:08:13 | zahary | ok, I'll try to see what's going on |
14:08:30 | Araq | LdArr r6, r7, r8 #system:1463 |
14:08:31 | Araq | AsgnStr r9, r6, r0 #temp2:19 |
14:08:41 | zahary | the code is the same, but ldLoadGlobal loads a different value |
14:08:50 | Araq | Loads the symbol "letters" into r6 |
14:09:01 | Araq | so the string assignment crashes |
14:09:12 | Araq | bbl |
14:13:05 | * | BitPuffin joined #nimrod |
14:14:09 | * | bobbybee joined #nimrod |
14:15:29 | dom96 | hello bobbybee |
14:15:35 | bobbybee | hello |
14:16:40 | dom96 | welcome to #nimrod :) |
14:16:45 | bobbybee | thanks |
14:21:03 | * | bobbybee quit (Ping timeout: 245 seconds) |
14:26:53 | Araq | zahary the vm codegen doesn't transform the nkExprColonExpr(key: val) to 'val' for your example |
14:27:31 | Araq | should be easy to fix |
14:29:21 | zahary | so far I've seen that complexAssign is used when nkHiddenConv is present, but it doesn't deal with nkExprColonExpr, so that's a little bit mysterious |
14:30:16 | Araq | nkExprColonExpr doesn't exist in the VM, the values are supposed to be canonicalized to nkPar(x, y, z) instead of nkPar(a: x, b: y, c: z) |
14:31:37 | Araq | bbl |
14:33:06 | zahary | ah, so it's actually not working in both cases - hmm, I'm almost sure I got the printouts at some point - then I drowned them in a sea of other printouts |
15:06:42 | NimBot | Araq/Nimrod devel 892b8ae Zahary Karadjov [+1 ±2 -0]: teach opcLdObj about nkExprColonExpr |
15:07:18 | zahary | now the nkHiddenConv case doesn't work, but I'll try to look for a more general solution later |
16:23:45 | * | Endy quit (Ping timeout: 252 seconds) |
16:27:26 | * | zielmicha joined #nimrod |
17:06:14 | * | BitPuffin quit (Ping timeout: 244 seconds) |
17:07:38 | * | BitPuffin joined #nimrod |
17:12:19 | * | Endy joined #nimrod |
17:28:41 | * | OrionPK quit (Ping timeout: 252 seconds) |
17:30:47 | * | flaviu joined #nimrod |
17:51:50 | * | bobbybee joined #nimrod |
17:52:27 | bobbybee | I feel like I'm missing something obvious, but what are the implications of osproc for cross-platform dev? |
17:52:30 | bobbybee | My situation is this: |
17:52:47 | bobbybee | I wrote an app that can call "ls" on *nix, works fine |
17:53:14 | bobbybee | Moved the code over to Windows (WINE, actually), and had it do dir instead, and boom, EOS File not found error |
17:53:44 | * | Matthias247 joined #nimrod |
17:54:10 | bobbybee | Any ideas? |
17:55:15 | dom96 | bobbybee: What function are you using to call ls/dir? |
17:55:25 | bobbybee | execProcess |
17:56:25 | dom96 | Did you set the options param in the call or did you leave it as default? |
17:57:13 | * | Endy quit (Ping timeout: 240 seconds) |
17:57:23 | bobbybee | defaul |
17:57:26 | bobbybee | *default |
17:57:49 | bobbybee | just a execProcess("dir") |
17:57:59 | dom96 | Then it should work. You could try using 'findExe' |
17:58:12 | bobbybee | ok, one minute |
17:58:20 | flaviu | bobbybee: couldn't you use walkDir in http://nimrod-lang.org/os.html instead? |
17:58:45 | bobbybee | ls/dir was just a test command, |
17:58:59 | bobbybee | in practice it's getting commands on the fly |
17:59:10 | dom96 | You may also try execCmdEx |
18:00:08 | bobbybee | tuples are accessed as [0]? |
18:00:26 | dom96 | yes, or by field name |
18:02:29 | * | princessao joined #nimrod |
18:02:55 | bobbybee | Huh. |
18:03:00 | bobbybee | I get the error either way, |
18:03:08 | bobbybee | however if I use cmd /c dir, it works fine |
18:04:57 | * | princessao quit (Remote host closed the connection) |
18:05:45 | bobbybee | very possibly a bug in nimrod's implementation itself, though I can't be certain |
18:12:18 | * | bobbybee quit (Ping timeout: 245 seconds) |
18:12:24 | dom96 | It's possible. There have been some changes to osproc recently |
18:25:29 | * | noam quit (Ping timeout: 241 seconds) |
18:35:06 | * | Demos joined #nimrod |
18:35:32 | * | noam joined #nimrod |
18:37:42 | Demos | YAY! more static[T] fixes. Thanks zah! |
18:39:27 | * | BitPuffin quit (Ping timeout: 265 seconds) |
18:45:05 | * | Endy joined #nimrod |
18:57:55 | * | kenjetaev quit (K-Lined) |
19:05:23 | NimBot | Araq/Nimrod devel 61d0452 Zahary Karadjov [+0 ±1 -0]: fix #949 |
19:05:23 | NimBot | Araq/Nimrod devel 3a7eb7a Zahary Karadjov [+0 ±1 -0]: fix #829; (macros.quote)... 6 more lines |
19:05:25 | Varriount | Demos: What does static[T] do again? |
19:06:05 | Demos | compile time constant params |
19:06:14 | Demos | right now only params, not generic params |
19:06:21 | Demos | which is what I really want them for tbh |
19:06:36 | flaviu | I wonder if they would work in a loop |
19:06:43 | Varriount | So, they ensure that parameters are known at compile time? |
19:07:19 | zahary | yes, the compiler tries to evaluate the param if it manages to do so, the overload is considered |
19:07:50 | zahary | the the evaluated value can be read statically in generics and in marcos |
19:08:01 | fowl | is there a way to get a count of global variables (besides hand counting them) |
19:08:10 | flaviu | So it would allow for simple static checking. Sounds really useful |
19:08:24 | fowl | i want to see how many globals using entitty creates, its at least one per component and one per message |
19:08:34 | zahary | fowl, you mean by using some standard API or by modifying temporary the compiler? |
19:10:01 | fowl | whichever is easier i guess, probably not worth the work to modify the compiler |
19:11:13 | * | BitPuffin joined #nimrod |
19:12:38 | zahary | if you are debugging something, you can add a single line to cgstmts.getSingleVar - this should catch all globals I think |
19:12:49 | zahary | genSingleVar |
19:15:36 | * | psquid_ joined #nimrod |
19:16:25 | * | BitPuffin quit (Ping timeout: 240 seconds) |
19:16:25 | * | psquid quit (Ping timeout: 240 seconds) |
19:20:01 | Varriount | I thought the number of globals was set at compile time.. |
19:24:56 | * | r0b1 joined #nimrod |
19:39:09 | fowl | Varriount, the globals are in generics that get instantiated |
19:39:17 | fowl | zahary, tyu |
19:51:06 | zahary | fowl: if you know which function is creating the globals, another technique is to just add static: echo statements inside it - they will be executed once for each instantion |
19:51:11 | * | skyfex joined #nimrod |
19:52:29 | skyfex | If I have a C function that give me an array in the form "some_struct **foo", how do I access the elements of that array in Nimrod? |
19:53:23 | zahary | try casting the some_struct* to a very large nimrod array |
19:54:13 | zahary | also, see the unchecked pragma that Araq added a few days ago |
19:54:52 | * | nande joined #nimrod |
19:55:40 | fowl | zahary, im going to test using openarray[T] for c functions that take (T*, int) (or the other way around, i have to check what it compiels to again) |
19:59:29 | * | Endy quit (Ping timeout: 240 seconds) |
20:01:45 | * | mangat joined #nimrod |
20:10:24 | Demos | cast it to a ptr array[0..50000, ptr TFoo] |
20:13:38 | Araq | dom96: 'dir' is builtin and so cannot be executed with osproc |
20:13:54 | Araq | he should exec a real program not a shell builtin |
20:14:05 | fowl | isnt there an execshell() |
20:14:31 | Araq | true but I'm not sure even that is guaranteed to work |
20:14:50 | Araq | and it's not like 'dir' cannot be expressed with os.nim |
20:15:31 | NimBot | Araq/Nimrod devel 6b8cbc3 Zahary Karadjov [+1 ±2 -0]: fix #909 |
20:16:44 | zahary | today, I avarage 1.6 lines per fix :) |
20:19:53 | Araq | perhaps I should review your changes :P |
20:21:59 | Araq | btw I now think we should copy C++ when it comes to overload resolution as the current implementation is essentially not spec-able |
20:22:21 | Araq | and a more declarative approach would help, I think |
20:22:47 | zahary | the plan is to try the subset rules we discussed recently |
20:23:13 | Araq | that is C++'s approach, right? |
20:23:40 | zahary | yes, although they don't have our tyOr or tyAnd types |
20:23:41 | * | Endy joined #nimrod |
20:24:11 | fowl | t1 and t2? what does that do |
20:24:37 | zahary | where are you looking, fowl? |
20:25:20 | fowl | i inferred it from "tyAnd" |
20:25:45 | Araq | zahary you should compile "niminst" btw. It takes like 2 minutes because the source code filters produce long lists of & operations |
20:26:01 | zahary | type Foo = Synchronized and Serializable |
20:26:18 | zahary | type Bar = int or string # also (int | string) |
20:26:42 | fowl | o |
20:27:14 | Demos | those just define typeclasses though right? |
20:27:44 | EXetoC | yup but they aren't user-defined :p |
20:29:28 | Demos | and with overloading you would want the most specific match right? |
20:30:56 | zahary | yes - probably there will be some pain due to new ambiguities tho - I'm not sure how to treat our "closest scope" rule |
20:36:56 | Araq | the "closest scope rule" is adhoc and I think its "precedence" is downright wrong |
20:37:31 | Araq | but it's definitely hard to nail how this should work |
20:37:47 | zahary | I think it's useful - my current thinking is towards some pragma that lets you pick your overriding model |
20:38:08 | Araq | I never said it's not useful |
20:38:55 | Araq | and no, please don't add pragmas to influence overloading resolution |
20:39:04 | zahary | if you say "I want to override everything" for some inner proc, it will be matched even if it's less specific |
20:39:50 | Araq | yeah but I can also come up with a unique name instead and use that |
20:41:38 | * | Endy quit (Ping timeout: 240 seconds) |
20:41:38 | zahary | well, we'll see - maybe this should be added only on a proven-need basis |
20:42:16 | skyfex | Is it possible to specify the storage type of an enum? |
20:42:33 | skyfex | That is, I have a uint8 which is actually an enum |
20:43:07 | Araq | type MyEnum {.size: 1.} = enum ... |
20:43:23 | Araq | but nimrod picks the smallest reasonable size for your enum anyway |
20:43:32 | Araq | so it will use uint8 already |
20:44:39 | Demos | dear god my test opengl app is clocking in at 9MB |
20:45:07 | fowl | /ban Demos no rust/go in here thx |
20:46:12 | Demos | if I compile it with just nimrod c mayapp.nim I get like a 500k app that will only run from my msys2 shell (because DLLs you see), if I compile with a bunch of flags for a full static link it works, but is large |
20:46:40 | fowl | dont the dlls work if you put them in the app dir |
20:47:00 | Demos | yeah but that defeats the point |
20:47:16 | fowl | how? you're on windows |
20:47:22 | fowl | its common to ship dll with the binary |
20:47:30 | Demos | maybe, but it is stupid imo |
20:47:44 | fowl | beats having different versions of stuff fighting on your FS |
20:47:59 | Demos | does not beat just having everything static linked |
20:48:19 | fowl | is it quicker that way or something |
20:49:18 | skyfex | Bug(?): destructors are not called on variables defined in a top-level statements |
20:49:38 | fowl | skyfex, those are global vars |
20:49:40 | Araq | skyfex: known issue but *when* should they be invoked? |
20:50:32 | skyfex | Araq: When the app closes? Doesn't that make sense? |
20:50:57 | Araq | that's nasty to implement and mostly code bloat |
20:51:11 | * | Mat3 joined #nimrod |
20:51:12 | Araq | the OS shuts down your file handles anyway |
20:51:15 | skyfex | Alright, I can see it's not important, I just found it curious |
20:51:18 | Mat3 | hello |
20:51:50 | skyfex | what about... for x in someProc: ... where someProc returns an object with a destructor.. I get: |
20:51:58 | skyfex | cardreader.nim(10, 16) Error: usage of a type with a destructor in a non destructible context |
20:52:27 | Araq | that looks like an oversight of mine |
20:52:40 | Demos | fowl, it is smaller that way, you can strip the exec |
20:53:31 | Demos | oh fucker I need to call a freeimage function only if I am static linking freeimage, is there any way to detect if I am static linking something |
20:53:54 | fowl | idgw you hate dynamic linking, it makes sense to ship your product with the version libraries it needs |
20:54:38 | fowl | Demos, use -d:staticlinkfreeimage to decide to static link |
20:54:46 | Demos | yeah that is what I was thinking |
20:58:18 | * | flaviu quit (Read error: Connection reset by peer) |
20:58:43 | * | flaviu joined #nimrod |
21:04:03 | * | Endy joined #nimrod |
21:04:35 | Demos | I bet I could reduce the executable size by linking microsoft's c++ standard library instead of libstdc++, but I would have to recompile assimp |
21:13:01 | skyfex | If I don't make a type (an object) public, does that mean it can't be copied? |
21:13:14 | Araq | no |
21:13:57 | skyfex | I'm creating an interface to libusb, and there's a function to get a list of devices, and the library wants me to call a free function on the list when I'm done with it |
21:14:18 | skyfex | I was thinking of putting it in a destructor.. |
21:15:33 | skyfex | but if the object I've wrapped the list pointer in gets copied, it will be trouble |
21:15:38 | Demos | please do not do that, make a wrapper of the C library that is as close to the C as it can be then use that to make a more nimrodic interface for people to use |
21:15:54 | skyfex | I'm doing that.. |
21:16:16 | skyfex | Currently in the same file, but I can split it |
21:16:25 | Demos | allright |
21:16:26 | fowl | skyfex, make that function private and wrap it to give you a seq |
21:17:06 | fowl | what demos said |
21:18:05 | Araq | skyfex: I'm not sure what your problem is really, overloading of '=' is planned and with the .error pragma you can then disable '=' for certain types |
21:19:19 | skyfex | Araq: Hmm.. yeah, I think fowl is onto something better anyway.. just put all the contents in a seq, and free the list immediately |
21:22:18 | skyfex | But I also need to free the content of the list (it contains device references) when I'm done with them.. If I wrap the pointer in a ref object, can I free the content of the pointer when the wrapper object is garbage collected somehow? |
21:23:47 | Mat3 | ciao |
21:23:50 | * | Mat3 quit (Quit: Verlassend) |
21:26:19 | fowl | skyfex, http://build.nimrod-lang.org/docs/system.html#144 |
21:26:55 | skyfex | fowl: Ah, right, thanks! |
21:36:12 | * | filwit joined #nimrod |
21:37:44 | Araq | hi filwit |
21:38:05 | filwit | hey quick question, how do i get the underlining T of a ref object? |
21:38:09 | filwit | hi Araq |
21:38:24 | Araq | type(foo[]) should work |
21:38:57 | NimBot | Araq/Nimrod devel 9f6f739 Zahary Karadjov [+0 ±5 -0]: fix #866; generic static params |
21:40:30 | filwit | just to be clear, that's the same as... type PFoo = TFoo; TFoo = object ... ; var a:TFoo; var b:type(PFoo) # a and b are same type |
21:41:11 | Araq | with zahary's recent changes type(PFoo[]) might produce TFoo |
21:41:20 | filwit | for some reason i thought this would just give a type description.. and that would be PFoo |
21:41:41 | Araq | note the [] dereference |
21:41:51 | filwit | ah, right i see |
21:41:58 | fowl | sweet |
21:42:03 | zahary | hmm, why my recent changes - it should have always worked like that |
21:42:27 | Araq | zahary [] used to require an lvalue |
21:42:40 | Araq | and couldn't deal with types |
21:42:44 | zahary | ah, that's a type here, I see |
21:43:16 | zahary | so what have I changed exactly? |
21:44:22 | filwit | fowl: btw, your Assimp lib needed a little touchup, but it's work good with Collada files. Still need to make sure Blender exports Collada with multi-uvs (as Assimp doesn't seem to like .blend files), but I'm hopeful it'll work. So thanks for the wrapper man |
21:45:15 | fowl | filwit, demos moved it to a new repository |
21:45:17 | Demos | it is actually fowl's wrapper, I just split it into its own repo and fixed some bugs |
21:46:05 | Demos | OMGOMGOMGOMGOMG! #886 was fixed it is like christmas and zahary is santa! |
21:46:47 | fowl | we should get notifications about closed issues |
21:46:48 | filwit | Demo, fowl: i just copied it for the moment. Will look at using y'alls actually wrapper later on |
21:47:08 | zahary | :) well, go try it our Demos - I wouldn't be surprised if you find another issue |
21:48:15 | fowl | filwit, i also moved sdl2 to its own repos and im going to fix the type names (Window for PWindow, there is no TWindow anyways) |
21:50:29 | filwit | fowl: yeah i plan on using that as well, probably before I release code |
21:50:43 | filwit | fowl: for the moment I'm just keeping my own things so i can work out any problems i run into |
21:51:24 | fowl | good idea, github doesnt have any features to promote collaboration |
21:51:38 | fowl | d; |
21:53:50 | * | Endy quit (Read error: Operation timed out) |
21:56:54 | runvnc_ | excuse me, how can I de-reference a reference? I need to get a TServer from a PAsyncHTTPServer |
21:57:54 | fowl | deref is postfix [] |
21:58:20 | runvnc_ | thanks |
22:04:04 | fowl | ah filwit Demos Varriount Skrylar I also have a freetype GL wrapper that I totally forgot about, that will def save you some steps if youre using fonts with gl |
22:04:30 | filwit | fowl: thanks again |
22:06:27 | fowl | np |
22:07:58 | * | askatasuna quit (Ping timeout: 264 seconds) |
22:11:04 | * | brson_ quit (Ping timeout: 244 seconds) |
22:15:06 | Demos | just freetype or freetype with gl? |
22:15:33 | fowl | with gl, sf.net/projects/ftgl |
22:15:56 | Demos | filwit, what kind of touchup do I need? |
22:17:09 | filwit | Demos: i can't remember off the top of my head sorry, and busy at the moment. May have been just a lib-linking issue on Arch, can't remember. I'll get back to you. |
22:36:32 | NimBot | Araq/Nimrod devel 8485d32 Zahary Karadjov [+0 ±4 -0]: further improvements for static generic params; activate the hardest test cases |
22:36:58 | zahary | Ok, Demos, now I challenge you the break the implementation :P |
22:40:07 | Demos | nope |
22:40:51 | Demos | thethe bug I opened (#986) still happens |
22:44:25 | zahary | ah, ok, I haven't tried to implement that part yet - it should be easy |
22:45:32 | Araq | zahary whatever it is that you're taking, don't stop ;-) |
22:48:09 | * | skyfex quit (Quit: Computer has gone to sleep.) |
22:49:21 | Varriount | Araq: Is there anything else that needs to be done with testament? |
23:08:33 | Araq | Varriount: I can't say until dom96 updated nimbuild |
23:09:03 | Varriount | Araq: Anything you want me to do in the meantime? |
23:09:23 | flaviu | I'm curious what implementation restriction prevents thread var initialization? |
23:12:38 | Araq | zahary: https://gist.github.com/anonymous/28fe2338e413b8962b43 |
23:13:06 | Araq | but the tasynciossl test seems to flatter |
23:13:42 | Araq | *flutter |
23:14:02 | Varriount | Araq: Is that test diff from the Windows builders? |
23:14:45 | zahary | hmm, but I just tested these very tests |
23:15:10 | * | OrionPK joined #nimrod |
23:18:33 | Araq | Varriount, zahary indeed only the windows builders report that |
23:19:12 | Varriount | Araq: The asynciossl tests are always dodgy - I've never been able to pinpoint why. |
23:19:29 | Araq | flaviu: var s {.threadvar.}: seq[int] = @[] # needs to inject thread creation so that every thread gets a fresh @[] |
23:19:54 | Araq | this is not impossible to implement but we've better things to do |
23:20:33 | Araq | and it's not even obvious to me people enjoy the resulting slightly slower thread creation and code bloat |
23:23:36 | Varriount | Araq, zahary: All those tests succeed on my personal build (updated about 5 minutes ago) |
23:23:57 | zahary | the windows tester have lied to me before |
23:24:17 | Varriount | Any idea as to what could have caused the tests to falsely fail? |
23:25:10 | zahary | I suspect something in the tester fails, not the compiler |
23:25:21 | Araq | I still think the windows testers are 1 commit behind |
23:25:33 | Varriount | I'll restart them then.4 |
23:25:35 | Araq | for some reason |
23:29:20 | Varriount | Araq: Part of the reason that the tasynciossl test fails on my machine is that occasionally, windows will block it from using the network because the test executable is 'suspicious', and if I |
23:29:39 | Varriount | I'm not around to let the exectutable run correctly, it fails. |
23:29:46 | renesac | https://github.com/Araq/Nimrod/issues/984 <-- added a comment |
23:30:08 | Varriount | Sorry for the bad typing, one of my fingers is bandaged. |
23:33:41 | Araq | zielmicha: "dlopen cannot resolve linker scripts, which are used on some Linux distros (for example, Gentoo) as an alternative to symlinks. dlopen caller is expected to provide path with full library" |
23:33:49 | Araq | are we really supposed to fix that? |
23:34:43 | Demos | since you are on gentoo you could go --dynlibOverride:foo and use passl to tell the linker wtf to do |
23:34:54 | Demos | you are compileing yourself |
23:35:20 | Araq | if Gentoo isn't interested in a working OS, how is that our problem? |
23:35:46 | Demos | I would actually love for there to be a library that deals with all these linking issues, but I suspect it is a huge rabbit hole |
23:36:03 | OrionPK | friggin comcast |
23:41:49 | Varriount | Araq: I thought you hated symlinks :p |
23:42:27 | Varriount | OrionPK: Added private messaging to ircFamilier yet? |
23:42:35 | OrionPK | no, sorry |
23:42:54 | OrionPK | but like I told dom, I'm going to be switching from a built in web server to SCGI |
23:43:05 | OrionPK | negating many of the issues it was having w/ the default std lib |
23:43:12 | OrionPK | and then open sourcing it |
23:43:24 | Demos | what is the max number of elements I can put in a set, I have an enum with like 200 items in it... |
23:43:28 | OrionPK | so you'll be able to contribute to it (hopefully you'll want to :)) |
23:43:38 | Araq | Demos: the limit is 65K iirc |
23:43:47 | Demos | that will work just fine |
23:43:49 | OrionPK | I havent had any time though, bought a house a week or so ago |
23:43:54 | Demos | and are all seqs the same size? |
23:44:14 | Demos | sorry sets not seqs |
23:44:19 | Araq | no |
23:46:26 | * | brson joined #nimrod |
23:46:33 | * | filwit quit (Quit: Leaving) |
23:47:43 | Araq | good night |
23:49:08 | Varriount | Good night. |
23:52:10 | Demos | if I want to be able to store a bunch of sets of different sorts of things in a seq should I use ref sets or TSets? |
23:54:08 | Demos | wait never mind |
23:55:43 | * | DAddYE joined #nimrod |
23:57:20 | NimBot | Araq/Nimrod devel e7e40e0 Zahary Karadjov [+0 ±3 -0]: fix #986 |
23:57:44 | * | io2 quit () |