00:02:26 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
00:21:41 | * | def- quit (Ping timeout: 240 seconds) |
00:22:43 | * | def- joined #nimrod |
00:34:50 | * | saml_ quit (Quit: Leaving) |
00:58:07 | * | noam quit (Ping timeout: 245 seconds) |
01:01:43 | * | Matthias247 quit (Read error: Connection reset by peer) |
01:16:21 | * | johnsoft quit (Ping timeout: 256 seconds) |
01:16:35 | * | johnsoft joined #nimrod |
01:30:35 | * | q66 quit (Quit: Leaving) |
01:45:12 | * | Jessin quit (Ping timeout: 260 seconds) |
01:51:00 | * | Jesin joined #nimrod |
01:59:27 | * | Jesin quit (Ping timeout: 245 seconds) |
02:02:23 | * | Jesin joined #nimrod |
02:13:47 | * | Jesin quit (Ping timeout: 264 seconds) |
02:23:11 | * | goobles joined #nimrod |
02:25:51 | * | fowl joined #nimrod |
02:26:59 | * | springbok joined #nimrod |
02:32:02 | * | Jesin joined #nimrod |
02:32:37 | * | Jesin quit (Read error: Connection reset by peer) |
02:39:48 | * | johnsoft quit (Ping timeout: 260 seconds) |
02:40:52 | * | johnsoft joined #nimrod |
02:45:54 | * | kshlm joined #nimrod |
02:48:25 | * | brson quit (Quit: leaving) |
03:32:41 | * | adoniscik joined #nimrod |
03:39:23 | * | kshlm quit (Quit: Konversation terminated!) |
03:55:23 | adoniscik | is it possible to set the return type depending on the argument types? for example, if your arguments or int|float, to set it to int if all inputs are int and float otherwise? |
03:59:53 | Skrylar | proc foo[T](a, b: T): T |
04:00:18 | Skrylar | Use generics |
04:00:21 | adoniscik | what's T explicitly? |
04:00:28 | Skrylar | T is nothing, its a generic |
04:00:36 | adoniscik | so how does that solve my problem? |
04:00:57 | Skrylar | if a and b are int, the compiler will infer that T is int |
04:01:02 | Skrylar | thus int -> int -> int |
04:01:09 | adoniscik | great, what if at least one of them is not? |
04:01:17 | Skrylar | Then it will moan because they are not the same |
04:01:28 | adoniscik | I want it to work, nto moan :) |
04:01:36 | Skrylar | IIRC its generally considered poor practice to freely intermix float and int anyway |
04:02:02 | adoniscik | but it's not free, I want to treat the all int case separately |
04:02:36 | adoniscik | if they're mixed, I will promote the ints to floats |
04:02:55 | Skrylar | i don't recall if generics have specializations like in C++ |
04:03:14 | Skrylar | I know we have term rewriting macros that do something like that, but its for something else |
04:06:04 | Skrylar | looks like it *should* be doable with templates |
04:06:06 | adoniscik | inside the proc I can do when type(foo) etc. but not in the proc signature |
04:06:45 | Skrylar | adoniscik: for that you would do proc foo[T: int|float](...), which allows either |
04:07:02 | Skrylar | which would allow either all floats or all ints |
04:07:04 | adoniscik | how about the return type? you can't do int|float there |
04:07:19 | Skrylar | also make it T |
04:07:23 | Skrylar | (or 'auto') |
04:07:35 | adoniscik | but that's not what's desired; I don't want to just have all floats or all ints but all ints vs. everything else |
04:07:37 | adoniscik | there's a difference |
04:08:03 | adoniscik | all ints -> return int else return float |
04:08:04 | Skrylar | well 'auto' will infer from whatever type you *actually* return |
04:08:13 | adoniscik | great let me try that |
04:08:23 | adoniscik | since I can use when inside the proc |
04:08:34 | Skrylar | otherwise you probably need a macro or an override |
04:08:38 | Skrylar | macro/template |
04:09:00 | Skrylar | you can also have multiple generic types |
04:09:10 | Skrylar | blah[J,K,L] |
04:09:39 | adoniscik | yes, but there's this: https://github.com/Araq/Nimrod/issues/1385 |
04:11:12 | * | boydgreenfield joined #nimrod |
04:12:10 | Skrylar | what function are you specifically trying to implement? |
04:13:04 | adoniscik | basic linear algebra |
04:15:08 | Skrylar | IIRC nimrod will eat division and always return a float, unless you do specific div/mod integer calculations with it; so i would probably still just do an all-int and all-float implementation as two procs |
04:15:31 | adoniscik | thanks, I'll consider that |
04:15:40 | Skrylar | its not ideal for the mixed case, but mixing int/float implicitly has caused a lot of subtle programming bugs |
04:16:07 | Skrylar | the worst you'd have to do is 0.float or 0.0 |
04:26:12 | * | mwbrown quit (Ping timeout: 260 seconds) |
04:27:15 | * | kshlm joined #nimrod |
04:27:55 | * | superfunc joined #nimrod |
04:39:51 | * | Demos quit (Read error: Connection reset by peer) |
04:40:18 | goobles | nimrod iterators r weird or what |
04:40:33 | Skrylar | goobles: eh, compared to C# maybe |
04:40:41 | Skrylar | they're pretty efficient in nimrod |
04:41:23 | goobles | i am used to the C++ style, they do seem weird to me when I look at them |
04:42:45 | goobles | is there a way to like chain/cmpose them |
04:42:48 | Skrylar | i like 'for e in y' more than blah != blah.end_iterator() and such |
04:43:07 | Skrylar | Not really; an iterator in nimrod is basically just a while loop |
04:43:11 | goobles | thats old C++ |
04:43:13 | Skrylar | they aren't objects |
04:49:59 | * | superfunc quit (Ping timeout: 256 seconds) |
05:13:37 | * | boydgreenfield quit (Quit: boydgreenfield) |
05:22:47 | * | flaviu quit (Ping timeout: 264 seconds) |
05:24:49 | * | boydgreenfield joined #nimrod |
05:47:23 | * | bjz joined #nimrod |
05:56:51 | * | adoniscik quit (Ping timeout: 256 seconds) |
06:03:36 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:03:55 | * | bjz joined #nimrod |
06:08:12 | * | bjz quit (Ping timeout: 240 seconds) |
07:02:15 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:08:50 | * | boydgreenfield quit (Quit: boydgreenfield) |
07:20:54 | * | kunev joined #nimrod |
07:32:06 | * | adoniscik joined #nimrod |
07:45:49 | * | kunev quit (Quit: Lost terminal) |
07:51:46 | * | kunev joined #nimrod |
08:01:18 | * | adoniscik quit (Quit: Leaving) |
08:03:43 | * | io2 joined #nimrod |
08:06:12 | * | Trustable joined #nimrod |
08:29:50 | * | ARCADIVS joined #nimrod |
08:46:13 | * | adoniscik joined #nimrod |
08:52:23 | adoniscik | How does the auto type work for proc outputs, because I get a "cannot instantiate" error? |
08:53:25 | def- | adoniscik: sometimes the type can't be inferred, then you have to write it by hand |
08:53:39 | def- | but i don't remember seeint that error |
08:54:24 | adoniscik | that's a bummer, because I was hoping to use it to be able to set the type depending on the arguments. |
08:54:44 | def- | you can still use generics and do that by hand |
08:54:58 | adoniscik | please take a look: http://pastebin.com/akvjj6pF |
08:56:07 | def- | adoniscik: compiles for me with the devel branch |
08:56:19 | adoniscik | oh interesting |
08:56:26 | adoniscik | that's encouraging. |
08:57:32 | adoniscik | can you think of a cleaner way ? |
08:59:17 | def- | for the return type? |
08:59:40 | adoniscik | yes, primarily |
09:00:09 | def- | Oh wait |
09:00:16 | def- | It just compiles because I don't have code using it I think |
09:00:42 | adoniscik | try echo (2*[1,2,3]).repr |
09:00:58 | def- | Ok, getting your error now! |
09:01:21 | adoniscik | join the club :) |
09:04:27 | def- | This may be difficult since you only find the return type out in the proc body |
09:04:46 | adoniscik | no, you don't, you know as soon as you have the args |
09:04:57 | def- | and I guess it's not your goal to have a proc for each combination |
09:05:11 | adoniscik | I just couldn't figure out how to express it in proc signature |
09:05:40 | def- | adoniscik: neither can I |
09:06:09 | adoniscik | I'm closing to just giving ints the finger :) |
09:06:25 | adoniscik | maybe I'll add 'em back when I better know the language |
09:09:37 | def- | also, there are many more number types than just int and float. Maybe it's easier/cleaner to use just 1 type for everything in your `*` proc |
09:13:15 | adoniscik | I need to come up with a numeric type policy. When the code is more mature, I'll post it for review |
09:16:26 | * | shevy left #nimrod ("I'll be back ... maybe") |
09:17:09 | adoniscik | apparently .5 is not a valid floating number? |
09:19:36 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
09:23:46 | def- | adoniscik: indeed |
09:36:44 | * | BitPuffin joined #nimrod |
09:48:03 | * | BitPuffin quit (Ping timeout: 240 seconds) |
09:49:57 | * | BitPuffin joined #nimrod |
10:11:42 | def- | Oh wow. Using clang instead of gcc I get 50% smaller binaries, 4 times faster compilation and slightly faster execution |
10:11:59 | def- | (for some bigints test programs) |
10:31:58 | * | ARCADIVS quit (Quit: WeeChat 0.4.3) |
10:40:21 | * | adoniscik quit (Ping timeout: 250 seconds) |
10:56:03 | * | kshlm quit (Ping timeout: 256 seconds) |
11:19:52 | * | kshlm joined #nimrod |
11:21:30 | * | kshlm quit (Client Quit) |
12:13:54 | * | mwbrown joined #nimrod |
12:18:14 | * | darkf quit (Quit: Leaving) |
12:20:59 | * | Varriount_ joined #nimrod |
12:24:12 | * | Varriount quit (Ping timeout: 240 seconds) |
12:30:07 | * | darkfusion quit (Ping timeout: 256 seconds) |
12:31:18 | * | darkfusion joined #nimrod |
12:33:53 | * | untitaker quit (Ping timeout: 250 seconds) |
12:39:38 | * | untitaker joined #nimrod |
12:43:25 | * | mwbrown quit (Ping timeout: 250 seconds) |
12:51:51 | * | Jesin joined #nimrod |
13:03:29 | * | BitPuffin quit (Quit: See you on the dark side of the moon!) |
13:06:58 | * | BitPuffin joined #nimrod |
13:43:14 | * | saml joined #nimrod |
14:01:30 | * | askatasuna joined #nimrod |
14:21:49 | * | flaviu joined #nimrod |
14:29:01 | * | Machielo joined #nimrod |
14:32:01 | * | Machielo quit (Client Quit) |
14:36:41 | * | x2f0 joined #nimrod |
14:37:36 | x2f0 | Hey everybody, thought I'd drop by and say "hi". New to nimrod, loving the language thus far |
14:39:50 | * | goobles quit (Quit: Page closed) |
14:40:55 | * | goobles joined #nimrod |
14:51:28 | saml | x2f0, how are you learning the langu? |
14:52:56 | goobles | banging head on keyboard |
14:53:23 | saml | can i make web scale web site using nimrod |
14:53:55 | x2f0 | going the euler road |
14:54:49 | saml | that's great |
14:55:24 | x2f0 | the C interface is fantastic, I needed some kind of bignums library (not sure if it exists already) for some of the problems on euler. Wrapping gmp was really easy |
14:55:57 | def- | x2f0: https://github.com/def-/bigints |
14:56:28 | def- | x2f0: i would be interested to know if the examples work with this too |
14:56:54 | x2f0 | ah great, thanks for that. Didn't know that existed. Will test it out today evening |
14:57:38 | def- | x2f0: it's not in any list yet, because I need a lot of tests |
15:00:03 | x2f0 | bookmarked for later |
15:00:43 | goobles | so in nimrod shit is GC if u new it, otherwise it is stack allocated? |
15:01:15 | x2f0 | Probably a bearded question (so apologies in advance), but are there any efforts to wrap something like wxwidgets? |
15:02:17 | flyx | x2f0: there's a GTK binding |
15:02:44 | def- | goobles: or you can alloc it on heap without GC |
15:03:22 | flyx | I don't think wxwidgets would be nice to use in nimrod, since it uses its own types for everything |
15:03:33 | flyx | (like most bloaty C++ libs) |
15:03:56 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
15:04:52 | x2f0 | flyx: not a big fan of gtk tbh, but I see your point |
15:05:22 | flyx | x2f0: neither am I. I didn't yet find a GUI lib that's good enough for me to be a fan of |
15:06:32 | x2f0 | flyx: everything considered, qt's not too bad. Not a true fan of that one either though... |
15:09:01 | * | kunev_ joined #nimrod |
15:09:38 | flyx | x2f0: qt has its merits. I didn't use it much and I didn't really like or dislike it |
15:10:15 | flyx | WPF is surprisingly pretty good, if you're developing Windows-only |
15:10:37 | * | kunev quit (Ping timeout: 245 seconds) |
15:33:13 | * | flaviu quit (Remote host closed the connection) |
15:33:40 | * | flaviu joined #nimrod |
15:43:07 | x2f0 | flyx: never worked with wpf (not a win dev as such), but I can imagine that it is pretty decent actually. The crossplatform stuff is always a chore, to be expected I guess |
15:50:14 | flyx | x2f0: depends. GTK is cross-plattform throughout, which gives a more consistent look. Qt tries to emulate the platform's native look which looks weird sometimes. wx uses the native toolkit as backend which makes it very bloat. but WPF *could* be ported to other platforms if someone has the time to do it; it isn't using the native Windows APIs. |
15:56:33 | x2f0 | flyx: in regards to osx, has GTK support improved at all? Had to rely on gtk some time ago (not sure exactly when, but not too far into the past) in one of my lisp tools. Bindings were fairly stable, etc. However, getting all of this up, packaging, etc. was a massive hassle. Ended up using qt in the end |
15:57:21 | flyx | x2f0: well you need to know your way around autotools. once you have built the quartz stack once, it's not too hard to bind and bundle |
15:59:06 | flyx | x2f0: or you can use the X11-based GTK, which is more stable and has packages provided through macports and find |
15:59:08 | flyx | *fink |
16:00:35 | x2f0 | flyx: I did get it to run in the end, but it just felt somewhat wrong haha... But then again, I was prepared for all kinds of things to happen. |
16:01:32 | * | johnsoft quit (Ping timeout: 245 seconds) |
16:02:00 | * | johnsoft joined #nimrod |
16:02:15 | x2f0 | flyx: in terms of distribution, isn't x11 gone (on newer macs). Sorry not to knowledgable in this area. Would need to rely on quartz in the end no? |
16:03:21 | flyx | x2f0: you can still download and install XQuartz. of course, it's very ugly |
16:03:47 | flyx | gtk-quartz is of course more natural |
16:04:21 | flyx | an since Mono/Xamarin is using it extensively, it got fairly usable |
16:04:28 | x2f0 | flyx: noted down. While I'm playing around with nimrod might as well give it another try |
16:05:02 | x2f0 | flyx: what I'd really love to see is something like openframeworks for nimrod |
16:05:19 | flyx | x2f0: never heard of that one |
16:06:06 | x2f0 | flyx: C++ toolkit for generative art and such |
16:06:14 | flyx | ah |
16:06:30 | flyx | well you can write a nimrod binding for it |
16:06:36 | x2f0 | flyx: I do this semi-professionally, would be great to use something besides C++ |
16:07:11 | flyx | but I don't know exactly how much C++ features can be tranparently wrapped with nimrod. never did C++ wrapping |
16:07:54 | flyx | I'm afk, showering. it's pretty hot here. later. |
16:07:55 | x2f0 | flyx: honestly, I might just do that. Granted, my skills aren't all that, but I've got time |
16:08:07 | x2f0 | np |
16:08:14 | x2f0 | cheers |
16:09:03 | def- | x2f0: nice, good luck! |
16:11:02 | x2f0 | def-: thanks. Def need to explore c2nim a slight bit more though haha |
16:11:54 | def- | x2f0: I don't understand it much myself. I just comment out until it works and write the rest by hand |
16:12:19 | x2f0 | def-: that would be pretty much my approach I guess |
16:25:02 | * | Boscop quit (Read error: Connection reset by peer) |
16:25:52 | * | Boscop joined #nimrod |
16:27:37 | * | boydgreenfield joined #nimrod |
16:36:03 | * | darkfusion quit (Ping timeout: 240 seconds) |
16:36:56 | * | adoniscik joined #nimrod |
16:44:07 | * | darkfusion joined #nimrod |
16:45:24 | * | kunev_ quit (Ping timeout: 260 seconds) |
16:51:02 | * | x2f0 quit (Quit: Page closed) |
17:06:54 | * | ics joined #nimrod |
17:08:40 | * | brson joined #nimrod |
17:10:42 | * | leru joined #nimrod |
17:10:43 | * | rixx joined #nimrod |
17:10:52 | * | rixx quit (Client Quit) |
17:11:06 | * | rixx joined #nimrod |
17:13:12 | * | rixx left #nimrod (#nimrod) |
17:13:21 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:13:32 | * | ics quit (Ping timeout: 245 seconds) |
17:16:11 | * | ics joined #nimrod |
17:16:42 | * | q66 joined #nimrod |
17:18:54 | * | boydgreenfield joined #nimrod |
17:20:02 | goobles | any one write super duper meta nimrod? |
17:23:03 | * | kunev joined #nimrod |
17:26:23 | def- | goobles: hm? |
17:26:23 | * | Trixar_za quit (Ping timeout: 250 seconds) |
17:27:09 | goobles | meta programming like in C++ with boost etc |
17:27:22 | goobles | i guess nimrod should be good at dis but I don't see many examples |
17:27:59 | def- | goobles: I tried to do some physical units in nimrod, but I didn't get far: https://github.com/def-/units/blob/master/units.nim |
17:28:50 | * | Trixar_za joined #nimrod |
17:29:31 | goobles | oh not bad, you can make nimrod do: var v = 12.5.volt |
17:30:18 | def- | and volts! |
17:30:29 | def- | which is automatically defined as well |
17:30:53 | def- | and everything is typechecked at compile time and then at runtime you just have floats |
17:31:15 | goobles | # Compiler bug: Doesn't work with borrow |
17:31:20 | goobles | does nimrod doing borrowing? |
17:31:25 | goobles | like rust? |
17:31:48 | def- | I don't know about rust, but here: http://nimrod-lang.org/manual.html#distinct-type |
17:31:52 | flaviu | goobles: No, I think thats refering to something else |
17:32:09 | def- | "The borrow pragma makes the compiler use the same implementation as the proc that deals with the distinct type's base type, so no code is generated." |
17:33:35 | goobles | distinct type is something i wish C++ had |
17:37:32 | adoniscik | how do you access the default value of a proc's arg? |
17:37:42 | adoniscik | I want to set a constant to it |
17:37:59 | flaviu | adoniscik: I'm not sure what you mean |
17:38:01 | adoniscik | is it possible without defining the constant outside the proc? |
17:38:29 | adoniscik | foo: proc (x: T = val). How do you access val inside foo? |
17:38:36 | def- | adoniscik: don't think you can |
17:38:46 | flaviu | Can't you just access x? |
17:38:52 | * | kunev quit (Ping timeout: 240 seconds) |
17:39:02 | flaviu | If nothing is passed in, x == val |
17:39:12 | adoniscik | yeah, so you don't get val otherwise |
17:39:31 | adoniscik | I want val in all instances; it's the "worst case" |
17:39:41 | flaviu | Well, the name of that construct is optional parameters |
17:39:57 | adoniscik | yeah, and I set its default value to the worst case |
17:40:42 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:42:15 | adoniscik | x : int = (const MAXVAL : int = 1000) didn't work :| |
17:43:51 | dom96 | const MAXVAL = 1000 |
17:43:59 | dom96 | proc foo(x: T = MAXVAL) ? |
17:44:17 | * | Matthias247 joined #nimrod |
17:44:30 | adoniscik | that separates MAXVAL from foo but it's the only way I could find. |
17:47:01 | adoniscik | is there a list of common exceptions that we are encouraged to use or do we have to just define our own? |
17:47:40 | flaviu | adoniscik: tut2 has a list |
17:48:04 | adoniscik | flaviu, thanks. that's the one |
17:51:15 | * | io2 joined #nimrod |
17:53:06 | * | Demos joined #nimrod |
17:54:49 | * | darkfusion quit (Ping timeout: 256 seconds) |
17:54:56 | * | darkfusion joined #nimrod |
17:55:25 | * | kunev joined #nimrod |
17:58:05 | * | untitaker quit (Quit: ZNC - http://znc.in) |
17:59:11 | * | untitaker joined #nimrod |
18:05:42 | * | flaviu quit (Remote host closed the connection) |
18:11:53 | * | flaviu joined #nimrod |
18:14:13 | * | Johz joined #nimrod |
18:24:34 | * | mwbrown joined #nimrod |
18:26:05 | * | fran__ joined #nimrod |
18:27:41 | * | darkfusion quit (Ping timeout: 256 seconds) |
18:28:49 | * | Francisco quit (Ping timeout: 256 seconds) |
18:30:41 | * | y2f0 joined #nimrod |
18:31:15 | Araq | hi y2f0 welcome |
18:31:36 | y2f0 | Araq: Hey there |
18:32:07 | y2f0 | Araq: gotta say, I'm really quite impressed with nimrod so far! |
18:32:33 | Araq | thank you |
18:33:36 | y2f0 | I just submitted a request on hackerrank.com to get nimrod up there as a supported language |
18:34:09 | y2f0 | apparently it was added to the todo list. Hopefully this will give it some more exposure (once added that is) |
18:34:16 | def- | y2f0: awesome |
18:35:34 | * | Araq looks up hackerrank.com quietly |
18:36:43 | Araq | ah cool stuff |
18:37:50 | y2f0 | similar to the old spoj. They've got a bunch of smaller languages up there so I think they are pretty open to all kinds of things |
18:38:49 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:39:23 | * | Matthias247 joined #nimrod |
18:51:24 | * | untitaker quit (Quit: ZNC - http://znc.in) |
18:52:27 | * | untitaker joined #nimrod |
19:05:40 | goobles | can u do unique types in nimrod? |
19:05:57 | flaviu | goobles: I think distinct types do what you want |
19:06:16 | goobles | hum no i mean like an object that can only have 1 owner |
19:06:26 | goobles | so doesn't need GC etc |
19:07:05 | flaviu | No, nimrod does not have those |
19:09:13 | Demos | goobles, you can use the stack |
19:09:26 | Demos | or use destructors to create something like c++'s unique_ptrs |
19:10:44 | Demos | goobles, don't try and avoid the GC at all costs. Avoid lots of heap allocation but if you do need the heap then using the GC is usually just fine |
19:10:49 | Demos | nimrod's gc is really fast |
19:12:04 | goobles | are there any performance tests showing how nimrod GC performs? |
19:12:50 | flaviu | goobles: Sure. Run your program with gc off and with gc on. You'll leak memory, but you'll also hopfully be able to see how much slower it makes things |
19:13:47 | Demos | that is hardly a fair benchmark |
19:14:05 | Demos | also note that for microbenchmarks the GC may just not bother to free anything |
19:14:18 | flaviu | You can trigger it though |
19:14:29 | Demos | that will not be represnetitive |
19:15:16 | Araq | in the benchmarks that I've seen the GC performs rather poor. But it kicks ass in real world applications. |
19:15:44 | Araq | micro benchmarks suck and got worse with modern architectures |
19:16:09 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
19:17:01 | Demos | lets be honest here, GC being a perf problem is largely a myth. Dynamic memory can be a performence problem and many languages with GC encourage the use of dynamic memory |
19:18:49 | adoniscik | is it possible to pass types (without values) as args, e.g., foo(int) if its the type itself I'm interested in? |
19:19:09 | flaviu | proc foo(a: typedesc) I think should work |
19:22:39 | adoniscik | can you tell me what's wrong with http://pastebin.com/MABCz63f |
19:23:16 | adoniscik | I get Error: cannot instantiate: 't:type' |
19:23:48 | adoniscik | when I don't pass t and "Error: cannot evaluate at compile time: n" when I do |
19:24:02 | def- | adoniscik: you can't pass back an array of a size you will only find out at runtime |
19:24:25 | goobles | ya i don't care about microbenchmarks, those would either make it super easy for GC(it never collects) or make it look slow if it uses lots of RC.. more interested in making sure GC never has long pauses |
19:24:25 | adoniscik | so I should use a sequence or what? |
19:24:43 | def- | adoniscik: generics would be better if you want an array and know the size at compiletime, otherwise a seq, yes |
19:25:28 | adoniscik | I know the size: it's one of the args |
19:25:48 | def- | adoniscik: but you can call arange(userInputHere) |
19:25:56 | flaviu | adoniscik: It has to be known at compile time, arrays aren't like in java |
19:26:49 | adoniscik | so generics are not a solution in my case? |
19:27:22 | Demos | goobles, you are unlikely to get long pauses, esp since the gc is thread local. If they do become a problem you can activate the real-time GC and you can give it a deadline and even disable it and control when it runs yourself |
19:27:30 | adoniscik | flaviu, def- This is basic proc you see in many languages |
19:27:55 | Demos | and you will really find that you need to use heap allocation much less than in other languages |
19:27:56 | def- | adoniscik: then return a seq and it's basic in Nimrod too |
19:28:08 | flaviu | adoniscik: Fixed it for you: https://gist.github.com/344c3f6231e6afae361e |
19:29:33 | Araq | adoniscik: http://forum.nimrod-lang.org/t/499 |
19:29:45 | Araq | you can use alloca, but it's a bad idea |
19:29:56 | adoniscik | thanks, guys, I'll digest this |
19:30:41 | mwbrown | Just to confirm, c2nim and pas2nim are no longer part of the main git repo, correct? |
19:31:02 | flaviu | Yes |
19:31:06 | mwbrown | ok, good |
19:31:17 | mwbrown | I wanted to make sure of that before filing a bug report on this package that builds it from git |
19:31:25 | mwbrown | the build process was erroring out because it couldn't find them |
19:32:43 | * | kunev quit (Ping timeout: 240 seconds) |
19:32:47 | * | Trustable quit (Quit: Leaving) |
19:39:47 | * | fran__ quit (Quit: Leaving) |
19:40:04 | * | Fr4n joined #nimrod |
19:59:13 | * | jh32 joined #nimrod |
20:00:43 | adoniscik | flaviu, how would you do that with a default T? |
20:02:40 | flaviu | hmm, I don't think its possible. Adding proc arange*(n: int): seq[float] = arange[float](n) makes the call ambigious |
20:02:58 | * | leru quit (Ping timeout: 246 seconds) |
20:03:58 | * | io2 joined #nimrod |
20:04:06 | * | io2 quit (Changing host) |
20:04:06 | * | io2 joined #nimrod |
20:07:34 | adoniscik | if T is a typedesc, why doesn't the conversion T(foo) work? |
20:08:13 | goobles | cause foo don't like T |
20:08:57 | flaviu | goobles: But it does. T is a float, foo is an int |
20:09:04 | adoniscik | it says "type expected", as if typedesc != type |
20:09:36 | flaviu | I'm not really sure what the problem is, maybe someone else knows |
20:09:43 | Araq | typedesc suffers from a non existing spec |
20:09:52 | adoniscik | was I able to explain it ? |
20:10:00 | Araq | it was hacked into the language ... :-/ |
20:10:14 | Araq | so please make a bug report |
20:10:53 | * | jh32 quit (Remote host closed the connection) |
20:10:56 | adoniscik | very simple example: var T: typedesc = int ; T(1.0) |
20:11:09 | * | jh32 joined #nimrod |
20:11:32 | Araq | well |
20:11:40 | Araq | T is not 'int' |
20:11:48 | Araq | it's typedesc[int] |
20:12:06 | Araq | var T = someType should not compile |
20:12:19 | Araq | I'll make this an error soon |
20:12:50 | Araq | this "types as values" feature is a bizzare clusterfuck |
20:13:28 | adoniscik | you recommend using strings or enums instead? |
20:13:47 | flaviu | Ok, I got it to work! |
20:13:57 | flaviu | https://gist.github.com/7cce3d8775861351abe4 |
20:16:48 | adoniscik | interesting! |
20:16:58 | goobles | wooooooooozers |
20:17:09 | goobles | idk what that does but good job |
20:17:21 | dom96 | Well. We got rejected by Wikipedia again https://en.wikipedia.org/wiki/Draft:Nimrod_%28programming_language%29 |
20:17:26 | flaviu | It exploits type inference to get it to work |
20:17:35 | dom96 | I'm too tired to even argue with them now |
20:18:57 | Araq | just reddit it and create a shitstorm |
20:19:32 | goobles | why do they delete it? |
20:19:33 | adoniscik | title it "nimrod fastest language in the world. true or false?" |
20:20:14 | goobles | i have seen other mostly unknown languages on wikipedia |
20:20:38 | y2f0 | pretty ridiculous... |
20:20:50 | flaviu | goobles: https://en.wikipedia.org/wiki/Wikipedia:Other_stuff_exists |
20:21:06 | Araq | flaviu: I'm considering to delete this other stuff |
20:21:14 | * | goobles quit (Quit: Page closed) |
20:21:27 | * | goobles joined #nimrod |
20:22:43 | goobles | http://en.wikipedia.org/wiki/Felix_(programming_language) |
20:22:49 | Araq | this "other stuff exists" is a poor excuse to not have to 80% of wikipedia's content |
20:23:02 | adoniscik | flaviu, why can't you do T: typedesc = typedesc[int] or T:typedesc=int ? |
20:23:26 | Araq | *to not have to remove |
20:23:31 | flaviu | That would just make you an ass, and it wouldn't be in good faith. it would also decrease the likeliness of the nimrod page ever being accepted even further |
20:23:45 | dom96 | I think wikipedia's rules are "You need to be notable, unless you are friends with one of the editors" |
20:24:04 | flaviu | dom96: Their main rule is https://en.wikipedia.org/wiki/Wikipedia:Assume_good_faith |
20:24:42 | Araq | flaviu: that's most ridiculous |
20:24:46 | adoniscik | no, what you need to do is find some credible source to write about nimrod |
20:25:03 | adoniscik | they are complaining that you guys are writing about yourself ("primary" sources) |
20:25:06 | Araq | my personal actions have nothing to do with wether nimrod is acceptable for wikipedia |
20:25:06 | adoniscik | that's a big no no |
20:25:26 | Araq | adoniscik: well but it's wrong |
20:25:34 | Araq | we have secondary sources |
20:25:50 | Araq | and besides this rule is stupid enough to begin with |
20:26:00 | y2f0 | Was drdobbs not enough or? |
20:26:12 | Araq | so if random joe writes a wrong book about nimrod, that is a good source |
20:26:23 | Araq | and if I myself write a book about it, it doesn't count |
20:26:36 | dom96 | Take a look at this article: https://en.wikipedia.org/wiki/D_programming_language |
20:26:49 | dom96 | Do you guys see any non-primary non-self-published sources? |
20:27:16 | dom96 | A lot of the references point to the D forum, the D website, or books written by Walter. |
20:27:24 | dom96 | Perhaps a blog post is in order. |
20:27:47 | Araq | dom96: def- gave a talk about it |
20:27:55 | dom96 | Araq: That's self-published |
20:28:06 | Araq | dom96: well the drdobbs article is not |
20:28:12 | dom96 | Yeah, but it's primary. |
20:28:19 | Araq | this is absurd |
20:28:48 | y2f0 | Gogol would be proud... |
20:28:50 | dom96 | Yep. |
20:29:21 | adoniscik | don't worry about it, just work on the language. Wikipedia is not the only venue to publicize the language. they are a conservative bunch; they will react in due time |
20:29:35 | Araq | they are not conservative at all |
20:29:43 | Araq | I'm sure Swift already is in Wikipedia |
20:29:55 | Araq | they are however political |
20:30:10 | adoniscik | Swift is more notable than nimrod |
20:30:13 | flaviu | Araq: Swift is notable. |
20:30:13 | * | Ven joined #nimrod |
20:30:21 | adoniscik | nimrod needs to gain notability |
20:30:22 | Araq | yeah ok |
20:30:23 | flaviu | Every tech news source published an article on it |
20:30:44 | dom96 | I don't see why D is notable but Nimrod isn't. |
20:30:56 | goobles | D has been around longer |
20:30:59 | dom96 | Swift is a bad example. |
20:31:08 | Araq | "notable" doesn't mean anything |
20:31:10 | flaviu | dom96: Big companies use D in production |
20:31:27 | Araq | it means "worth to put onto Wikipedia" |
20:31:29 | dom96 | goobles: My grandpa is 70 years old, does that make him notable? |
20:31:42 | goobles | no but more people are aware of D |
20:31:46 | Araq | which is classical cyclic reasoning |
20:31:47 | goobles | because its been around |
20:31:59 | flaviu | All the crappy language articles seem to be from around 2005 |
20:32:13 | goobles | and it has Andrei pushing it, who is fairly well known in C++ world |
20:32:33 | dom96 | ugh, fuck it. I don't care anymore. |
20:32:46 | dom96 | adoniscik is right. Let's focus on the language instead. |
20:32:59 | flaviu | dom96: That's the spirit! |
20:33:03 | goobles | nimrod could get there eventually, language seems solid |
20:33:07 | adoniscik | yep, true me: I know WP well |
20:33:10 | flaviu | No point in stressing over it, they'll add it eventually |
20:33:18 | adoniscik | they will |
20:33:27 | dom96 | However, I just remembered that the only reason I found out about Nimrod was because it was on WP at the time... |
20:33:55 | * | darkfusion joined #nimrod |
20:34:47 | adoniscik | I think I was on SO |
20:34:47 | NimBot | nimrod-code/packages master 345cf7e Julien Aubert [+0 ±1 -0]: add nim-sndfile to packages.json |
20:34:47 | NimBot | nimrod-code/packages master 2d744a9 Dominik Picheta [+0 ±1 -0]: Merge pull request #72 from julienaubert/master... 2 more lines |
20:36:41 | * | Hat_and_Cloak joined #nimrod |
20:36:52 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:36:54 | Araq | hi Hat_and_Cloak welcome |
20:37:08 | Hat_and_Cloak | ah thanks! |
20:38:21 | goobles | i found nimrod on D forum i think |
20:38:43 | goobles | D is lame though, stupid Java model |
20:42:43 | * | vbtt joined #nimrod |
20:53:17 | * | jh32 quit (Remote host closed the connection) |
20:57:07 | * | Fx00F joined #nimrod |
20:57:35 | * | Mat3 joined #nimrod |
20:57:38 | Mat3 | hello |
21:00:20 | Araq | hi Mat3 |
21:00:32 | Mat3 | hi Araq |
21:00:50 | Mat3 | bbl |
21:00:54 | * | Mat3 quit (Client Quit) |
21:09:07 | flaviu | dom96: It seems that def-'s talk isn't considered a reliable source, unfortunately we can't use that as a secondary source then |
21:10:05 | * | askatasuna quit (Quit: WeeChat 0.4.3) |
21:15:24 | Araq | Wikipedia itself is not a reliable source |
21:19:33 | flaviu | Nimrod isn't metacircular a metacircular evaluation |
21:20:20 | flaviu | or bootstrapping, I'm not even sure what that line means |
21:20:29 | flaviu | Anyway, its meaningless |
21:21:06 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:21:21 | goobles | it means lisp |
21:21:37 | flaviu | I know, but that line on the wikipedia article is meaningless |
21:21:57 | flaviu | nimrod has nothing to do with metacircular anything |
21:23:50 | * | Hat_and_Cloak left #nimrod ("Leaving") |
21:25:23 | Fx00F | is this one really notable? https://en.wikipedia.org/wiki/Pure_(programming_language) |
21:26:16 | Fx00F | not many references/external links there |
21:27:41 | flaviu | I'm not sure what "named return value optimization" has to do with nimrod |
21:34:36 | Araq | Fx00F: it's notable because wikipedia has an article about it |
21:35:09 | Araq | flaviu: result is named return value optimization |
21:35:34 | flaviu | It makes named return value optimization possible, but so does var result |
21:36:33 | * | Johz quit (Ping timeout: 240 seconds) |
21:42:46 | * | xtagon joined #nimrod |
21:44:52 | * | Boscop quit (Read error: Connection reset by peer) |
21:48:50 | Araq | flaviu: are you sure you know what "Named return value optimization" means? |
21:50:25 | * | ics joined #nimrod |
21:55:52 | * | Mat3 joined #nimrod |
21:56:37 | adoniscik | is there a way to know if an optional argument has been passed without using its default value? |
21:57:30 | Araq | if arg != defaultValue |
21:57:44 | Araq | otherwise use an overload instead of a default value |
21:58:15 | adoniscik | overload, got it. |
22:02:33 | flaviu | Araq: I think so, I looked over the wikipedia page on it. I don't see that the C compiler would special case the result variable and not some other variable name. I'm also pretty sure that the C compiler can do RVO even on unnamed returns. |
22:04:36 | flaviu | Yep, the wikipedia page shows unnamed RVO occurring, where there is no named variable |
22:06:52 | * | mwbrown quit (Ping timeout: 240 seconds) |
22:08:08 | * | Boscop joined #nimrod |
22:08:08 | * | Boscop quit (Changing host) |
22:08:08 | * | Boscop joined #nimrod |
22:10:39 | Araq | flaviu: ok ... but don't trust WP :P |
22:11:48 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
22:13:08 | flaviu | Araq: How about emprical evidence? |
22:13:15 | flaviu | Run their code, they are correct |
22:13:44 | flaviu | `clang++ ./test.cpp; ./a.out` prints just "Hello World!" |
22:14:00 | Araq | how about helping with nimrod development? |
22:15:40 | flaviu | I'm actually the one having trouble with git this time! |
22:16:32 | Araq | impossible |
22:21:12 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:27:49 | * | superfunc joined #nimrod |
22:27:57 | Araq | good night |
22:28:18 | Mat3 | good night |
22:30:22 | * | Mat3 quit (Quit: Verlassend) |
22:41:43 | * | johnsoft quit (Ping timeout: 240 seconds) |
22:42:16 | * | johnsoft joined #nimrod |
22:43:23 | * | Fx00F quit (Quit: leaving) |
23:01:38 | adoniscik | is there a name for throwaway variables? |
23:04:22 | flaviu | adoniscik: Nimrod provides nothing special in that regard |
23:06:55 | * | darkf joined #nimrod |
23:09:39 | * | saml_ joined #nimrod |
23:10:19 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:11:08 | * | mwbrown joined #nimrod |
23:14:31 | * | q66 quit (Quit: Leaving) |
23:22:20 | * | superfunc quit (Quit: leaving) |
23:23:04 | * | superfunc joined #nimrod |
23:33:33 | * | q66 joined #nimrod |
23:38:18 | goobles | rvo |
23:56:21 | flaviu | Whats going on here: https://github.com/Araq/Nimrod/blob/devel/compiler/sem.nim#L99 ? |