00:00:39 | filwit | Araq: wait, why am i looking at nimfix? is this suppose to be a guide for a new docgen? |
00:01:12 | Araq | yes |
00:02:06 | filwit | Araq: k. you're right, probably better to just start from scratch and use the old as reference, considering we're going to separate it from the compiler. |
00:02:35 | * | DiffuseStorm joined #nimrod |
00:02:42 | Araq | hi DiffuseStorm welcome |
00:02:54 | DiffuseStorm | hi Araq, thanks |
00:03:07 | Araq | filwit: I hope you don't really mean "start from scratch" |
00:03:14 | Araq | that never works |
00:03:32 | Araq | you're doomed to repeat already fixed mistakes |
00:04:15 | filwit | Araq: well i meant.. not entirely. But since I have to move everything away from the compiler, i'll do it in chunks, and start small type of thing. |
00:05:30 | filwit | Araq: idk exactly, will see when I'm there more. I still have to finish the forums CSS first, but I'll be doing that really soon. I've already thought about how to do this, and honestly even if i did make one from scratch it doesn't seem that hard (given Nim's awesome macro ability & staticRead) |
00:07:23 | DiffuseStorm | New to the language, it seems really nice! Is it already known that on the 0.9.4 version downloaded from the website that echo seems buggy with floating point numbers, echo 40.5 returns 4.05? |
00:09:20 | filwit | DiffuseStorm: it's not a bug, Nim (currently) doesn't auto-format floats when converting to strings.. use `StrUtils.parseFloat(youVar, 3, FFDecimal)` (i think it's that, one sec) |
00:09:46 | Araq | it's formatFloat |
00:09:57 | filwit | ^ right |
00:10:01 | Araq | and we changed that already |
00:10:13 | DiffuseStorm | hmm ok cool |
00:10:25 | filwit | DiffuseStorm: http://nimrod-lang.org/strutils.html#formatFloat,float,TFloatFormat,range[] |
00:10:33 | Araq | DiffuseStorm: however, are you sure it doesn't produce an 'e' notation? |
00:10:40 | DiffuseStorm | oh crap |
00:10:43 | DiffuseStorm | it does |
00:11:16 | filwit | Araq: bigbreak auto formats? cool :) |
00:12:11 | DiffuseStorm | I'm not to used to the e notation, so I just forgot to think about that i guess. Thought it legimately was outputting the wrong result. |
00:12:12 | Araq | filwit: devel does that too, for quite some time |
00:12:26 | dom96 | imjoe: It's because the async proc will continue executing until an 'await' happens. |
00:12:28 | Araq | DiffuseStorm: hence my question |
00:12:58 | filwit | Araq: didn't realize, will go remove all my formatFloats now.. |
00:13:04 | Varriount | Araq: What was the last csources commit that worked with master? |
00:14:07 | Araq | Varriount: not sure, but 1 month ago everything worked |
00:14:54 | Araq | hmmm nimfix is unusable: nimfix tools\nimgrep.nim |
00:15:03 | Araq | --> stack overflow! |
00:15:25 | dom96 | imjoe: This may work better: https://gist.github.com/dom96/2d63e2a31a30feae54ea |
00:17:32 | filwit | dom96: btw, a little while ago I played around with Nim & Qt... was pretty straight forward actually, if you're willing to do minimal C++ Qt stuff to relay info to Nim |
00:19:06 | dom96 | filwit: Cool. Got any examples you could push up to git? |
00:19:12 | filwit | dom96: i remember you talking about wanting to try Qt before is why i mention it. I could make a test project for you (which is basically as far as I took it) and show you later. |
00:19:41 | dom96 | filwit: Araq: I would like to see some special styles for warnings in the docgen, that would definitely require docgen changes so jsondoc won't cut it. |
00:20:03 | dom96 | filwit: That would be awesome. |
00:20:21 | dom96 | I was going to try Qt but Qt Maker or whatever I was installing took forever to install. |
00:20:28 | imjoe | dom96: that has a similar result. there is an "await" in createRequest. I am just not understanding how this is suppose to work. I thought that the code after await would resume as soon as it had its data. but instead it's waiting until i stop making awaait calls (at least that's how it appears) |
00:21:17 | filwit | dom96: yeah, I'm not sure the jsondoc will cut it. I need to sort things around before outputing the HTML, which will probably be better if i have access to the AST not just a JSON file |
00:21:32 | Onionhammer | filwit not a bad idea |
00:22:01 | filwit | dom96: you'll need QtCreator (or at least that's what i used)... though I think there's a simpler way if you know how to use their qmake command |
00:22:19 | Jehan_ | Varriount: 7d454fb builds master for me. |
00:22:33 | Jehan_ | With some dire warnings, mind you, but it does. |
00:23:26 | imjoe | oh wait! i think i got it: if I add a poll() after asyncCheck createRequest("http://www." & doms[x]) then it starts to get saner |
00:23:42 | Jehan_ | Varriount: Also builds devel, now that I check. |
00:24:28 | dom96 | imjoe: Well, what do you want to happen? |
00:24:57 | Varriount | Jehan_: I created a 'bigbreak' branch at the latest commit, and reset the master branch to the commit you just specified. |
00:25:12 | Jehan_ | Varriount: Sounds good. |
00:25:13 | Varriount | I then created a devel branch at the same commit. |
00:25:53 | dom96 | imjoe: 'asyncCheck createRequest("http://www." & doms[x])' will execute 'createRequest' until there is a need to receive/send data from/to the socket. |
00:26:30 | dom96 | This will likely happen whenever the http client is connecting to that url. |
00:26:48 | dom96 | at that point control will return to that for loop |
00:26:57 | dom96 | and more requests will be created. |
00:27:36 | dom96 | These requests will indeed not progress until you call poll() |
00:28:12 | * | fowl joined #nimrod |
00:28:15 | filwit | Araq: btw, did you see this: http://spin.atomicobject.com/2014/09/03/visualizing-garbage-collection-algorithms/ |
00:28:43 | imjoe | ah. i didn't know about the poll part... so it is working faster now. i did just SIGSEGV though... |
00:28:45 | dom96 | Varriount: devel needs to be set to a different branch I bet. |
00:28:49 | filwit | Araq: I was wondering, looking at that, what Nim's GC would look like visualized that way |
00:29:04 | Araq | filwit: like RC I guess |
00:29:39 | Araq | but these visualizations do not give me anything |
00:30:39 | filwit | Araq: Nim's GC is "deferred RC" though... so that means the ref-counting happens only during "scan" right (and in separate data structures) ? |
00:30:46 | imjoe | dom96: looks like SIGSEGV happened in garbage collector: final line of stack trace: gc.nim(586) collectWhite |
00:30:59 | Jehan_ | dom96: There really aren't enough different commits. |
00:31:44 | Araq | imjoe: it always ends there and yet it's almost never the real cause |
00:32:13 | Araq | but it means I get the blame |
00:32:23 | dom96 | Araq: Nobody is blaming you. |
00:32:30 | * | fowl quit (Client Quit) |
00:32:31 | dom96 | imjoe: Can you gist the full stack trace? |
00:32:41 | imjoe | :-) then asyncdispatch.nim(755) addRead from bigbreak |
00:33:16 | Jehan_ | imjoe: If the GC is getting confused, then most likely you're having memory corruption issues. |
00:33:45 | imjoe | oh yeah, stack trace: https://gist.github.com/anonymous/55afe816a7d5a84964a2 |
00:34:40 | Araq | say what you want, but we have the best stack traces |
00:37:48 | imjoe | dom96: this is what caused it. I have the command line args I used near the top of the gist (webgetting 600 domains): https://gist.github.com/anonymous/012b5ae9809eea4a55ee my change was i added the poll() after the checkAsync... |
00:40:30 | dom96 | interesting. That does make things much faster. |
00:41:41 | Onionhammer | araq you mean queue traces? |
00:42:20 | Araq | Onionhammer: no stack traces |
00:43:35 | dom96 | imjoe: On Windows with a large number of requests it's pretty much the same though I think |
00:43:45 | dom96 | I'll boot up my VM and see what I can figure out on Linux |
00:45:04 | Onionhammer | Araq yeah but nims are backwards :p |
00:45:18 | dom96 | filwit: Araq: So what do you guys think? Styles + rst markup for warnings? |
00:45:47 | Araq | dom96: no idea what you mean |
00:46:02 | Araq | you mean **warning** in the doc comment? |
00:47:07 | dom96 | I mean being able to create a orange/red div with warnings in it to make users pay attention to them. |
00:48:40 | imjoe | It would be nice if httpclient had a "http: head" proc. useful for testing |
00:49:35 | dom96 | yeah, I need add post and head procs. |
00:49:47 | dom96 | you can use request with httpHead though |
00:50:19 | imjoe | yeah i'm gonna do that. i feel bad for all those poor wasted bits :-) |
00:50:28 | Araq | dom96: sure why not |
00:52:45 | NimBot | Araq/Nimrod bigbreak ae53d1e Araq [+0 ±2 -0]: nimgrep compiles again |
00:53:00 | dom96 | imjoe: ok, I can reproduce the crash. |
00:53:50 | Araq | good night |
00:54:07 | imjoe | good night Araq |
00:54:33 | imjoe | dom96: good, then i'm not crazy :-) |
00:58:04 | dom96 | imjoe: But anyway, I think the best way to do this is to have a concurrency number, and only launch that many requests at once. |
00:58:49 | dom96 | Using poll like this kind of accomplishes that because I can see it outputting the number of active requests around 20 |
01:00:07 | imjoe | yes i want to do that. i'm hoping to have 1K or 2K active outbound connections (whatever my disk can handle in writing out the results i want). |
01:01:21 | * | ics joined #nimrod |
01:01:54 | Araq | imjoe: oh btw when you write a crawler you should really give it "source protection" |
01:02:09 | Araq | which means you need to ensure to not DOS any server |
01:02:48 | Araq | that means a request every 3 seconds for a particular server |
01:03:14 | imjoe | yeah i should check that ip is not the same. i am doing 1 request for each domain, so hopefully not a big issue. but if 1 server hosts alot of those domains... i will add that. |
01:03:46 | Araq | ok, bye |
01:06:18 | * | willwillson quit (Remote host closed the connection) |
01:08:00 | dom96 | unfortunately this bug looks pretty bad |
01:08:12 | dom96 | i'll look at it some more tomorrow |
01:08:15 | dom96 | for now good night |
01:08:23 | imjoe | thanks dom96 i appreciate it |
01:08:31 | imjoe | have a good night |
01:08:34 | dom96 | imjoe: it's possible that it will disappear if you use a concurrency number instead |
01:08:39 | dom96 | thank you, bye! |
01:11:02 | * | Jehan_ quit (Read error: Connection reset by peer) |
01:11:22 | * | Jehan_ joined #nimrod |
01:25:27 | * | shiv joined #nimrod |
01:35:43 | * | Jehan_ quit (Quit: Leaving) |
01:36:27 | * | shiv quit (Quit: Page closed) |
01:52:05 | * | flaviu joined #nimrod |
01:54:03 | * | filwit quit (Quit: Leaving) |
02:20:26 | * | q66 quit (Quit: Leaving) |
02:23:28 | Varriount | Araq, dom96: The way I've arranged my csources repo ( at github.com/varriount/csources ) seems to work with all of the major branches of the nimrod repository. |
02:26:24 | * | vezzy quit (Ping timeout: 246 seconds) |
02:43:37 | * | askatasuna joined #nimrod |
02:50:05 | * | vezzy joined #nimrod |
03:00:29 | * | ARCADIVS joined #nimrod |
03:35:47 | * | saml_ joined #nimrod |
03:41:09 | * | milosn quit (Ping timeout: 240 seconds) |
03:42:20 | * | milosn joined #nimrod |
03:53:22 | * | askatasuna quit (Quit: WeeChat 1.0) |
04:29:31 | * | Jesin joined #nimrod |
06:55:18 | * | saml_ quit (Quit: Leaving) |
07:17:15 | * | flaviu quit (Ping timeout: 246 seconds) |
07:46:53 | * | bjz quit (Read error: Connection reset by peer) |
07:46:58 | * | bjz_ joined #nimrod |
08:02:41 | * | filwit joined #nimrod |
08:03:37 | filwit | dom96: when you wake up, here's the repo I made for using Qt with Nim: https://github.com/PhilipWitte/NimQt |
08:05:32 | filwit | dom96: it's a basic example (two buttons you can click on which send messages to Nim, which in turn echos them).. it doesn't require QtCreator or anything, but you'll like want to (at least) start playing around with QtDesigner to edit the .ui file eventually if you actually do anything with Qt |
08:06:37 | filwit | dom96: also, note that you have to compile with -d:release or it fails... probably a Cpp backend thing |
08:17:05 | filwit | ttyl |
08:17:06 | * | filwit quit (Quit: Leaving) |
08:43:26 | * | BlaXpirit joined #nimrod |
09:01:51 | * | Matthias247 joined #nimrod |
09:06:27 | * | wan quit (Ping timeout: 245 seconds) |
09:16:17 | * | io2 joined #nimrod |
09:18:26 | * | io2 quit (Client Quit) |
09:23:35 | Araq | Varriount: great. go ahead and change it please |
09:42:37 | * | io2 joined #nimrod |
09:52:59 | * | Rational joined #nimrod |
09:54:00 | * | milosn_ joined #nimrod |
09:54:20 | * | milosn_ quit (Client Quit) |
09:54:52 | * | milosn_ joined #nimrod |
09:55:00 | * | milosn_ quit (Client Quit) |
09:58:35 | dom96 | good morning |
10:02:18 | Rational | hi |
10:03:55 | dom96 | hello Rational, welcome |
10:17:21 | * | Trustable joined #nimrod |
10:28:27 | EastByte | ls |
10:28:31 | EastByte | whoop |
10:34:18 | DiffuseStorm | Documents Desktop Downloads Pictures Workspace |
10:45:47 | * | pafmaf joined #nimrod |
10:45:47 | DiffuseStorm | Where is some info on how things are passed into functions? |
10:47:03 | dom96 | DiffuseStorm: Likely the manual, what do you want to know? |
10:49:02 | DiffuseStorm | dom96: I noticed the usage of var like so: proc Test(val: var int) - What does var do in this case, and if its not there are things passed by value? |
10:49:40 | DiffuseStorm | I'll also take a look at the manual |
10:50:09 | dom96 | If 'var' isn't there then the compiler decides how to pass it. |
10:50:22 | dom96 | The 'var' means that you can modify the passed in parameter. |
10:50:30 | DiffuseStorm | oh the manual is a lot smaller than I expected, so I'll read that right away, I was expecting a c#/C++ full specification haha |
10:50:41 | DiffuseStorm | okay |
10:51:03 | dom96 | yeah, the manual is a nice reference. |
10:53:15 | DiffuseStorm | dom96: in this case when modifying val it is modifying the value passed in, not a local copy. Can the compiler choose between that and passing in a copy? |
10:53:37 | dom96 | no |
10:53:50 | dom96 | it'll always modify the value you passed in |
10:54:09 | DiffuseStorm | so it's like a c++ reference? |
10:54:22 | DiffuseStorm | is it possible to pass in an int by value and modify it? |
10:55:43 | DiffuseStorm | Or I just want to make sure that when passing in an int, without var, that it's by value because that's more efficient, is that the case? |
10:58:20 | dom96 | yes, the compiler will pass it in the most efficient manner. |
10:58:49 | dom96 | It's like a C# out param. |
11:02:05 | DiffuseStorm | dom96: well it looks more like the c# ref param, because you don't have to assign to it |
11:02:45 | dom96 | hrm actually yeah |
11:23:25 | * | pafmaf quit (Quit: This computer has gone to sleep) |
11:48:55 | * | kunev joined #nimrod |
11:49:51 | * | pafmaf joined #nimrod |
11:56:07 | * | pafmaf quit (Ping timeout: 245 seconds) |
12:01:09 | * | kunev quit (Ping timeout: 260 seconds) |
12:06:50 | DiffuseStorm | Is there anything like a c#/c++ constructor/destructor in the language? |
12:07:50 | EXetoC | no constructors. you'd use "proc initT..." for constructing a value type, and "proc newT..." for constructing a pointer type |
12:08:10 | * | kunev joined #nimrod |
12:08:24 | EXetoC | there are destructors though. see the destructor pragma |
12:09:06 | DiffuseStorm | oh yes! Destructors are the most useful |
12:09:20 | DiffuseStorm | Especially if doing manual memory management |
12:14:47 | * | kunev quit (Ping timeout: 245 seconds) |
12:18:27 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
12:23:42 | * | Ven joined #nimrod |
12:26:52 | * | ARCADIVS quit (Ping timeout: 252 seconds) |
12:30:48 | * | kunev joined #nimrod |
12:34:47 | reactormonk | so we're developing against bigbreak atm? |
12:39:56 | * | q66 joined #nimrod |
12:41:23 | * | kunev quit (Ping timeout: 255 seconds) |
12:42:08 | dom96 | reactormonk: me and Araq are, yes. |
12:54:24 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:55:56 | * | io2 joined #nimrod |
13:10:50 | * | vezzy quit (Ping timeout: 276 seconds) |
13:46:37 | * | darkf quit (Quit: Leaving) |
13:50:30 | * | willwillson joined #nimrod |
14:23:21 | * | filippo joined #nimrod |
14:25:06 | filippo | hi all, is it me or the actors module is broken? |
14:25:41 | filippo | i'm trying to make two actors communicate |
14:25:47 | filippo | http://pastebin.com/S4vpP90k |
14:26:02 | filippo | And the given example doesn't compile |
14:26:39 | filippo | first in my opinion the inbox procedure return a wrong return type |
14:27:23 | filippo | an actor has a channel of type TChannel[TTask[TIn, TOut]] |
14:28:13 | filippo | and so the inbox procedure should return a ptr TChannel[Task[TIn,TOut]] and not a ptr TChannel[TIn] |
14:46:09 | * | filippo_ joined #nimrod |
14:46:45 | * | filippo quit (Ping timeout: 264 seconds) |
14:49:13 | * | fran__ joined #nimrod |
14:51:27 | * | Fr4n quit (Ping timeout: 245 seconds) |
14:52:48 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:59:09 | * | Jehan_ joined #nimrod |
14:59:38 | DiffuseStorm | How do I create an Aporia project file? |
15:00:01 | DiffuseStorm | I noticed you can "Compile project" |
15:02:12 | * | nullmove joined #nimrod |
15:08:16 | willwillson | i think you make a file called module.nimrod.cfg, where module is the name of the module you want as the entry point |
15:09:23 | DiffuseStorm | it worked, thanks |
15:09:45 | willwillson | no problem |
15:24:48 | * | willwillson quit (Ping timeout: 246 seconds) |
15:27:50 | * | flaviu joined #nimrod |
15:50:41 | * | nullmove quit (Quit: Leaving) |
16:02:22 | * | woodgiraffe quit (Ping timeout: 240 seconds) |
16:06:17 | * | Jesin quit (Quit: Leaving) |
16:32:58 | EXetoC | DiffuseStorm: uh, there are of course actual constructors: T(field1: x, field2: y) |
16:33:09 | EXetoC | but they are often wrapped in procs |
16:34:15 | DiffuseStorm | EXetoC: are there constructors you can implement that run when doing something like: var num = TNum() ? |
16:34:30 | flaviu | DiffuseStorm: I've asked for that feature |
16:34:50 | flaviu | to allow overloading on type names |
16:35:01 | DiffuseStorm | oh i see, you mean you can specify internal members like so TNum(name: 40) |
16:35:33 | EXetoC | yes, if you want |
16:35:53 | EXetoC | flaviu: what do you mean? you can just overload procs, but the above syntax is nice and short |
16:36:29 | flaviu | You couldn't do `type Foo...\n proc Foo(abc: dsa): Foo` |
16:36:34 | flaviu | last time I checked |
16:37:26 | EXetoC | oh. yeah |
16:43:38 | EXetoC | didn't we introduce a pragma related to var parameters? I don't think it's listed |
16:44:19 | * | kunev joined #nimrod |
16:47:29 | * | bjz_ quit (Read error: Connection reset by peer) |
16:47:43 | * | bjz joined #nimrod |
16:49:19 | EXetoC | maybe not |
16:50:33 | * | fowl joined #nimrod |
16:52:35 | Jehan_ | DiffuseStorm: Nimrod is a procedural, not an object-oriented language (though it has some OO-like features). |
16:52:54 | Jehan_ | "Constructors" insofar as they exist are not associated with types. |
16:53:12 | Jehan_ | You have a module that defines a type and one or more procs that create instances of that type. |
16:53:29 | DiffuseStorm | All that means is I have to remember to call an init function, which is alright I guess. |
16:53:43 | EXetoC | what's the correct terminology then? initializer? |
16:53:55 | EXetoC | T(...) |
16:54:06 | Jehan_ | EXetoC: Constructor is really fine, I think, as long as you understand it's not the same as the OO concept. |
16:54:16 | Jehan_ | Plenty of terminology is overloaded. |
16:54:29 | EXetoC | that's not a *user-defined* constructor then? |
16:54:59 | EXetoC | but whatever |
16:55:07 | Jehan_ | EXetoC: Not sure what you mean? |
16:55:22 | DiffuseStorm | Jehan_: "one or more procs that create instances of that type" - So procedures that create the type themselves on a heap and return a reference? |
16:55:48 | Jehan_ | DiffuseStorm: Pretty much. |
16:56:21 | DiffuseStorm | ok that's pretty different from c++/c# where the constructors accept a pointer to the type. Meaning you can stack allocate them. |
16:56:25 | Jehan_ | Also note the difference between "object" and "ref object". If you want to allocate on the heap, "ref object" is what you need. |
16:56:40 | Jehan_ | DiffuseStorm: That's what "object" is for. |
16:56:49 | EXetoC | they create an object of said type, to be pedantic |
16:56:49 | * | def- quit (Ping timeout: 272 seconds) |
16:57:26 | Jehan_ | DiffuseStorm: One problem with OO-style constructors is that they don't have a good answer to the problem of an error occuring during construction. |
16:57:28 | EXetoC | we might get allocation-agnostic allocation at some point |
16:57:52 | EXetoC | but I often omit 'ref' from parameters now |
16:58:07 | EXetoC | it's not exactly much work to just dereference before passing in |
16:59:34 | DiffuseStorm | Jehan_: I'm confused. Do I have an option where the object is going to be located using these new/init procedures? |
16:59:53 | EXetoC | yes, see system.new |
17:00:22 | EXetoC | var x: ptr T; new(x) |
17:00:33 | Jehan_ | DiffuseStorm: If you have an "object", variables will be allocated on the stack for local variables, in static memory for global variables, and in thread-local memory for threadvars. |
17:00:49 | Jehan_ | If you have a "ref object", it will be allocated on the heap. |
17:01:06 | Jehan_ | By convention, newX procedures return a ref object, initX procedures return an object. |
17:01:08 | EXetoC | oops |
17:01:12 | EXetoC | s/ptr/ref |
17:01:38 | DiffuseStorm | Jehan_: right so I have to chose the correct procedure to get an object or a ref object |
17:01:38 | EXetoC | there are procs for pointers too though |
17:01:52 | DiffuseStorm | initX seems iffy, no? What is the object is large? |
17:01:57 | DiffuseStorm | if* |
17:02:01 | Jehan_ | DiffuseStorm: If you use the existing libraries, yes. But, basically, just look at the return type. |
17:02:06 | * | demilichsd joined #nimrod |
17:02:15 | Jehan_ | DiffuseStorm: The object does not actually get copied if it's a return value. |
17:02:34 | EXetoC | and you'd often allocate dynamically then anyway |
17:02:50 | DiffuseStorm | true, true |
17:02:56 | Jehan_ | Similarly, large objects are internally passed by reference to procedures (unless you use the {.byCopy.} pragma to force pass by value). |
17:03:04 | EXetoC | proc initT(): T = result.field1 = 9001 |
17:03:43 | EXetoC | I guess Jehan knows his stuff. bbl. happy coding and that |
17:03:46 | Jehan_ | This works, because non-var parameters are immutable, so it's safe to pass a reference in. And var parameters are by reference, anyway. |
17:04:42 | DiffuseStorm | ok, nice |
17:17:40 | DiffuseStorm | How do I index into data behind a pointer gotten from alloc? |
17:18:57 | Jehan_ | To dereference a ptr p, use p[]. |
17:19:36 | Jehan_ | However, [] can be omitted most of the time and the compiler will infer it's needed. |
17:19:39 | fowl | cast |
17:20:15 | Jehan_ | I would generally recommend using new over manual memory management, though. |
17:20:52 | DiffuseStorm | well i might but I'm first thinking how I'd convert an existing project as directly as possible |
17:22:27 | fowl | (T*)(malloc(sizeof(T))) #=> cast[ptr T](alloc0(sizeof(T))) |
17:24:01 | Jehan_ | Anyhow, talk to you guys later. |
17:24:03 | * | Jehan_ quit (Quit: Leaving) |
17:24:04 | DiffuseStorm | its a game wip and I've implemented the whole job system and worker threads thing so it's a whole lot of void ptrs and such. |
17:24:12 | DiffuseStorm | kk |
17:27:30 | fowl | DiffuseStorm, nimrod has a separate shared heap |
17:27:45 | fowl | system.createshared() etc |
17:28:39 | fowl | gotta go, cya |
17:29:24 | DiffuseStorm | cya |
17:33:28 | * | bjz quit (Read error: Connection reset by peer) |
17:33:34 | * | bjz_ joined #nimrod |
17:34:09 | EXetoC | fowl: there's now a shortcut called 'create' |
17:34:48 | EXetoC | yeah, createShared is also new-ish. there was just allocShared before |
17:46:39 | * | perturbation joined #nimrod |
17:53:55 | * | def- joined #nimrod |
17:54:59 | * | Varriount|Mobile joined #nimrod |
17:55:20 | * | EXetoC quit (Quit: WeeChat 1.0) |
17:58:12 | * | EXetoC joined #nimrod |
17:59:03 | Varriount|Mobile | Araq, dom96: Either I need push access to the csources repo, or what I did in my personal csources repo needs to be repeated in the actual csources repo |
17:59:54 | Varriount|Mobile | GitHub's PR mechanism won't work for branch creation/moving |
18:01:56 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
18:04:03 | flaviu | Varriount: It's impossible for the PRs to work with branches. PRs are just a diff - they are comparing one hash to another, without metadata or anything else |
18:06:15 | Onionhammer | does csources work for bigbreak yet? |
18:12:36 | Onionhammer | someone should add a flag for c2nim to output clibpp format :p |
18:18:13 | * | clone1018_ is now known as clone1018 |
18:33:20 | Varriount | flaviu: That's why I need push access |
18:33:48 | flaviu | ah, my bad |
18:39:23 | Varriount | Onionhammer: clibpp? |
18:58:13 | EXetoC | Varriount: his C++ mocking lib |
19:11:20 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
19:11:57 | * | io2 joined #nimrod |
19:12:20 | * | saml_ joined #nimrod |
19:16:14 | Araq | Varriount: don't remember how this works, but I sent you an "invitation" |
19:21:38 | * | wan joined #nimrod |
19:26:32 | DiffuseStorm | What am I doing wrong here: http://pastebin.com/6xr9DJbz - The compiler seems to crash with "SIGSEGV: Illegal storage access." |
19:28:54 | EXetoC | the compiler is doing something wrong |
19:29:26 | * | TieSoul joined #nimrod |
19:29:42 | TieSoul | hey |
19:29:43 | DiffuseStorm | ok well I'm going to get the development version to at least have an up to date one |
19:30:06 | DiffuseStorm | hi |
19:30:57 | dom96 | hello TieSoul |
19:30:59 | DiffuseStorm | (I mean one from github master/devel) |
19:31:38 | EXetoC | DiffuseStorm: the issue seems to be the name 'New' |
19:32:01 | DiffuseStorm | yep, hmm |
19:32:02 | TieSoul | I'm trying to install Aporia under Windows |
19:32:25 | TieSoul | but it can't find gtk |
19:32:37 | EXetoC | DiffuseStorm: try --cs:partial |
19:33:12 | EXetoC | but yes, it is indeed a good idea to use a development version, though a lot is happening right now so YMMV |
19:34:10 | EXetoC | TieSoul: have you tried to install it using babel? you need the gtk lib for nimrod |
19:34:22 | TieSoul | yeah I have tried |
19:34:50 | EXetoC | well is the outcome different? I get something about gcsafe, which is a recent thing. dom96? |
19:34:58 | dom96 | TieSoul: are you trying to compile it yourself? |
19:35:02 | TieSoul | yes |
19:35:58 | TieSoul | I'm using the instructions from the git |
19:36:00 | dom96 | I experienced some problems with --babelpath, perhaps that is the issue you are experiencing too. |
19:36:42 | dom96 | TieSoul: Try compiling with --path:/path/to/babel/gtk2/pkg/here (should be something like ~/.babel/pkgs/gtk2-1.0/) |
19:37:37 | TieSoul | erm |
19:37:38 | TieSoul | okay |
19:37:51 | dom96 | Araq: Have you (or anyone else that you know of) made any changes to the way --babelpath is handled in the devel branch recently? |
19:38:55 | TieSoul | erm |
19:38:59 | TieSoul | so how do I do that |
19:39:07 | Araq | well it's --nimblepath in the bigbreak |
19:39:15 | TieSoul | I can't find a gtk babel package? |
19:39:18 | Araq | but --babelpath still works there too |
19:39:23 | Araq | hrm |
19:40:32 | EXetoC | TieSoul: gtk2 |
19:40:36 | TieSoul | babel install gtk2 also fails |
19:40:51 | EXetoC | how? |
19:41:00 | TieSoul | it says it can't find it due to EOS |
19:41:23 | EXetoC | ok, vague |
19:41:29 | * | Demos joined #nimrod |
19:42:02 | dom96 | oh, so you couldn't get it to install gtk2. |
19:42:18 | TieSoul | no |
19:42:29 | dom96 | what OS are you on? |
19:42:49 | TieSoul | Windows |
19:42:58 | TieSoul | Windows 8 |
19:44:26 | dom96 | What version of babel are you using? |
19:44:28 | dom96 | latest from git? |
19:44:32 | dom96 | if so, try https://github.com/nimrod-code/babel/releases/download/v0.4/babel-0.4_win32.zip |
19:44:59 | TieSoul | I just downloaded Nimrod from the full installer link on the website |
19:46:16 | dom96 | ok, can you try compiling the latest babel from git then? |
19:46:26 | dom96 | brb |
19:47:04 | filippo_ | hi all, is it me or the actors module is broken? |
19:47:08 | filippo_ | i'm trying to make two actors communicate |
19:47:17 | filippo_ | http://pastebin.com/S4vpP90k |
19:47:20 | filippo_ | And the given example doesn't compile |
19:47:24 | filippo_ | first in my opinion the inbox procedure return a wrong return type |
19:47:28 | filippo_ | an actor has a channel of type TChannel[TTask[TIn, TOut]] |
19:47:32 | filippo_ | and so the inbox procedure should return a ptr TChannel[Task[TIn,TOut]] and not a ptr TChannel[TIn] |
19:49:48 | TieSoul | nope, latest from git still doesn't work |
19:51:27 | Araq | hi filippo_: actors is now deprecated |
19:52:12 | filippo_ | Hi Araq, there's an equivalent? |
19:52:21 | filippo_ | or i just use channels? |
19:52:41 | Araq | yeah well there is 'spawn' but that's not stable |
19:52:49 | Araq | just use channels for now |
19:53:53 | dom96 | TieSoul: can you gist the output please? |
19:54:30 | filippo_ | mh ok, but araq the actors module is deprecated for lack of a manteiner? |
19:54:48 | filippo_ | or because the design/idea is flowed? |
19:55:05 | filippo_ | because i think that it just need some love |
19:55:16 | filippo_ | i mean...it seems just half baked |
19:55:25 | Araq | it has some weird performance issues |
19:55:26 | TieSoul | https://gist.github.com/TieSoul/6d63bf936e5708a1db8a |
19:55:31 | Araq | the API sucks |
19:56:31 | filippo_ | ok so i'll just use thread/join with channels |
19:56:36 | TieSoul | oh |
19:56:41 | TieSoul | I was using cmd.exe |
19:56:49 | TieSoul | using PowerShell fixed it |
19:56:53 | * | perturbation quit (Quit: Leaving) |
19:57:00 | Araq | and I don't like the actors model at all, it's primitive |
19:57:08 | dom96 | TieSoul: really? That's weird. |
19:57:22 | dom96 | TieSoul: Did you perhaps run PowerShell as an admin? |
19:57:25 | TieSoul | hrm |
19:57:33 | Araq | filippo_: once 'spawn' is stable that is a much better concurrency model |
19:57:34 | filippo_ | and in your opinion what's a better model? |
19:57:35 | TieSoul | no, I don't think so |
19:57:58 | TieSoul | maybe it's because git somehow isn't in my PATH when I use cmd.exe? |
19:58:23 | filippo_ | do you mean the spawn proc in the actors module ? or something else? |
19:58:24 | dom96 | TieSoul: yes, that could be it too. |
19:58:34 | * | flaviu quit (Read error: No route to host) |
19:58:45 | * | flaviu joined #nimrod |
19:59:02 | filippo_ | basically i liked the actors model it looked similar to go channels |
19:59:12 | TieSoul | yay, I've got aporia running now |
19:59:16 | TieSoul | thanks for the help |
19:59:18 | filippo_ | (i'm new to nimrod and to its library) |
19:59:43 | Araq | filippo_: 'spawn' is closer to Go's 'go' too |
19:59:48 | filippo_ | so i don't know what's really deprecated and what's not |
20:01:24 | dom96 | TieSoul: I think the latest babel should give you info about what's missing from the PATH. |
20:01:26 | filippo_ | btw i got also some strange behaviour with the 'new' asynchttpclient |
20:01:53 | filippo_ | basically i get some weird exception when i make a get request to https websites |
20:01:57 | TieSoul | dom96: it didn't for me |
20:01:59 | filippo_ | i compile with the d:ssl |
20:02:00 | filippo_ | option |
20:02:10 | dom96 | filippo_: What exception is that? |
20:02:31 | filippo_ | it gives me no message |
20:02:37 | dom96 | filippo_: oh, you need to use the bigbreak branch for ssl support. |
20:02:38 | filippo_ | i can print only the stacktrace |
20:02:48 | * | Rational quit (Quit: leaving) |
20:02:50 | filippo_ | ah ok |
20:03:53 | filippo_ | basically the 'bug' was easy to reproduce |
20:04:03 | filippo_ | i just tested your crawler example |
20:04:04 | filippo_ | with google |
20:04:08 | filippo_ | or github |
20:04:14 | filippo_ | https://github.com |
20:05:25 | dom96 | you should get an assert failure: https://github.com/Araq/Nimrod/blob/devel/lib/pure/httpclient.nim#L586 |
20:06:07 | filippo_ | mh... |
20:06:31 | filippo_ | it didn't seems an assert failure |
20:06:56 | filippo_ | but maybe i didn't got it from the app crash messages |
20:07:04 | * | willwillson joined #nimrod |
20:09:30 | * | Demos quit (Read error: Connection reset by peer) |
20:09:47 | * | filwit joined #nimrod |
20:10:37 | dom96 | filippo_: right, well, bigbreak should have general async fixes too. In any case it's likely fixed there. |
20:10:50 | dom96 | hey filwit, how's things? |
20:11:37 | filippo_ | dom96: ok thank you..is there a meaning for having named the branch "bigbreak"? |
20:13:18 | dom96 | filippo_: yes, it renames 'nimrod' to 'nim', introduces new type names (TFoo -> FooObj, PFoo -> FooRef) and new case sensitivity rules. |
20:13:55 | dom96 | So it breaks existing code. |
20:13:55 | fowl | neat |
20:13:55 | filippo_ | i read about the naming/sensitivity changes in the forum |
20:14:16 | filippo_ | but in the thread i read there wasn't a conclusion |
20:14:32 | filippo_ | ok so i'll checkout it and test it |
20:15:05 | fowl | dom96 do you know about building computers |
20:15:10 | Araq | when I do: git cherry-pick 6e321f799aee6e9e9581 how come git think I want to apply a range of commits? |
20:15:20 | dom96 | fowl: a bit, why? |
20:15:39 | dom96 | fowl: #reddit-buildapc is a good place to go |
20:15:42 | Araq | in what kind of bizzare alternative universe is that a desired behaviour? |
20:15:57 | fowl | dom96 how does one choose between AMD/intel and ati/nvidia |
20:16:14 | Araq | fowl: pick intel + nvidia |
20:16:19 | dom96 | fowl: cpuboss.com/gpuboss.com are good for comparisons. |
20:16:43 | filwit | hey dom96, fine |
20:16:57 | filwit | dom96: you see my NimQt repo? |
20:17:16 | filippo_ | fowl: use nvidia + intel. You have better support in both windows and linux |
20:17:20 | dom96 | fowl: AMD is usually cheap, but as you might imagine worse. |
20:17:40 | fowl | intel seems to be more expensive, nvidia too |
20:17:47 | filippo_ | fowl: and intel has better cpu than amd (even if the letter are cheaper) |
20:18:05 | dom96 | fowl: After using AMD for a long time and now recently buying Intel I would recommend Intel. |
20:18:18 | dom96 | fowl: As for GPU: I still use AMD and it's good IMO. |
20:18:22 | filwit | fowl: I have AMD cpu & gpu... I wish i would have bought intel + nvidia |
20:18:47 | dom96 | fowl: If you want Linux support then I guess nvidia is better, but i've never compared the two, that's just what I hear. |
20:18:57 | willwillson | is your NimQt repo public? |
20:18:58 | dom96 | fowl: But really, the people at #reddit-buildapc know a lot more. |
20:19:16 | dom96 | filwit: Saw the link, haven't looked at the files yet. |
20:19:23 | fowl | thanks |
20:19:55 | fowl | i was really hoping someone would recommend the cheap way out amd+radeon :( |
20:20:48 | filwit | fowl: a lot of times AMD list's their core/clock higher so you think you're getting more for the price, but if you look at CPU comparisons Intel still wins (even at the price points). AMD GPUs are okay... if you're using Windows & DirectX.. they also get dropped faster in my experience (driver support). |
20:20:53 | dom96 | fowl: You can get a pretty cheap and powerful Intel. |
20:20:58 | filippo_ | fowl: if you don't have the money go with the cheaper option. If you use linux however be carefull to check that your amd gpu will work fine.. |
20:22:09 | * | kunev quit (Quit: Lost terminal) |
20:22:22 | dom96 | fowl: pcpartpicker.com is really good too |
20:22:57 | dom96 | fowl: you can ask people in #reddit-buildapc to pick out parts for a computer within your budget and they will likely do that for you. |
20:23:02 | filwit | fowl: that said, I've had a better time with KDE & Catalyst than most people give it credit for. And if you use OSS drivers, go with a pure Intel system or use AMD (i'm sure you know that already tho). |
20:23:15 | dom96 | fowl: Might be a good idea to pick something out yourself first and get them to give you suggestions. |
20:23:19 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
20:24:51 | filwit | http://www.cpubenchmark.net/ is also a useful site for comparing AMD & Intel |
20:26:05 | dom96 | This is quite nice: http://cpuboss.com/cpus/Desktop-CPUs-best-Performance-Per-Dollar-4300513 |
20:27:06 | filippo_ | bye all, thanks for the tips dom96 and Araq |
20:27:26 | dom96 | filippo_: no problem. Do come again! |
20:27:36 | filippo_ | sure ;) |
20:27:49 | * | filippo_ quit (Quit: Konversation terminated!) |
20:28:40 | DiffuseStorm | To test this language out I'm implementing a dynamic array with manual memory management. So I allocate size * ElementType, get back a 'pointer'. Do I cast that into ptr ElementType? |
20:28:52 | DiffuseStorm | * sizeof(ElementType) I mean |
20:29:20 | dom96 | DiffuseStorm: yes |
20:29:59 | DiffuseStorm | dom96: but then it's just a pointer to T, how do I index into the array with a pointer to T? |
20:30:10 | DiffuseStorm | T begin elementType |
20:30:13 | DiffuseStorm | being* |
20:30:41 | dom96 | you can cast it into an array[size, ElementType] then. |
20:31:50 | DiffuseStorm | dom96: hmm, then what should the type hold? Perhaps just a pointer and I cast it everytime I need to use it? |
20:32:58 | dom96 | i'm not sure what you mean |
20:33:04 | dom96 | what type? |
20:33:17 | DiffuseStorm | dom96: I mean the object (dynamic array) needs to hold the pointer. What is the type of that pointer |
20:33:29 | DiffuseStorm | it can't be array[size, because size changes |
20:34:17 | dom96 | you can store it as either pointer or ptr ElementType I guess |
20:35:18 | DiffuseStorm | ok pointer it is, and then a cast inside every function, that's fine |
20:36:37 | Araq | do not cast to 'array', cast to 'ptr array' |
20:37:07 | DiffuseStorm | ptr array[size, T]? |
20:37:20 | Araq | yeah |
20:37:32 | DiffuseStorm | okay, is the cast accessing size at runtime to fix the bounds checking? |
20:38:14 | Araq | er ... what? |
20:38:23 | DiffuseStorm | in the cast I'm specifying size, why? |
20:39:13 | Araq | because there is this novel thingie called "memory safety" which means array accesses are checked |
20:39:28 | DiffuseStorm | thus my question |
20:39:44 | EXetoC | yeah but how dynamic is it then? |
20:39:46 | DiffuseStorm | and size is changing at runtime |
20:39:55 | DiffuseStorm | and then im casting using that size |
20:41:02 | Araq | size needs to be known at compile-time |
20:41:21 | DiffuseStorm | I'm creating a dynamic array. I have a ptr from alloca. I need to index into it |
20:41:35 | DiffuseStorm | the size for alloca is decided at runtime |
20:41:39 | DiffuseStorm | how do I index into it then? |
20:41:55 | DiffuseStorm | And dynamic array has elements of type T |
20:42:20 | Araq | use 0..100_000_000 as the index type |
20:42:36 | EXetoC | you can also use create(T, nInstances) |
20:42:42 | Araq | this makes the compile shut up and the runtime check if active becomes rather meaningless |
20:42:46 | Araq | *compiler |
20:43:13 | Araq | it's a known idiom, but there is also the .unchecked pragma for array declarations |
20:43:43 | DiffuseStorm | ok cool, both of those will work. |
20:43:46 | Araq | but ugh i feel like a broken record. can you write it down in a mini-tutorial? |
20:44:17 | DiffuseStorm | Who write what? |
20:45:02 | * | Salvakiya joined #nimrod |
20:45:06 | Salvakiya | hello all |
20:45:09 | Salvakiya | how goes it? |
20:45:10 | * | io2 joined #nimrod |
20:45:13 | EXetoC | Araq: so we're keeping the long and verbose 'result'? :-P |
20:45:24 | EXetoC | and will "assert not x" ever work? |
20:45:34 | dom96 | hey Salvakiya |
20:46:07 | dom96 | Araq: Can unchecked arrays not be used? |
20:46:27 | imjoe | has anyone written a dns module for nim? and what is the best way to get the first IP for a hostname? i.e. something like Resolv.getaddress("www.google.com") -> 74.125.224.81 |
20:46:30 | EXetoC | he did mention the unchecked pragma |
20:46:35 | EXetoC | is that different? |
20:46:57 | dom96 | oh, I missed that. |
20:47:01 | Salvakiya | so I just now heard of Nimrod... I have dabbled in Java, C#, spent multiple hours in python and loved it, and am very fluent in GML. how does Nimrod fare for game programming? by that I mean how is the community behind it? |
20:47:37 | Salvakiya | community behind game programming with nimrod* |
20:47:41 | dom96 | Araq: Perhaps we could make array[T] mean unchecked? |
20:47:51 | EXetoC | Salvakiya: there are no full-fledged engines or anything |
20:48:23 | EXetoC | some people have been working on engines, but nothing has been announced so I don't know how that's going |
20:48:42 | EXetoC | we do have an OpenGL wrapper and a couple of other things |
20:48:49 | Salvakiya | EXetoC, I would write my own engine to be honest... However I dont know the first thing about OGL programming so I would need some sort of a graphics library to utilize it |
20:48:52 | DiffuseStorm | Salvakiya: look at the libraries here http://nimrod-lang.org/lib.html |
20:48:53 | fowl | tons of game-related libraries on github |
20:48:54 | Salvakiya | oh nice |
20:48:55 | Araq | dom96: we could but it's a bad idea |
20:49:06 | dom96 | Araq: why? |
20:49:12 | fowl | audio, video, physics, etc |
20:49:29 | DiffuseStorm | fowl: physics for nim, where? |
20:49:34 | EXetoC | you can find * in fowl's monolothic lib :-P |
20:49:49 | DiffuseStorm | btw is it Nim now? |
20:49:53 | Araq | DiffuseStorm: *you* write a minitut about how to re-implement 'seq' |
20:49:56 | EXetoC | DiffuseStorm: soon |
20:50:02 | dom96 | Salvakiya: You can use sdl or sfml for creating games. I've made on using sfml once for ludum dare. |
20:50:05 | fowl | wrappers for ODE, bullet, chipmunk |
20:50:23 | Salvakiya | dom96 which do you prefer? |
20:50:54 | DiffuseStorm | Araq: this is my first/second day using nimrod and I suck at writing. I'm all for helping later though :D |
20:51:17 | Salvakiya | and is there an ide yet? |
20:51:18 | dom96 | Salvakiya: sfml because sdl has kind of stalled in development, although my preference is outdated because sdl 2 was released recently. |
20:51:37 | dom96 | sfml has more features though IIRC |
20:51:48 | dom96 | Salvakiya: yes, Aporia. |
20:52:10 | EXetoC | how much was there to be worked on anyway? |
20:52:41 | DiffuseStorm | fowl: can you point me to the bullet wrapper? |
20:53:27 | fowl | https://github.com/fowlmouth/nimlibs/blob/master/fowltek/bullet.nim |
20:53:49 | fowl | bbiab |
20:54:24 | Salvakiya | so what is better about nimrod over cython? |
20:54:34 | DiffuseStorm | awesome, it looks easy enough to create these wrappers, that's good |
20:58:08 | DiffuseStorm | Araq: I don't think I'll ever be able to write anything without endless errors, but I look forward to being able to help with something else |
21:00:39 | EXetoC | it shouldn't be that bad after a couple of weeks. just develop incrementally |
21:03:01 | Araq | Salvakiya: cython |
21:03:10 | Araq | 's type system is bolted on |
21:03:37 | * | saml_ quit (Ping timeout: 245 seconds) |
21:04:41 | EXetoC | let's see if the real ETA will be the one on github :-) |
21:04:42 | Araq | and it doesn't support meta programming afaict |
21:05:43 | Araq | DiffuseStorm: yes it is Nim now. |
21:15:26 | Onionhammer | fowl u here? |
21:16:34 | Onionhammer | https://gist.github.com/onionhammer/4e370688218f8c3c996f |
21:23:50 | Araq | I swear I'll make ': void' a compile-time error |
21:24:00 | DiffuseStorm | please |
21:24:07 | DiffuseStorm | i mean i agree |
21:24:26 | Araq | does any example use that? how come everybody coming from c++ uses it? |
21:24:46 | DiffuseStorm | hmm don't know, I'm from c++ and don't use it. |
21:25:15 | Onionhammer | araq i usually dont :p |
21:25:27 | Onionhammer | you should make it a warning |
21:26:23 | Onionhammer | araq is it possible to {.push.} an arbitrary value and check if it's been {.pushed.}? |
21:27:20 | Araq | Onionhammer: when compileOption("foo") ? |
21:27:56 | Onionhammer | Araq so "foo" in this case is the pragma? |
21:28:04 | Araq | yeah |
21:28:04 | EXetoC | what's void actually for again? it would be nice if it could be used as a type parameter default |
21:28:43 | Araq | EXetoC: Table[string, void] == Set[string] |
21:28:45 | Onionhammer | Araq so what about pushing an arbitrary value? |
21:28:58 | Onionhammer | e.g. {.push myCustomPragma: "value".} |
21:29:06 | EXetoC | I might've forgotten about some use case |
21:29:33 | Araq | EXetoC: TThread[void] also requires it |
21:30:21 | Araq | Onionhammer: custom pragmas cannot get values but pushing those might work |
21:30:45 | Onionhammer | huh? |
21:30:51 | Onionhammer | "pushing those"? |
21:31:01 | Araq | pushing a custom pragma |
21:31:07 | DiffuseStorm | Araq: the manual has a section on "Void type" showing use of it in function return type |
21:31:30 | Onionhammer | creating one with the {.pragma.} pragma? |
21:31:47 | Araq | DiffuseStorm: I know, but it only shows it exists for consistency. not that it should be used. |
21:32:03 | Araq | Onionhammer: yes. |
21:32:31 | Onionhammer | Araq is there any example on how to do that other than the 3 liner in the manual? |
21:32:54 | Araq | Onionhammer: system/incrtl.nim |
21:33:14 | Araq | *inclrtl.nim |
21:34:14 | EXetoC | Araq: I do recall wanting to instantiating it for some reason; maybe for a type class parameter. x: something|void |
21:34:17 | EXetoC | nothing else would work |
21:34:43 | EXetoC | I could've just defined a new type in the meantime I guess (one that isn't special) |
21:34:53 | Araq | EXetoC: I'm only talking about the *syntax* proc foo(): void |
21:35:15 | Araq | 'void' as a concept is quite powerful |
21:35:20 | EXetoC | yeah but then I remembered that |
21:35:21 | Onionhammer | Araq so.. the idea being that you would push the value? |
21:35:32 | EXetoC | recalled, rather |
21:35:53 | Araq | Onionhammer: just try out what you're after |
21:36:12 | EXetoC | x: something|void = void(???) |
21:36:52 | EXetoC | should we have a regular type for that purpose? |
21:37:38 | Onionhammer | Araq "recursive dependency |
21:42:28 | * | untitaker quit (Ping timeout: 272 seconds) |
21:43:29 | Araq | dom96: I'm reverting FD_SET backto TFD_SET so it's not ambiguous with --cs:none |
21:43:53 | Araq | nimfix really has a hard time when it cannot work with --cs:none |
21:44:28 | dom96 | how about you rename the proc to setFd instead? |
21:44:46 | dom96 | or does that not fix the problem? |
21:44:49 | Araq | AsyncSocket vs asyncSocket is also affected |
21:45:09 | Araq | hrm setFd ? |
21:45:21 | dom96 | That will be deprecated anyway so it doesn't matter. |
21:45:30 | Araq | we might as well find a real name for it then |
21:45:52 | Araq | maybe a name with more than a single vowel? |
21:47:05 | Araq | it should be 'incl' according to our naming conventions, right? |
21:47:17 | * | untitaker joined #nimrod |
21:49:48 | * | hexagon_sun joined #nimrod |
21:50:03 | dom96 | hi hexagon_sun |
21:50:09 | hexagon_sun | hello |
21:50:34 | dom96 | Araq: i'd rather keep it close to the OS API name. |
21:51:29 | Araq | dom96: well it used to be TFD_SET |
21:51:39 | Araq | so I'm renaming it back to that |
21:51:52 | Araq | posix.nim keeps most of the T stuff anyway |
21:52:04 | * | Demos joined #nimrod |
21:52:54 | * | Jehan_ joined #nimrod |
21:56:04 | Araq | EXetoC: btw bigbreak has the comment handling changes now |
21:58:03 | DiffuseStorm | Compiler bug? (I hate to ask that haha) http://pastebin.com/YeqFrFkk |
21:58:24 | EXetoC | great |
21:59:25 | EXetoC | DiffuseStorm: temp ban if > 10 compiler bug questions in a day |
21:59:42 | EXetoC | you're indeed not passing in a ptr int |
21:59:58 | EXetoC | wait |
22:00:06 | DiffuseStorm | oh i bet you I am |
22:00:14 | DiffuseStorm | bug hunter or an idiot, you decide |
22:00:18 | EXetoC | nm |
22:00:22 | Araq | DiffuseStorm: (addr num)[3.4] |
22:00:22 | DiffuseStorm | I'm not? |
22:00:48 | DiffuseStorm | The manual seems to use the syntax that I am using |
22:01:06 | EXetoC | it's a precedence thing I guess |
22:02:22 | Araq | addr a[i] means to take the address of a[i] |
22:02:32 | Araq | and addr(a)[i] means the same |
22:06:23 | DiffuseStorm | Araq: I don't understand. Say if addr is a function and so is [], then wouldn't addr be called first with the way I used it? |
22:06:46 | Araq | DiffuseStorm: but it's an operator |
22:06:56 | DiffuseStorm | Araq: Can you give an example of where this precedence rule helps |
22:07:12 | Araq | DiffuseStorm: I already did? |
22:09:29 | DiffuseStorm | ok ok |
22:10:08 | EXetoC | addr would indeed be evaluated last |
22:11:36 | * | TieSoul quit (Read error: Connection reset by peer) |
22:11:54 | * | TieSoul joined #nimrod |
22:15:42 | flaviu | > addr(a)[i] means the same |
22:15:42 | flaviu | don't function calls have precedence over indexing? |
22:16:02 | flaviu | I'd expect that to be (addr(a))[i] |
22:16:10 | Araq | flaviu: but it is not a function call |
22:16:22 | * | Demos quit (Read error: Connection reset by peer) |
22:17:01 | Jehan_ | flaviu: It works the same way as &(a)[i] in C/C++. |
22:18:23 | flaviu | I guess it's logical, but I still don't really like it. What looks like a function call should be a function call |
22:18:33 | Araq | however since we break lots of code anyway, we could tweak it a bit |
22:18:52 | flaviu | dekeywordize addr? |
22:19:00 | flaviu | and just have a magic function? |
22:19:01 | Araq | exactly |
22:19:16 | EXetoC | aight |
22:21:06 | Jehan_ | I'm not sure if it's a practical problem. |
22:21:29 | Jehan_ | Normally you don't index the result of addr. |
22:21:39 | DiffuseStorm | "addr a[i]" looks closer to addr(a[i]) than addr(a)[i] to me. |
22:21:55 | DiffuseStorm | so i dont think tehy have to have the same behavior |
22:21:59 | Jehan_ | If you do, you have a superfluous dereference in there. |
22:22:16 | DiffuseStorm | but man am i not qualified to say that though, so ignore me |
22:22:19 | Jehan_ | (addr(a))[] == a |
22:22:41 | Jehan_ | (addr(a))[x] == a[x] |
22:23:07 | Araq | Jehan_: yeah but DiffuseStorm overloads [] |
22:23:09 | flaviu | DiffuseStorm: Don't worry about it, I'm equally unqualified and I say stuff like that all the time :P |
22:23:10 | Jehan_ | This seems to be a problem that only occurs for people who are exploring the boundaries of the compiler. |
22:23:22 | Jehan_ | Araq: Yeah, I saw that. |
22:23:36 | Jehan_ | I just don't see the practical value in doing that. |
22:24:04 | flaviu | Araq: While you're agreeing with me, I still want constructors :P |
22:24:04 | flaviu | I have a probably slightly buggy patch here: https://gist.github.com/flaviut/aa0dda27a97eb89e03e0 |
22:24:23 | Jehan_ | Mind you, I think it'd probably be cleaner to switch precedences around, but I'm not sure if it's worth breaking backwards compatibility. |
22:25:14 | Araq | Jehan_: it wouldn't break any real world code, I think |
22:25:45 | Jehan_ | Araq: What do you propose? To make it a function? |
22:26:34 | Araq | Jehan_: we can simply treat it as a function syntactically yes |
22:26:53 | Araq | but we can keep addr as a keyword |
22:27:01 | Jehan_ | Araq: Not sure if that won't break real-world code. |
22:27:27 | Araq | Jehan_: foo x is a function invokation already |
22:27:32 | Araq | since 0.9.4 I think |
22:27:57 | Araq | (is it invocation? I never know) |
22:28:12 | Jehan_ | Araq: I know, but what about (addr a, b)? |
22:28:48 | Araq | (foo a, b) is already (foo(a), b) |
22:28:58 | Araq | iirc |
22:29:21 | Jehan_ | Hmm, I see. |
22:30:38 | Jehan_ | I just remember from writing parsers that allow function calls without parentheses that there are usually a lot of ambiguities. |
22:31:09 | * | flaviu quit (Ping timeout: 260 seconds) |
22:31:34 | DiffuseStorm | Jehan_ well it's only one parameter that's allowed so, correct? |
22:31:47 | * | BlaXpirit quit (Ping timeout: 276 seconds) |
22:32:13 | Araq | yeah but 'spawn foo(a, b)' and 'await foo(a, b)' are simply too nice, so I thought (and still think) it's worth the complexity |
22:32:41 | Jehan_ | Araq: Oh, I concur. |
22:32:51 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
22:33:40 | Jehan_ | I'm just wondering if parsing `addr` like that may lead to a different parse of existing code. |
22:34:02 | Jehan_ | Which would likely result in a compilation error, but would still be annoying. |
22:34:16 | Jehan_ | To be honest, I don't know. I'd have to look at the grammar. |
22:35:58 | Jehan_ | Anyhow, time for bed. Good night. :) |
22:36:00 | * | Jehan_ quit (Quit: Leaving) |
22:36:05 | Araq | good night |
22:37:34 | Onionhammer | fowl updated clibpp |
22:41:22 | Araq | ping Varriount |
22:43:45 | DiffuseStorm | Is it possible to implement an array in such a way that this is possible: "customArray[4] = 2" - Where 2 is assigned not to a local but the actual location in the array? |
22:47:48 | * | gsingh93 joined #nimrod |
22:47:49 | Araq | overload `[]=` |
22:48:11 | DiffuseStorm | I thought it could only accept 2 parameters |
22:48:37 | Araq | no, a[i, j, k] is also easily possible |
22:50:09 | DiffuseStorm | ok that was easy enough, thanks. I thought I had tried that already. |
22:55:13 | EXetoC | 'local'? |
22:55:41 | DiffuseStorm | i mean if [] would have returned a value, that = 2 would not assign to that |
22:56:10 | DiffuseStorm | told you i was bad at writing |
22:58:44 | fowl | `[]=` is the operator for that expression |
22:59:27 | fowl | the signature would look like proc `[]=` [t] (arr: var myarray[t], idx:int, val:t) |
23:00:01 | DiffuseStorm | yep I've got it, Araq helped me a few irc lines ago |
23:02:45 | fowl | i now have a c++ ide on my phone that can compile sdl2 apps, i wonder how hard it would be to get nimrod running on my phone |
23:03:29 | DiffuseStorm | fowl: nice, what OS does the phone use? |
23:04:07 | fowl | android 4.4 |
23:11:12 | DiffuseStorm | fowl: and you are very productive on your phone, programming, yes? |
23:11:21 | DiffuseStorm | haha |
23:11:38 | EXetoC | I'm sure he is |
23:12:10 | EXetoC | it might not be so bad for simple things with voice typing |
23:15:16 | * | xenagi joined #nimrod |
23:15:44 | * | Trustable quit (Quit: Leaving) |
23:22:56 | * | Salvakiya left #nimrod ("Leaving") |
23:23:25 | * | darkf joined #nimrod |