<< 23-07-2013 >>

00:05:37xilowhat does "programmable statically typed languages" supposed to mean
00:09:07xilo>mfw hello world example is named "hallo.nim"
00:09:41*DAddYE_ quit (Remote host closed the connection)
00:19:30*DAddYE joined #nimrod
00:25:35EXetoCBitPuffin: fun
00:25:54BitPuffinEXetoC: no :(
00:26:04EXetoCI know right
00:27:24EXetoCxilo: that you can modify the language as a user
00:28:45xiloah
00:28:47xilogotcha
00:41:49reactormonkxilo, editor?
00:42:49xiloreactormonk: what?
00:43:33reactormonkxilo, which editor are you using for nimrod?
00:43:52xilooh, i haven't done anything. just reading on language
00:44:03xilobut i use vim for everything that isn't c#/c++/java
00:44:20reactormonkthere's a plugin from zahary
00:44:31xiloyeah i found it
00:45:03reactormonkgood
00:46:52xilosadly i do more reading on programming languages then actually programming or learning
00:46:54xilo:[
00:51:12EXetoCjust get on with it :>
00:52:17xiloi has no ideaz. so i just read lol
00:53:58EXetoCbeen there
00:54:17*DAddYE quit (Remote host closed the connection)
00:54:31BitPuffinxilo: why aren't you using vim for C++? Install YouCompleteMe and fix that right away
00:55:02BitPuffinGonna sleep!
00:55:14BitPuffinnight y'all
00:55:14xiloBitPuffin: i don't use c++ anymore :3
00:55:16xilog'night
00:55:24BitPuffinxilo: ah, me neither!
00:55:27BitPuffinonly when I have to
00:55:28xilogood show!
00:55:31BitPuffinnight!
00:55:33EXetoCbut now I'm writing awesome code that will make everyone want to use Nimrod. I suggest that you do the same :>
00:55:40xilowhat are you writing
00:55:42BitPuffin(still YouCompleteMe is still worth installing)
00:55:43EXetoCBitPuffin: good luck mate
00:55:55BitPuffinEXetoC: thanks, you too!
00:56:02EXetoCc(:)
00:56:59xiloeh
00:58:17xilowhat ist hat
00:58:31EXetoCxilo: just some OpenGL code
00:58:36xilooh
00:58:37EXetoCxilo: a dude with a hat.. thing
00:58:42xilogot a github?
00:58:49EXetoCc(:)-<
01:00:16EXetoCxilo: https://github.com/EXetoC
01:00:44*BitPuffin quit (Ping timeout: 268 seconds)
01:01:20EXetoCthose libs aren't there yet, because they are unusable atm, but they will be some time before 2014, so stay tuned my friend!
01:01:23xiloenums can have multiple values in nimrod?
01:01:39EXetoCxilo: enum types? if so then yes
01:01:47xiloneato
01:02:09EXetoCif that's what you mean, then the answer is almost always yes c(:)
01:02:15xiloyes
01:02:39xilolooks like nimrod has a nice FFI
01:03:24EXetoCthey are not strictly values though, but rather members, or enumerators </nitpick>
01:03:37EXetoCyes, a great interface
01:03:57xilowhat libs are missing?
01:04:24EXetoCin general?
01:04:33xilofrom what you said earlier
01:04:39xiloXetoC : those libs aren't there yet, because they are unusable atm,
01:05:12EXetoCthat 2D engine
01:06:56xiloooh
01:07:14xiloso gfwl is just for setting up window/context/handling input/etc. not the rendering and such
01:07:26EXetoCright
01:08:00xilogotcha
01:08:02xiloneat
01:08:05xilobetter than using sdl to do that
01:08:18xilo(which i see people do)
01:08:46xiloare strings utf8 in nimrod
01:11:10EXetoC"Per convention, all strings are UTF-8 strings, but this is not enforced. For example, when reading strings from binary files, they are merely a sequence of bytes. The index operation s[i] means the i-th char of s, not the i-th unichar. The iterator runes from the unicode module can be used for iteration over all Unicode characters."
01:12:50xilothat's expected
01:13:13xilobut i mean strings and char types support utf8
01:15:42comexin what way does that not answer the question?
01:16:04EXetoCsupport how? consider this: "åäö".len == 6
01:16:59xilooh
01:17:50xilobut can you do char foo = 'ä'
01:18:42xilokinda silly on that len bit
01:20:59comexhttps://github.com/Araq/Nimrod/issues/400
01:21:14comex(I disagree, by the way - I think Python (3) is probably doing it right)
01:22:58EXetoCmaybe he was referring to py2
01:26:35xiloc# does it by displayed character
01:33:09*EXetoC quit (Quit: WeeChat 0.4.1)
02:16:13*q66 quit (Quit: Leaving)
02:33:36*EXetoC joined #nimrod
02:51:56*EXetoC quit (Quit: WeeChat 0.4.1)
03:04:43*DAddYE joined #nimrod
04:22:57*OrionPK quit (Read error: Connection reset by peer)
04:56:07*xilo quit (Ping timeout: 260 seconds)
06:00:42DAddYEhi thereeeeeeeeee
07:33:48*Araq_ joined #nimrod
07:43:04Araq_comex: python 3 has b"byte strings" because it simply does not work
07:56:47Araq_http://lucumr.pocoo.org/2010/1/7/pros-and-cons-about-python-3/
07:57:23*DAddYE quit (Remote host closed the connection)
08:25:54*DAddYE joined #nimrod
08:28:27DAddYEHi there!
08:28:50DAddYEAraq: is it possible that a cstring is subjected to be GC'd super uber fast?
08:42:49Araq_DAddYE: yes. the GC is aggressive and when you convert string->cstring you need to keep the original string alive
08:43:03Araq_for as long as it's used as cstring
08:44:09DAddYEthanks a lot
08:44:11DAddYEwill double check better tomorrow
08:44:15DAddYE1.44 am in San Francisco :D
08:44:21DAddYEbetter go bed
08:44:22DAddYE:D
08:44:26*BitPuffin[Mobile joined #nimrod
08:47:38*BitPuffin[Mobile quit (Client Quit)
09:11:36*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 22.0/20130618035212])
09:14:21*BitPuffin joined #nimrod
09:15:25BitPuffinOi!
09:15:39BitPuffinAraq: I think I'll make the vectors (and matrices) an array type and add the temporary swizzling once [] is fixed, or add {} and later make [] an alias and later make .xyz an alias too
09:17:06BitPuffinso people can use whatever they think looks the best :)
09:21:32BitPuffinIt even indexes from 0 now! https://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim
09:21:46*Araq_ joined #nimrod
09:40:29*DAddYE quit (Remote host closed the connection)
09:47:12BitPuffinIsn't there a to the power of operator?
09:52:12BitPuffinSeems like pow can't raise ints :/
09:52:33BitPuffinshouldn't the compiler implicitly convert ints to float in this case?
09:56:07*Araq_ quit (Read error: Connection timed out)
09:56:27BitPuffinerf, why do I have to battle this xD ints numbers!
09:56:29BitPuffinit's*
09:56:54*Araq_ joined #nimrod
10:03:39Araq_BitPuffin: feel free to add ^ as expontential operator
10:03:50Araq_it even got the right assoc now
10:04:07BitPuffinAraq_: I might, for now I'll use my when T is int workaround and use toFloat
10:04:26BitPuffinassoc?
10:05:34BitPuffinAraq_: is "mag" a fitting name for the magnitude proc?
10:06:14Araq_I like "mag"
10:06:20BitPuffingood
10:06:26BitPuffinthen I bet others will too
10:06:47BitPuffincurrently have addition, subtraction, negation and magnitude in there hehe
10:11:24BitPuffinam I missing something when I've added dot and cross?
10:11:45BitPuffinAraq_: is there a way to make dot and cross operators so that you can write a dot b
10:30:44BitPuffinHmm, I wonder how to code the cross product of arbitrary dimension
10:31:38BitPuffinor actually, it seems like it only applies to 3 dimensional and 7 dimensional vectors
10:31:49BitPuffinand we don't really need 7 dimensional vectors in an opengl library
10:38:21*q66 joined #nimrod
10:40:21Araq_you can write a.dot(b) and a.cross(b); however I'd like the unicode versions of them
10:40:55Araq_oh well just use *. adn *+
10:41:12*DAddYE joined #nimrod
10:45:07BitPuffinAraq_: hmm, yeah actually a.dot(b) is pretty nice, but I might add the others as aliases!
10:45:24BitPuffinWow this error message was not helpful
10:46:28BitPuffinhttps://gist.github.com/BitPuffin/ede667675c79eb20fc8d gee thanks compiler
10:46:44*Araq_ quit (Read error: Connection timed out)
10:48:55*Araq_ joined #nimrod
10:49:06BitPuffinwelcome back Araq_!
10:49:26BitPuffinI don't know if you saw the gist before you got disconnected
10:51:40BitPuffinoh, so it's the len(a) != 3
10:51:49BitPuffinthen why didn't it just tell me that!
10:52:30BitPuffinIs there a len like operator that works on ranges?
10:53:26BitPuffinerr, max(R) - min(R) perhaps?
10:54:06BitPuffinactually max(R) - min(R+1)
10:54:14BitPuffin-1*
10:54:41*EXetoC joined #nimrod
10:55:44BitPuffinHey EXetoC!
10:55:50BitPuffinVectors are almost complete :D
10:59:16*nihathrael quit (*.net *.split)
10:59:16*silven quit (*.net *.split)
10:59:17*Zor quit (*.net *.split)
10:59:18*JStoker quit (*.net *.split)
10:59:18*Araq quit (*.net *.split)
10:59:35*Araq_bnc joined #nimrod
10:59:35*nihathrael joined #nimrod
10:59:50*Zor joined #nimrod
10:59:52BitPuffinhmm ` Error: type mismatch: got (typedesc[range 0..2(int)]) but expected 'typedesc[range 0..2(int)]' ` for max(I)
11:00:39*silven joined #nimrod
11:00:56*JStoker joined #nimrod
11:05:54BitPuffinHmm, why isn't there any simple way to check the length of an interval :(
11:06:01BitPuffinof a range*
11:08:31Araq_len(a) should work ...
11:08:56BitPuffinAraq_: Doesn't seem like it does
11:09:32BitPuffinAraq_: it's not even in system source so
11:09:58BitPuffinAraq_: http://hastebin.com/jepehayole.pl that's what happens with len on a range
11:10:16Araq_yeah
11:10:24Araq_but it should work for arrays
11:10:40BitPuffinAraq_: Well it says it expects a constant expression :s
11:12:49Araq_bug report
11:13:40BitPuffinAraq_: I guess, the problem is that len(a) works, but that doesn't work with != because len(a) != 3 is not a constant expression
11:13:49BitPuffinAraq_: can you think of any workaround for now?
11:15:03Araq_len(a) != 3 IS a constant expression
11:15:06*DAddYE quit (Ping timeout: 264 seconds)
11:15:12Araq_uncomment I'll fix it tonight
11:15:17Araq_*do comment it out
11:15:45BitPuffinAraq_: No since a is dependent on what's passed through, although that is known because I will be known
11:15:58BitPuffinAraq_: So I don't need to open a github issue then?
11:17:41Araq_a is always an array so it's known at instantiation time
11:18:04Araq_make a github issue please so that progress is monitored
11:18:36BitPuffinAraq_: Okay sure, but is the issue with len or != here? (useful for the bug report)
11:22:42Araq_len of course; the compiler knows how to evaluate !=
11:23:57BitPuffinokay :)
11:26:35BitPuffinIs this good? https://github.com/Araq/Nimrod/issues/544
11:28:48EXetoCBitPuffin: great
11:28:49*EXetoC quit (Quit: WeeChat 0.4.1)
11:29:09Araq_BitPuffin: it's excellent
11:29:18BitPuffinGoodie!
11:29:32BitPuffinI'll go ahead and add a dist proc in the mean time
11:30:05*EXetoC joined #nimrod
11:33:30BitPuffinwelcome back EXetoC
11:33:50EXetoCTNX
11:34:28BitPuffinOkay so I've added vector addition, subtraction, negation, magnitude, distance, dot product and cross product, am I missing something?
11:35:24BitPuffinwait
11:35:27BitPuffinscalar multiplication
11:36:59BitPuffinnow how will I make that work properly, hmm
11:37:09BitPuffinis there a base type for numbers?
11:37:18BitPuffinno that won't work
11:37:25EXetoCno?
11:38:38BitPuffinPerhaps this?:
11:38:39BitPuffinproc `*`[T, T1, I](a: T1, b: TVector[T, I): TVector[T1, I] =
11:39:13BitPuffinNo damn that doesn't work either...
11:39:26EXetoCthere are type classes. check system.nim
11:39:50BitPuffinBecause if the elements of the vector are floats, and you pass in an int, then it doesn't become int
11:40:06Araq_proc `*`[T, I](a: T, b: TVector[T, I]): TVector[T, I]
11:40:21Araq_--> just use the unification algorithm of overloading
11:40:30BitPuffinAraq_: but then a and the vector has to be the same type
11:40:39Araq_that's a feature
11:40:44BitPuffinlike int scalars with int stuff
11:40:59Araq_I like it this way
11:41:01BitPuffinyou should be able to do float scaling on an int vector and get back a float vector
11:41:10Araq_meh
11:41:20BitPuffinno mehs
11:41:29Araq_IMO that should not be supported
11:41:34BitPuffinfor realz and shizzles
11:41:37BitPuffinWhy not?
11:41:55Araq_because if the user can't decice on his types, it's not your problem
11:42:21BitPuffinnot sure if I agree
11:42:28EXetoCI don't care much for it, but you can perform type conversions inside the function if you want
11:42:31BitPuffinthe user might have use of the vector being ints at first
11:43:08BitPuffinbut then when it comes to the time of scaling it could be useful that you get a float back
11:43:19BitPuffinEXetoC: there doesn't seem to be a number type class
11:43:28EXetoCTNumber
11:43:56BitPuffinactually yeah
11:44:54Araq_implicit conversions and generics do not really mix
11:44:57BitPuffinthat should work
11:45:10Araq_it's things like these which turn C++ into a clusterfuck
11:45:18Araq_just say no
11:45:43BitPuffinproc `*`[I](a: TNumber, b: TVector[TNumber, I): TVector[TNumber, I] =
11:45:44BitPuffin?
11:49:07EXetoCit looks correct. just add the missing ].. and you probably want to export it as well (*)
11:50:33BitPuffinyeah
11:50:34BitPuffinhmm
11:50:57EXetoCbut in this case, all instances of TNumber might be different, but I don't know if you're going to ignore his suggestions
11:51:39BitPuffinGotta go!
11:51:51BitPuffinWe'll fix this later
11:51:53BitPuffincheers
11:52:39EXetoCbye
11:54:00Araq_same here, bye
11:54:12*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 22.0/20130618035212])
11:56:06*BitPuffin quit (Ping timeout: 246 seconds)
12:11:20*DAddYE joined #nimrod
12:23:37EXetoCI'm constantly reminded of how bad D's tuples are. too much template magic
12:23:47EXetoCand of course an awful syntax as a result
12:23:54*Araq joined #nimrod
12:23:56EXetoC</hate> later :-)
12:33:45*Araq quit (Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212])
12:44:53*DAddYE quit (Ping timeout: 248 seconds)
12:48:27*Araq joined #nimrod
12:50:29*Araq quit (Client Quit)
13:25:29*xilo joined #nimrod
13:41:20*DAddYE joined #nimrod
14:15:16*DAddYE quit (Ping timeout: 276 seconds)
15:11:10*DAddYE joined #nimrod
15:15:40*DAddYE quit (Ping timeout: 256 seconds)
15:48:17EXetoCsome of my generic functions depend on other generic functions that I don't necessarily want to export. I wonder if that can be made to work somehow
15:49:34EXetoCmight be a little hacky though. hm, term rewriting macros to the rescue maybe
16:11:14*Mat2 joined #nimrod
16:11:21Mat2hello
16:12:48*DAddYE joined #nimrod
16:46:42*DAddYE quit (Ping timeout: 268 seconds)
16:52:47EXetoCI'm also making a vector lib. I was pushing the compiler to its limits again, so I decided to just keep it simple by disallowing `*`(vec, scalar). "v2(x, y) * v2(z)" is fine imo
16:53:19EXetoCbut only because of the short names. I try not to overdo it though
17:25:16dom96yo yo
17:25:18*DAddYE joined #nimrod
17:25:45Mat2hi DAddYE and EXetoC
17:25:56EXetoChello there, human|bot|alien
17:26:00dom96no hi for me? :(
17:26:18Mat2hi dom96
17:26:46Mat2hi all
17:26:51Mat2:)
17:26:51dom96So i tried advertising nimrod in here, care to give me some support? https://news.ycombinator.com/item?id=6090549
17:30:00dom96Maybe I should just start replying "Use Nimrod" to everyone.
17:30:43*Mat2 just reading the comments and article?
17:31:43*DAddYE quit (Ping timeout: 268 seconds)
17:31:50dom96EXetoC: are both you and bitpuffin working on vectors?
17:32:15*Araq_bnc is now known as Araq
17:32:21Mat2hi Araq
17:32:32EXetoCdom96: actually, this is not a standalone lib. I'm aware of how many people are working on vector stuff
17:33:32Mat2so why don't all of you don't work together ?
17:33:48Mat2soryy, so why all of you don't work together
17:33:53Mat2^sorry
17:34:19dom96indeed, good question.
17:38:18*DAddYE joined #nimrod
17:39:32EXetoCI'm sure the others will figure out what needs to be done. BitPuffin is just having some issues with the generic part of it since he's new, and he doesn't even have a repo yet
17:41:44Mat2if someone of you have troubles with CPU dependent aspects (like utilizing SSE or other SIMD extensions) I can help out
18:10:28Mat2dom96: What are your arguments for Nimrod as reaction to the article you linked ? It describes mostly subjective preferences of style
18:10:45Mat2not functionality
18:12:08dom96I think it's pretty hard for people to give an unbiased review of a programming language after they spent so much time rewriting a big part of their own (or the companie's they are a part of) infrastructure in that language.
18:12:24dom96*company's
18:14:40Mat2in these case one can simply remark something like: "use Nimrod, it's new and sexy, its the future, get part of its fashion, have fun"
18:15:26dom96I haven't actually given Go a proper try because I don't see any reasons why I should.
18:17:20Mat2I have some (non impressive) experiences with the language
18:20:30Mat2as otherwise noted in the comments, its type-system is not consequent, only limited extensible and far to restrictive for system-programming puposes
18:20:59Mat2^purposes
18:23:21Mat2the coroutine concept is simple and elegant on the other side
18:24:29Araqthe goroutine concept is in fact very broken
18:25:14Araqit doesn't prevent capturing variables, in fact it encourages it
18:25:30Mat2I think your ar right
18:25:34Araqbut captured variables are a recipe for data races
18:26:02Araqyou pay the price of potentially concurrent code everywhere when in fact the concurrency is quite limited
18:26:17Araqbecause you only have N CPUs where N is usually a small number
18:27:44Mat2that's true but Go was build for parallel processing inside large MIMD systems (like Google's server farms)
18:28:40Araq*shrug* for many CPUs its GC technology doesn't scale anyway and it will be tough to make it scale
18:29:04Araqin practice they will use multiple processes like everyone else does
18:29:40Mat2it's even not granted that goroutines shedule on different cores, anyhow
18:31:05Mat2but its a simple concept
18:31:28Araqthreads and locks are also simple
18:32:07Araqit's hard to ensure correctness with them, but then goroutines are not much better at that problem
18:36:37Mat2see, much programmers I know at work which came from university have problems understanding locks, mutexes and semaphores like all stuff of concurrent programming. I think the designers of Go just choosen an approach which offers utilisation for peoples which did not want to gain deep undertanding of the material
18:37:32Mat2(it doesn't mean to think of there solution as effective in terms of energeing)
18:38:22Mat2however, go had seem to work out good enough for the infrastucture of Google for sure
18:39:20AraqI dunno; most of their services are in other languages and I can't see them rewrite them in Go
18:40:38Araqalso I can't see the language appeal to the average Google developer who is a smart guy after all and surely can deal with generics and the like
18:41:12Mat2there won't. Go is used more like a scripting-language with ambitions for future usage in system-programming
18:41:50Mat2I can envision a Go compiler for small, embedded boards like the Maximite or Arduino class boards
18:41:56comexAraq: and yet Google doesn't use any fancy modern languages, but usually C++ and Java
18:42:05comexand they make crap like Dart
18:43:12comexmy impression has always been that Google wants their languages to be as boring and unobtrusive as possible, encouraging straightforward, unclever code
18:43:44comex(however, i was only on the inside very briefly, so take that with a grain of salt)
18:44:45Araqcomex: I know
18:45:07comexanyway, it doesn't seem like they'd terribly mind making custom container types annoying, why are you using those in the first place
18:45:36comexthen again, Go is radical in other ways, with no classes and goroutines and stuff
18:45:39comexthat's what I like it for
18:45:46comexand the syntax is pretty good
18:45:57AraqI find it insulting
18:46:16Araqit's always been "type identifier" or "identifier: type"
18:46:30comexI like "identifier type"
18:46:35comexmy language will do it that way
18:46:41Araqlol
18:46:52Mat2were discussing likeness of style
18:47:10comexexcept there will be a colon anyway
18:47:12comex:foo int = 5;
18:47:23EXetoCeh
18:47:24comexbut normally omitted, so :foo = 5;
18:47:29Mat2I think the coroutine concept and its limitations are an important feature of Go
18:47:46Araqsure it's an important feature of Go, Mat2
18:48:03dom96comex: nooo, no semicolons!
18:48:08Mat2personally, I generally do not like to read C style languages
18:48:28Araqsemicolon insertion rules... seriously?
18:48:43Araqexpr/stmt split ... seriously? (Nimrod evolved :P )
18:48:57Araqatoi wtf?
18:49:06comexlol
18:49:09Araqyeah ... "Nice" syntax
18:49:18Araqamateurs ...
18:49:40comexdom96: I feel like it's best to either go full Python or stick with semicolons
18:50:22comexanyway, I'm doing semicolons like Rust
18:50:46dom96perhaps. I really like Python's syntax, which is the reason why I like Nimrod so much.
18:51:36comexstatements are expressions, semicolon evaluates the first and returns the second (or void if there is nothing after it)
18:51:58comexso a function body { 5 } returns 5, but { 5; } returns void
18:52:01Mat2my point is: There is a demand for languages which handles parallel-processing without expected knowledge sidens the programmer, and Go seem to be designed for this audience
18:52:13Araqcomex: you don't need semicolons for that feature ;-)
18:52:32comexit makes it more elegant :p
18:53:25comexanyway, my language is meant to feel familiar from C, so semicolons are a must :)
18:56:35comexmy language will also have no classes, no automatic vtable generation... but templates and extremely powerful macros
18:56:38comexand it doesn't exist :p
18:56:41comexbut it will...
18:58:17Mat2comex: Have you take a look at Rust ?
18:58:38Mat2or better ATS ?
18:59:06comexMat2: i've been meaning to look at ATS properly but it's extremely far from what I want
18:59:30comexRust is very nice, but I want my own take on things :p
19:01:53Mat2I also do not understand what's the advantage to depend a language on semicolons as sequence terminator because these 'feature' was originally intendend as compromise for easier parsing. It has nothing to do at all with syntax and semantic reasons of a programming-language
19:03:04Araqwhether an expression yields a type or void is a semantic question, semicolons have nothing to do with it
19:04:18comexin particular, my language does not care about safety like rust, will have a minimal and optional standard library - you are encouraged to use C libraries - and will make it very easy to use C libraries
19:05:04Mat2so you want a C++ without the complexibility
19:05:13comexsort of
19:05:36comexAraq: sure, but they make it unambiguous whether a particular line is supposed to return a value or void
19:05:50Mat2???
19:05:57comexsemicolons
19:06:09Araqcomex: use 'discard' to discard a value instead :P
19:06:29comexthen you would have to write 'discard' everywhere
19:06:40comexwell. not necessarily
19:09:16Mat2hmm, no granted type-safety, Algol ispired syntax with lot of curly-braces, template support - choose B !
19:09:50comexsure :p
19:10:05comexsince when does B have template support?
19:11:06Mat2MULTICS had featured a very advanced preprocessor for source-code out-of-the box
19:11:29*Smaehtin joined #nimrod
19:11:43Araqfor the people who don't know: Multics = Unix with error checking
19:13:02comex(i want macros to be at least as powerful as Nimrod's, but hopefully nicer)
19:13:24Araqhey nimrod's macros are getting nicer all the time
19:13:29Mat2the later Unix version of B lost these possibility
19:13:32comexi believe you :)
19:13:39dom96comex: save yourself lots of work and just fork Nimrod ;)
19:13:42Araqand if you do make them even more powerful
19:13:54Araqthen you get into serious trouble IMHO
19:13:57*alexandrus joined #nimrod
19:14:02comexwhat kind of trouble?
19:14:12Araqbecause then you can't reason about any piece of code at all
19:14:22comexyep, that's the goal
19:14:26comexno, really
19:14:27Araqas the macro could go UP the ast
19:14:35Araqand transform the whole module
19:14:51comexyet, on the other hand, I hate how implicit and confusing C++ code can be
19:14:59comexso in theory, the rule will be:
19:15:10comexas powerful as you need when you need them, don't bloody use them unless it's life or death
19:15:36comexkind of schizophrenic!
19:16:51comexof course, nimrod's are quite powerful already
19:16:56comexprobably it won't make much difference
19:17:15comexbut really what's more important is "nice"
19:18:29comexso, for example, it will be possible to evaluate the type or value of an AST node
19:19:12comexit will also be possible to create a type which does your macro thing whenever it's used in any way
19:22:43Mat2you will get in serious trouble with this approach because there can exist situations where the value is constant but its type depends on access
19:23:04Mat2I think of unions for example which references the same address
19:23:33Mat2^adress
19:24:33Araqit's "address"
19:24:49Mat2thanks
19:25:18EXetoCthe actual union is a type too
19:25:29EXetoCso it just depends on how much you can query as a user
19:27:50Mat2typedef union {uin64_t word; uint8_t bytes[7];} suCell;
19:28:54Mat2<- value constant, access dependent of referencing word or bytes[n] independent of the structure type
19:34:50Mat2what these union determinize is the implicit type conversation, not type of its references memory location
19:35:14Mat2^referenced
19:36:41Mat2its content can be of any type possible (for example per priour pointer access)
19:38:29Mat2so how can a statical compiler evaluate the value inside such a construct without reinterpretation of the AST ?
19:38:41Mat2I think that's not possible
19:45:06*gradha joined #nimrod
19:49:48EXetoCYES
19:49:58EXetoCdon't you just love it when you manage to tame OpenGL?
19:50:11EXetoCgradha: hello friend. are you done watching cat videos?
19:50:42gradhathe internet keeps producing them, there's no end to them
19:51:03Mat2suCell test; test.word = (float) 42.14; uint8_t erg = test.bytes[0]; // gcc compiles without type checking or error
19:51:08gradhaI don't watch cat videos though, I hate cats
19:51:20EXetoClol rly. ok :p
19:56:06EXetoCMat2: but AST is usually only a compile-time concept isn't it? I don't think he was referring to the runtime value. I don't know what he meant to be honest
19:56:56EXetoCliterals maybe
19:58:24Mat2I had interpretated his goal as evaluating or better estimate the run-time characteristics of values though AST parsing
20:00:46Mat2I mean static parsing and not its run-time interpretation
20:05:51Mat2in my opinion his goal can only be reached if the type of all referenced memory-locations is known at compile-time and that means some kind of interpretation is needed
20:06:21Mat2within a JIT compiler, that's possible for example
20:13:00EXetoCcomex: is that what you were referring to? ^
20:19:13EXetoCgradha: do you like squirrels?
20:24:08gradhaI like most animals well cooked
20:27:40EXetoCic
20:31:18*alexandrus quit ()
20:57:29comexMat2: in the case of a field in a union, then the callback will only get invoked if you actually access that field
20:57:53comexit's not intended to magically protect against you ever accessing that memory, but simply a way to control the semantics of a type
20:59:30comexsimilar to C operator overloading, but more powerful
20:59:33comexer, C++
21:01:42Mat2hmm, can you explain your idea more in depth please
21:02:40Mat2accessing a callback by referencing a variable reads like dynamic-type casting for me
21:04:24comexthe callback would be part of the variable's type
21:04:33comexor otherwise statically registered for that particular variable
21:04:40SmaehtinIs there a way in Nimrod to get the parameter types of a proc inside a template?
21:04:55comexin most cases this isn't particularly needed - or doesn't get you more than a regular macro
21:12:33comexone example where it might be useful is a type that lazily represents a value - say, a future
21:12:58AraqSmaehtin: currently not
21:13:47comexor heck, a pure lazy type like in haskell, you could do that
21:14:00SmaehtinAraq: Alright, I see, thanks
21:15:50comexif a was a lazy int, overload any instances where a is used to force strictness - that much can be done in C++ (albeit in an ugly fashion, you would have to overload every operator to delegate to the underlying type), but then you can say that if it was already forced statically earlier in a function, then the code to check if it's lazy need not be generated
21:16:57comexsomething that wouldn't require the full power but still can't done in Nimrod - I think - is making a type that can be swizzled like in GLSL, as mentioned before
21:17:41comexor making an object that runs code when it goes out of scope, but again without having to make a wrapper class that overloads every operator to delegate, and with the ability to still use & to make a pointer to the underlying object
21:18:21Araqcomex: swizzling will be possible via overloading of '.' and nimrod got destructors
21:19:05comexbut can you do it without manually specifying every possible swizzle combination? i.e. is it integrated with the macro system
21:19:22Araqyes
21:19:30comexwell, that's nice :p
21:19:34comexhow does it work?
21:19:55EXetoCpeople really like swizzling :>
21:19:57Araqmacro `.`(x: typeHere, y: expr): typeHere = # macros participate in overloading resolution now
21:20:09comexoh, that's fun
21:20:13Mat2EXetoC: *g*
21:20:44Mat2ExetoC: specially in Norway
21:21:06comexmine won't look like that because it doesn't do overloading (at all)
21:21:13EXetoCaha
21:21:37comexbut ok, I'm wrong, that's pretty close to what I want to be able to do
21:22:20*EXetoC quit (Read error: Connection reset by peer)
21:25:48comexhmm, is there anything else interesting about my language idea
21:26:39comexi want only first class iterators, like Rust - there is no reason you shouldn't be able to say enumerate(zip(rlist_each(a), rlist_each(b))) and have it be just as efficient as doing it manually
21:27:00comex*yawn*
21:30:19Mat2do you also prefer polymorphism ?
21:33:40comexwhich kind?
21:34:16Mat2the 'most-wanted' one as in C++
21:34:22comexi think operator overloading, function overloading, and probably virtual methods are evil and should be avoided at all costs
21:34:36Araqlol
21:34:38comexlike, people just don't know where to stop
21:34:53Araqvirtual functions are evil but operator overloading is only some sugar
21:35:03comexis it nice to be able to implement + on vec3? yes. is it nice that LLVM use iterators have like three different ways to convert to user? no.
21:35:15comexor maybe some of them go to use
21:35:25comexbut there's at least one magic * operator there
21:35:26comexit's evil
21:35:36Mat2LLVM is a bad example by design
21:35:39Araqit's irrelevant when you have the proper tools
21:35:46comexwhat are proper tools?
21:35:56Araqoooh I need to move my mouse cursor over it to see where it comes from
21:36:02Araqbig deal :rolleyes:
21:36:12comexfirst of all, i don't have such tools
21:36:19Araqwell that's your problem then
21:36:22comexsecond of all, i don't want to move my mouse cursor over every word in the program to see what it does
21:36:28Araqcoding without proper tools is foolish
21:36:42comexor if it's a patch or on github's code viewer, what do i do then?
21:37:01Araqdespair I guess
21:37:08comexI don't even like C++ overloading [] for map and vector
21:37:37comexwell, vector's okay (it can be confused with C arrays, but you shouldn't use those anyway), but map is confusing, because
21:38:03Mat2cout << "overloading can be fun in case of the right namespace" << "\n";
21:38:04comexreading a particular bit of code that does things[unchecked index] = thing
21:38:24comexit's not clear whether it's an unsafe vector or array operation, or a perfectly fine map one
21:38:44*EXetoC joined #nimrod
21:38:46comex(this can be helped by naming 'things' better as 'thingMap' or whatever, but that's not always done)
21:38:59comexand i've seen someone other than me get tripped up by this
21:39:27comexof course it's not the end of the world, people spend lots of time reading C++ without too much trouble
21:39:36comexbut it's just a stumbling point, which should be avoided.
21:40:28comexlike linus, I dislike obj.method() for similar reasons
21:40:40comexas it loses context
21:41:07comexso I prefer sometype_method(obj) even if it's more typing (if you have such a good IDE, surely it will also be able to autocomplete this for you, so who cares?)
21:41:45Mat2comex: I do not know a single person who reads C++ code under free will (except the ones which get paid to do so)
21:41:47EXetoCI prefer the former, Nimrod style
21:41:51Araqit's not about the typing, comex
21:41:53comexfunction overloading, for its part, is okay if you don't have implicit type conversions, but with those, like in C++, it's awful
21:41:59AraqI don't want to read that overly verbose shit
21:42:16Mat2agree
21:42:40comexI do, it's not that long and makes it clear what I'm dealing with - again, without having to roll over things in an IDE I don't have
21:42:57AraqI don't want to code for dinosaurs who never used a working IDE nor can imagine such a thing
21:43:00comexit would sure be nice in something like chrome where there are like 5 levels of delegation to sub-objects for everything
21:43:12Araqand yet use VIM with plugins which pretty much is an IDE anyway
21:43:29comexand the same members have different types in different objects, but they implement the same methods
21:43:32comexreally confusing
21:43:47comexas for vim, I don't mind editor power, but it's a fact that there is no good C++ navigation tool for vim :p
21:43:55*Associat0r joined #nimrod
21:43:55*Associat0r quit (Changing host)
21:43:55*Associat0r joined #nimrod
21:44:22Mat2Araq: I use VIM for coding in Nimrod at current *g*
21:45:10comexnor emacs, I think
21:45:59*gradha quit (Quit: bbl, need to watch https://www.youtube.com/watch?v=1ZZC82dgJr8 again)
21:46:16comex(again, LLVM is a primary example of how horrible C++ can be when it comes to function overloading)
21:47:09AraqI'm sick and tired of people complaining about overloading (100% compiletime feature) and then don't care about what the ordinary scripting language does
21:47:26Mat2Emacs is fine; It is an OS featuring an embedded text editor ;)
21:47:45comexAraq: scripting languages typically have no overloading
21:47:57Araqwhich is delegating everything to runtime so you have no chance but pray nobody actually modified the "builtin" == operator or something
21:48:13comexwell, i mean function overloading
21:48:18Araqcomex: indeed they are doing something much worse instead
21:48:34Araqand yet nobody even realizes
21:48:53comexi don't even know what it would mean to "modify the builtin == operator"
21:49:02comexyou can overload == in most scripting languages, sure...
21:49:15Araqmonkey patching? dynamic binding?
21:49:45comexthey're like abortion
21:49:45*Associat0r quit (Quit: Associat0r)
21:49:50comexthey should be safe, legal, and rare ;p
21:49:51*OrionPK joined #nimrod
21:50:49comexwhich, incidentally, means that I do not like JS, Ruby, and Objective-C's habits of monkey patching built-in objects to add random stuff
21:52:04comexbut depending on the situation, that isn't that much better with an overloading-based dot operator either, you could still get a duplicate tohex(string)
21:52:12comexbut the fault is of the dot operator!
21:52:36comexif you don't have a dot operator, it's not cleaner looking to use a short, ambiguous name
21:52:38Mat2a scripting-level is a patchwork environment for gluing applications. I can not think of a meaningful example where overloading features would make sense for it
21:53:01Mat2^language
21:53:02comexMat2: scripting languages are very often used to write large applications, you know that perfectly well ;p
21:54:01Mat2that's why the world went wrong...
21:54:14comexi like scripting languages
21:54:28AraqI never use them anymore unless I can't avoid it
21:54:29comexi'm a little schizophrenic on this matter too
21:54:44comextyping types makes code easier to understand... yet not doing it makes code easier to read
21:54:58Araqno
21:55:07Araqthat's just ... wrong on so many levels
21:55:09comexer, s/read/write
21:55:10comexsorry
21:55:19comexwhat i said is certainly wrong :)
21:55:26AraqI see
21:55:32comexadmittedly, scripting versus compiled languages isn't just that - part of the difference would be made up with more powerful macros
21:55:49comexlike, there is no reason I shouldn't be able to do Python metaclass crap in a compiled language
21:56:14Araqthere should be a reason to do metaclass crap in Python
21:56:18Araq*shouldn't
21:56:24comexyet sometimes there is
21:56:48comexalthough they're often used as poor man's macros :/
21:57:10comexfor example
21:57:22comexRPC
21:57:27comextrivial in every dynamic language
21:57:37comexpain in the ass in (almost) every static one, you need an external code generator
21:58:05comexand usually you need a definition file for your methods, separate from the normal code defining the object
21:58:22comexbut there is no reason it shouldn't be easy in a static language too
21:58:40comex(although you should always be careful with RPC - but that doesn't mean there should be pointless barriers)
21:58:54Araqyou know, C# does it easily
21:59:25SmaehtinDo the constraints in Nimrod not work on objects yet? like type TMyObject[T: int] = object ...
21:59:38comexI don't know much about C#, but I bet it takes advantage of reflection and crap
22:00:00comexwhich is nice, but not applicable to native code languages
22:00:00Araqthey have issues, Smaehtin but your example looks just fine
22:01:14SmaehtinAraq: I can still declare a var value = TMyObject[string]() even though the constraint is int though
22:01:34SmaehtinAraq: I'm guessing that's just a bug then?
22:01:57Araqyeah
22:02:45Mat2get some slep, ciao
22:03:05*Mat2 quit (Quit: Verlassend)
22:03:20SmaehtinAraq: Alright. Still though, damn you did a good job with Nimrod. I can't believe I haven't heard of it before
22:03:26SmaehtinAraq: How long has it been in development?
22:04:30Araqdunno 6 years
22:04:54SmaehtinHoly shit
22:09:32Araqyeah but I can only work on it in my spare time
22:12:02SmaehtinShame
22:29:12*Smaehtin quit (Quit: Page closed)
23:02:48*xilo quit (Read error: Connection reset by peer)
23:04:13*xilo joined #nimrod
23:40:58EXetoCwoot