<< 13-06-2016 >>

00:47:41*mcc joined #nim
00:49:14mccFew questions about OO. First: the {.base.} pragma. What *exactly* does it do? The manual says it is for "base methods". Is it for every method that might be overridden? Or just the base? I have one method which inherits from a {.base.} method and is not overridden but I am still getting a warning that I forgot to put {.base.}
00:51:03mccSecond question: Is there anything like "super"? For example if B is "of A", and I have a method f(x:A) and a method f(x:B), in the implementation of f(x:B) how can I call f(x:A) ?
00:53:07*yglukhov joined #nim
00:56:02lazypenguin@cheatfate, nice catch
00:57:49mccActually, weirder, I have two methods in this file. A next() and a draw(). With next(Player), it gives a warning if i do NOT say {.base.}. With draw(Player), it gives an ERROR if I say {.base.} and says it's "not a base method".
00:57:49mcchttps://bitbucket.org/runhello/nim-practice/src/8829bb479f51581b14df5e951e4c618feb5a9ce1/maze.nim?fileviewer=file-view-default#maze.nim-99
00:57:53*yglukhov quit (Ping timeout: 260 seconds)
00:58:52mccOne more question. I do not understand how dynamic dispatch works on objects which are not ref-objects?
00:59:27mccIn this code I have a Mover object, and then child objects Player and Chaser. None are ref objects. However, my understanding is that non-ref objects are being passed and stored by value.
01:00:09mccSo I don't understand how I could have, for example, an array of Mover objects and then store a Player or Chaser in it, if Player or Chaser are different sizes from Mover. In C++ this would not work. How does Nim implement this? And is this why my code breaks?
01:00:40*ivan left #nim (#nim)
01:01:34lazypenguinhmm i've never seen 'method' before, is that an alias for 'proc'?
01:02:07mccIn the manual it is described as similar to proc but it uses dynamic dispatch. http://nim-lang.org/docs/manual.html#types-enumeration-types
01:13:45lazypenguinmcc, this is outside my realm of knowledge but could it be related to the fact that your methods have different return types? Seems the compiler detects the polymorphism correctly between draw(mover) and draw(player) and throws the base error but the same is not true for your next() methods which have different return types
01:14:13mcclazypenguin: yes, sorry, that is the problem, if i change Player to Mover i no longer get the warning
01:15:00lazypenguin:)
01:16:41mcchow on earth do i control which of the two versions of map() documented in http://nim-lang.org/docs/sequtils.html#map,openArray[T],proc(T) i get?
01:18:53lazypenguinLooks like the function signature is slightly different in that the new one takes op as the second argument with a return type of S `op: proc(x: T): S`
01:20:09mccbut they both take op as the second argument
01:20:59mccoh, is it controlled by the second argument's return value... that's subtle D:
01:21:12lazypenguinsubtle indeed
01:28:59*yglukhov joined #nim
01:33:02*yglukhov quit (Ping timeout: 244 seconds)
01:33:37renesacmcc: you might be interested in this blog post series:
01:33:37renesachttp://goran.krampe.se/category/oop/
01:33:54renesacthe older 5
01:34:47mccrenesac: Hm. Which of these are out of date?
01:35:11mccrenesac: I'm currently filing several issues on the nim github (mostly of the form "the warnings and/or manual should be clearer about this")
01:39:40*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:40:09renesacI don't know that changed since then..
01:40:16renesac*what
01:42:18*chemist69_ quit (Ping timeout: 272 seconds)
01:53:04*chemist69_ joined #nim
01:58:16*chemist69_ quit (Ping timeout: 250 seconds)
01:58:37*lazypenguin quit (Ping timeout: 250 seconds)
02:04:34*yglukhov joined #nim
02:07:40*zodiak_ quit (Ping timeout: 264 seconds)
02:08:48*yglukhov quit (Ping timeout: 246 seconds)
02:08:59*zodiak joined #nim
02:11:32*lazypenguin joined #nim
02:11:39*chemist69_ joined #nim
02:29:51*bjz joined #nim
02:35:10*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:40:02*yglukhov joined #nim
02:44:37*yglukhov quit (Ping timeout: 260 seconds)
02:59:33*bjz joined #nim
03:03:47*yglukhov joined #nim
03:08:06*yglukhov quit (Ping timeout: 244 seconds)
03:22:03*GangstaCat quit (Ping timeout: 264 seconds)
03:34:17*GangstaCat joined #nim
03:38:33*akaisora_ quit (Ping timeout: 240 seconds)
03:39:21*yglukhov joined #nim
03:43:45*yglukhov quit (Ping timeout: 244 seconds)
03:54:17*bjz_ joined #nim
03:56:03*bjz quit (Ping timeout: 250 seconds)
04:09:18*akaisora joined #nim
04:11:29*michael_campbell quit (Ping timeout: 244 seconds)
04:16:22*akaisora quit (Remote host closed the connection)
04:25:07*Kingsquee joined #nim
04:27:56*SShrike joined #nim
04:41:06*SShrike quit (Quit: SShrike)
05:03:20*chemist69_ quit (Ping timeout: 260 seconds)
05:20:47*chemist69_ joined #nim
06:04:00*GangstaCat quit (Quit: Leaving)
06:16:14*bjz joined #nim
06:16:31*bjz_ quit (Ping timeout: 244 seconds)
06:21:42Demosso variadic generics could help the db modules support various data types (you can't insert blobs into sqlite as a string)
06:22:59*endragor joined #nim
06:23:01*endragor quit (Remote host closed the connection)
06:23:29*endragor joined #nim
06:39:20*heretobang joined #nim
06:56:06*yglukhov joined #nim
06:56:36*mcc quit (Quit: Connection closed for inactivity)
07:01:45*gokr joined #nim
07:27:25*kingofoz quit (Ping timeout: 260 seconds)
07:27:54*kingofoz joined #nim
07:33:19*fredrik92 joined #nim
07:33:21*kingofoz quit (Ping timeout: 276 seconds)
07:37:29*Gonzih joined #nim
07:46:02*chemist69_ quit (Quit: WeeChat 1.5)
07:48:36*Trustable joined #nim
07:51:35*PMunch joined #nim
07:52:34endragorIs it possible to pass sequence to a proc expecting varargs parameter?
08:00:31PMunchendragor, it could probably be done by a template or macro if there is no built in way
08:04:20*desophos quit (Read error: Connection reset by peer)
08:05:41endragorPMunch: how exactly, given the seq contents are not known in compile-time?
08:06:51PMunchHmm, according to rosettacodes it seems that you can simply pass the seq: rosettacode.org/wiki/Variadic_function#Nim
08:07:36*zodiak_ joined #nim
08:08:13PMunchendragor, macros run during runtime so they should at least be able to do it.
08:10:04*chemist69 joined #nim
08:10:41endragorhm, indeed you can just pass it, I had a problem in a different place. macros are invoked during compile-time though, so if you can produce something with a macro you can do it without macro, too
08:11:03*zodiak quit (Ping timeout: 276 seconds)
08:13:49PMunchYes, but sometimes it's a lot easier to do it at with a macro
08:14:24PMunchTechnically you could write a macro to convert a seq to a varargs type and pass it, but I guess that is already written :)
08:18:39*gokr quit (Ping timeout: 250 seconds)
08:19:28*Salewski joined #nim
08:19:34AraqDemos: yes but varargs[typed] exists and can be manipulated with macros
08:20:43SalewskiDom, Listing 7.5, last line: requires "jester >= 0.0.1" is missing! Bye.
08:20:48*Salewski quit (Client Quit)
08:20:48Demosbut that won't work if you have a query with multiple different parameter types
08:20:55Demosanyway it's not a big deal
08:26:37Araqhmm?
08:27:21Demoslike if I have a table:
08:27:52DemosCREATE TABLE t (bin BLOB, name TEXT);
08:29:00DemosI can't do db.exec(sql"INSERT INTO t (bin, name) VALUES (?, ?)", addr something, "test")
08:29:24Araqyes you can
08:29:35Araqjust not with db's current implementation
08:29:46Araqwhich doesn't make use of Nim's newer features
08:30:01Demosoh, allright. I'll look forward to that then
08:30:17Demosfor now I'm just using the low level API
08:36:40*gokr joined #nim
08:38:10DemosOOOOOoooo the type mismatch errors have become really awesome since I last used nim
09:12:26*kingofoz joined #nim
09:19:45Demosthe pragma syntax for macros does not seem to work in the latest version, although I could be screwing up my macro
09:22:30DemosI'll try and come up with a minimal test case tomorrow
09:23:05endragorShouldn't procs in streams.nim guarantee endianness or provide both LE and BE variants? As of now, the module is unusable for networking or in any case when the data can be accessed from different machines, because the format is platform-dependent.
09:25:03flyxDemos: pragma syntax is used in emerald tests and they work at least in 0.14.0: https://github.com/flyx/emerald/blob/devel/test/basics.nim
09:27:16Demoshm maybe its just when they are on types
09:39:43Araqthe AST changed for these
09:39:50Araqdo you use getType()?
10:04:23Demosno
10:04:58*gokr quit (Ping timeout: 252 seconds)
10:16:16Araqhmm
10:23:10*gokr joined #nim
10:50:25*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:56:14*xet7 joined #nim
11:05:23*Nimian joined #nim
11:05:50NimianHello guys!
11:06:51PMunchHi Nimian
11:10:02NimianPMunch: What's up?
11:10:24PMunchNot much, trying to migrate a server
11:10:33PMunchYou?
11:11:14NimianTranslating Nim tutorials to Arabic, Kurdish and Persian
11:11:36PMunchOh nice
11:11:44cheatfatePMunch, you are talking with bot...
11:12:00PMunchI am?
11:12:12cheatfatePMunch, yep
11:12:15PMunchThat's a good bot then :P
11:12:37PMunchAnd why does it say it's translating tutorials?
11:13:34cheatfatePMunch, because somebody programmed it :)
11:13:40*elrood joined #nim
11:13:52NimianPMunch: It's not bad at all.
11:14:31cheatfatePMunch, this "tutorials translation" monolog was yesterday already
11:14:55Nimianwhat do you mean, cheatface?
11:15:21PMunchHaha, it even has spelling mistakes? That's pretty good
11:15:53cheatfatedom96, could you please ban the whole network 93.91.194.0?
11:15:55NimianI like to call him cheatface.
11:16:08NimianWhy?
11:17:09Nimiancheatface: I lied about something, I don't really have master degree, I'm just an IT diploma student (year 1)
11:17:30M-FloxHi Nimian
11:17:42NimianHello M-Flox!
11:17:49NimianWhat's up?
11:17:57M-FloxNimian: How are you?
11:18:15NimianI'm fine thanks, and you?
11:18:44M-FloxNimian: Good, thanks. What's the weather like?
11:19:30NimianM-Flox: I think your are cheatfate, but you are registered another account in this channel?
11:19:35NimianAm I right?
11:19:44NimianBecause I have that fellling?
11:20:17M-FloxNimian: I am not cheatfate
11:20:45*chemist69 quit (Ping timeout: 260 seconds)
11:20:54NimianM-Flox: Okay, I said that because cheatfate wanted to fool me.
11:21:24NimianM-Flox: I'm in Kurdistan, the weather is very hot,
11:21:40NimianM-Flox: We are also fasting in Ramadan month.
11:22:03M-FloxI have a feeling cheatfate is behind the bot typing
11:22:43*chemist69 joined #nim
11:22:44NimianM-Flox: If I say anything offensive, my fasting won't be accepted.
11:24:29NimianM-Flox: Would you like to know why I do care of Nim?
11:24:46M-FloxAhm, not really :-)
11:26:29NimianM-Flox: Just like I said, I cannot say offensive stuffs while I'm fasting.
11:27:02NimianThe rulse are rules and business is business.
11:30:48NimianI have a question
11:31:05NimianAny Nim developers here?
11:32:12NimianHello?
11:33:14AraqI'm here.
11:33:52NimianAlright, my question is, when I'm on Windows, should I compile to C or C++? because as we know, Windows API is written in C++.
11:34:14NimianOhh! Hi Araq!
11:34:32Araqto C.
11:34:56NimianMay I know why?
11:36:03Araqwindows exposes a C API and the C++ codegen still has some issues wrt c++'s const
11:36:10flyxthe Windows API is C, not C++. MFC is C++
11:38:01Nimianflyx: It's both C and C++
11:38:11NimianBut the C codes are more than C++
11:39:35flyxafaik there is no C++ in the Windows API. please provide an example.
11:39:56NimianI don't know actually, just like I said, I'm just a student at an IT diploma (2nd year)
11:40:20elrooddon't feed the troll, guys
11:40:35Nimianelrood: I lied about master degree.
11:40:38NimianSorry
11:41:46Nimianelrood: But I'm still sure that Nim is not a real compiler.
11:42:25elroodyou have quite competently and thoroughly disqualified yourself on your earlier visits, and as a consequence i couldn't care less what you do or don't say, or believe, or whether you're sorry or not
11:42:55*flyx seems to miss some of the background story here
11:43:17Araqdamn it. stop it. I don't want to moderate this channel.
11:43:26NimianOkay
11:44:11NimianAraq: calm down, I never seen you like this anger
11:44:31*yglukhov quit (Ping timeout: 252 seconds)
11:48:37NimianAraq: As you know many major languages have International standard(s) from ANSI, ISO and/or ECMA. Will Nim have one?
11:49:33NimianFor example, C++11, C++17 (upcoming), Single Java Specification etc...
11:51:31NimianWould anyone answer my question?
11:52:16*SchaffGeischd joined #nim
11:52:19*SchaffGeischd left #nim (#nim)
11:52:21*SchaffGeischd joined #nim
11:52:55NimianWelcome Shafdhuwdh3d
11:53:50NimianCan anyone answer my question
11:54:18AraqNimian: the manual evolves into a proper spec
11:54:49NimianAraq: Am talking about international standard (a big stuff)
11:54:56*PMunch quit (Ping timeout: 244 seconds)
11:55:51NimianAraq: Like standards from ISO, ANSI, ECMA etc...
11:56:17M-Floxsigh
11:56:17NimianAraq: How can we get a standard?
11:58:01NimianM-Fox: How many times I have to tell you that I'm fasting?
11:58:42*Araq2 joined #nim
11:59:06NimianHello Araq2! Welcome to the Nim IRC channel!
11:59:24Araq2Thank you Nimian.
11:59:40NimianYou are welcome Araq2
12:00:33NimianMay I ask why in the earth you named yourself Araq2?
12:00:39*PMunch joined #nim
12:00:56Araq2I like Mr. Araq. That's why
12:01:15NimianNP (No Problem)
12:01:32gokrSo is this a bot or what?
12:01:40flyxthey have the same IP.
12:02:04NimianI think it's the same person.
12:02:20NimianI mean he is the same person.
12:02:27*nsf quit (Quit: WeeChat 1.4)
12:02:41*heretobang quit (Ping timeout: 250 seconds)
12:03:53NimianLet me ask you a question Araq2, why Nim language is so good?
12:03:58flyxanyway, can we please just ban him. this is getting ridiculous
12:04:19Nimianflyx: what I have don?
12:04:29NimianI just asking him questions.
12:04:52NimianHe is the only one who answers me. he is the best helper here.
12:06:59dom96Guess we need more mods.
12:07:18cheatfatedom96, you need to ban whole 93.91.194.0
12:07:26dom96cheatfate: ok
12:07:42dom96I hope that will work
12:08:03gokrOops, there went half our users... ;)
12:08:39dom96Hope not
12:08:48dom96I'll likely remove it after a while
12:08:52gokrThat would've been scary - if it turned out half of us are bots ;)
12:08:52dom96the troll will forget
12:09:04dom96I don't know why you guys think that that was a bot though
12:09:15dom96It was simply a human trying to troll.
12:09:30gokrSomeone said so - but... I agree, it seemed slightly too sophisticated. not sure.
12:10:37cheatfatedom96, just because human dont like to talk with bots and start to ignore it...
12:10:43cheatfatetill moderators kick him
12:10:55elroodAIs write movie scripts these days, you never know ;) thanks, dom
12:13:29dom96https://twitter.com/polyconfhq/status/742322383722151936
12:14:55cheatfate`nim async voodoo` what does it mean? :)
12:17:33dom96I think he will talk about how my async macro converts ordinary procedures into iterators.
12:17:58*Demon_Fox quit (Quit: Leaving)
12:41:51*WW_ joined #nim
12:42:05WW_Is NimEdit open source?
12:42:25*SchaffGeischd left #nim (#nim)
12:43:20WW_Is NimEdit open source?
12:43:50WW_Hello??
12:44:08dom96WW_: no
12:44:18*bjz_ joined #nim
12:44:19dom96WW_: Be patient with your questions.
12:44:43WW_dom96: excuse me, what do you mean?
12:45:04dom96WW_: I mean, don't repeat your question. Ask it and wait.
12:45:47WW_dom96: sorry, but I cannot wait, so please excuse me.
12:46:03*bjz quit (Ping timeout: 240 seconds)
12:47:09WW_dom96: when will your amazing book be complete?
12:47:23WW_I mean all chapters.
12:48:30dom96WW_: No idea. Estimate is early 2017 (completely finished, so printed too)
12:49:23WW_dom96: why did you kik me? I love Nim more than anyone else, even Mr. Andreas Rumpf.
12:50:39dom96WW_: Ah, so you're the same person. I kicked you because you were causing trouble.
12:51:31WW_I'm also BP (from Nim forum)
12:52:52WW_But dom96, for real, I love Nim more than anyone else.
12:52:59WW_I want to create a state-of-at operating system i entirely in Nim and assembly languages.
12:53:11WW_**state-of-art
12:58:00dom96Great. Why are you coming in here to argue then?
12:58:02*yglukhov joined #nim
12:58:40*WW__ joined #nim
12:59:27WW__dom: when Nim 1.0 will be released exactly?
12:59:46*WW_ quit (Ping timeout: 250 seconds)
13:00:41*WW__ quit (Client Quit)
13:01:46*kteza1 joined #nim
13:04:33kteza1Hi. Very new to nim. What am I doing wrong here --> http://pastebin.com/TnuP1vSF
13:04:50kteza1protocol.nim(31, 45) Error: type mismatch: got (int literal(32)) but expected one of: proc encodeRemainingLength(length: var int): int
13:04:56*WW_ joined #nim
13:05:06kteza1That's the error I'm facing
13:05:51WW_because I exited
13:05:52WW_Dom can you repeat your answer
13:06:56flyxkteza1: your pasted source does not seem complete, it does not contain 31 lines.
13:08:09kteza1@flyx Sorry. I didn't paste entire code. Error is at line 14 in pastebin
13:09:12flyxkteza1: ah okay. problem is that `length` is a `var int`, i.e. it has to be modifyable. but you pass `32`, an int literal, which is not modifyable
13:10:08flyxkteza1: you probably have assumed that `var` just enables you to change the value within the proc, but it is actually used to modify the value given by the caller
13:11:47kteza1Ahh. all the 'var's are pointers then?
13:12:24flyxproper term is „call by reference“
13:13:09flyxit does not necessarily have to be implemented as pointer, though it probably is (I do not know about the implementation details)
13:13:35kteza1Ok. But I'm not able to modify length by declaring it like this --> proc encodeRemainingLength*(length: int): int =
13:13:43kteza1with our 'var'
13:13:56flyxyes. you should copy it to a local var and modify that
13:14:18flyxmodifying by-value parameters is considered bad practice even in languages that allow it
13:14:57kteza1Hmm. Is shadowing allowed? (like rust)
13:15:34kteza1I guess it is
13:15:43flyxnot sure if Rust does something special about it, but yes, it is possible in Nim
13:19:13kteza1@flyx Also I tried changing 'length' to uint64 and mod operation is failing (coz it is expecting int)
13:19:23kteza1endocedLength = length mod 128
13:19:55kteza1Error: type mismatch: got (uint64) but expected 'int'
13:20:18kteza1Why isn't mod accepting uint64?
13:21:22kier'128' is an integer literal of type int. to make it a literal of type uint64 you can add the 'u64' suffix (like '128u64')
13:21:43kierbut i'm not certain if mod is implemented on uint64 anyway
13:21:58*arnetheduck joined #nim
13:22:10flyx`length mod 128'u64` will work if length is uint64
13:22:36flyxwhile `length mod 128` will not work because there is no `mod`(x: uint64, y: int)
13:23:47arnetheduckhey Araq, saw you merged ansi_c, everything ok so far?
13:23:57flyxkier: http://nim-lang.org/docs/system.html#mod,T,T
13:24:33kierah yeah just spotted that
13:25:04kierthough am I right in thinking that there are a few operations that aren't implemented on uint/uint64 (but are on the other integer types)
13:26:44*elrood quit (Quit: Leaving)
13:27:12kierah I'm thinking of the fact that uint/uint64 aren't ordinals
13:27:36flyxyeah, that's https://github.com/nim-lang/Nim/issues/2613
13:31:24*WW_ quit (Ping timeout: 250 seconds)
13:32:07kteza1@flyx @kier All well now. Thanks :). But I had to case 0 to u64 as well at line 8 here --> http://pastebin.com/TNchKViq
13:33:11kteza1Wouldn't code become too verbose if I keep doing that? I there an alternate to this?
13:33:18kteza1cast*
13:34:35flyxkteza1: all numeric literals without explicit type suffix are int and suffer this problem. there's no easy way around it
13:34:56flyxbut you could, for example, write a template like this:
13:35:40flyxtemplate `>`(x: uint64, y: int): bool = x > uint64(y)
13:36:29flyxthere's an issue about implicit conversion here: https://github.com/nim-lang/Nim/issues/936
13:36:34renesackteza1: https://github.com/nim-lang/Nim/issues/936
13:36:41renesacyep
13:37:46renesacthe alternative is to avoid usnigned types in nim..
13:38:38kteza1Ok. Thanks @flyx @renesac
13:46:05*Anonymous joined #nim
13:46:28*Anonymous is now known as Guest46869
13:46:53Guest46869Where can I get a high-quality Nim logo?
13:47:37*BitPuffin joined #nim
13:48:55*yglukhov quit (Ping timeout: 260 seconds)
13:49:51PMunchGuest46869, a print version or just high-res?
13:50:01renesacflyx: I wonder if there is any side effect of putting https://github.com/nim-lang/Nim/tree/devel/web/assets/images
13:50:03renesacops
13:50:04renesachttps://github.com/nim-lang/Nim/tree/devel/web/assets/images
13:50:34*nsf joined #nim
13:50:53renesacflyx: I was going to ask whether any of those templates could be put in the standard library to ease some of the pain of working with unsigend
13:51:20*Guest46869 quit (Ping timeout: 250 seconds)
13:51:55renesacI was trying for u32 and the uint32() don't seems to truncate the input like a cast, I'm not sure
13:52:05renesac*uint32 seems to
13:53:03flyxrenesac: well, that's a question Araq would need to answer.
13:53:28renesacthe bitwise operations are the most complicated
13:53:39renesacmaybe we should just ignore them for now
13:53:57renesacand fix some of the rest
13:53:59*yglukhov joined #nim
13:54:37renesacthere is no problem in upconverting to uint64 for boolean operations
13:54:39renesacfor example
13:55:30flyxdunno, wouldn't that mean that `length > -2` would raise a runtime error?
13:55:39flyx(assuming length is uint64)
13:56:50renesacno error of any type
13:57:35renesacit seems to cast the integer value to unsigned one
13:57:50renesacops
13:57:53renesacthat was with a proc
13:58:12renesacwith a templete I get a compile time error: Error: conversion from int literal(-2) to uint32 is invalid
13:58:31flyxuh, that's nice
13:58:32renesaccurious...
13:58:56renesacshould the proc beehaviour be differnt?
13:59:09flyxum
13:59:26flyxso why does uint32(-2) raise a compile-time error, but uint64(-2) doesn't?
14:00:29flyxthe proc must handle a parameter that may have different values, so it cannot check its value at compile time. the template just rewrites.
14:00:39*saml joined #nim
14:01:05renesacand at runtime, even in a debug build, it don't complains and just casts...
14:01:23flyxso the proc behaving in a different way makes sense to me. but uint32(-2) being handled differently than uint64(-2) does not.
14:01:51renesacI'm not able to reproduce that second thing as I'm getting a weird type mismatch here
14:02:11flyx`echo uint64(-2)` works for me. `echo uint32(-2)` does not.
14:03:04renesacstrange, I had to manually convert uint32 to wuint64
14:03:10renesacit didn't implicitly convert there
14:03:18renesac*uint64
14:03:58renesacbecause 18446744073709551614 fits in a uint64, but not in a uint62...
14:04:17renesac*32
14:05:03renesacI'm not sure if this behaviour is intended though..
14:12:18flyxrenesac: I would agree that this is the reason if the output would be the same as the output for uint32(18446744073709551614). but it's not.
14:13:07*flyx is afk for some time
14:19:07*michael_campbell joined #nim
14:19:12*lazypenguin1 joined #nim
14:19:47renesacflyx: at least both fail when not inside a proc
14:20:33renesac*not working with proc arguments
14:22:51*gokr quit (Ping timeout: 276 seconds)
14:22:59Araqyeah for the next release I intend to fix every remaining 'unsigned' bug
14:23:15*lazypenguin quit (Killed (asimov.freenode.net (Nickname regained by services)))
14:23:16*lazypenguin1 is now known as lazypenguin
14:23:23AraqI think this means to introduce more type conversion rules
14:23:37*btbytes joined #nim
14:24:01*Guest56550 joined #nim
14:25:07*desophos joined #nim
14:29:57renesacyay! If this means at least that literals will get automatically converted to the proper uint, I will be very happy
14:30:51renesacalthough it still would be good to have some implict conversions from small uints to int for interfacing with the rest of the language functions easier...
14:32:51dom96+1 on implicit unsigned conversions
14:39:53*btbytes quit (Quit: Textual IRC Client: www.textualapp.com)
14:40:18*btbytes joined #nim
14:41:31michael_campbellWhy does this work: let z = {1..3}, but this does not? var x: set[int16]; x = {1..3}? I get:
14:41:32michael_campbellError: type mismatch: got (set[range 0..65535(int)]) but expected 'set[int16]'
14:41:47michael_campbelluser error I've no doubt, just not sure where I've gone wrong
14:42:12michael_campbell(the var example is on 2 lines; just put it on one for brevity)
14:42:21Araqthe compiler is picky about the 'convertible' relation
14:43:07michael_campbellWhat is the correct way to declare a var of type set, and fill it out later (other than 1 element at a time)?
14:43:19Araqtry x = {1i16..3i16}
14:43:55michael_campbellsame. Both with 1i16 and 1'i16
14:43:57michael_campbell(on both ends)
14:44:35michael_campbellPushing values into the set piecemeal works.
14:45:08michael_campbellAm enjoying the Nim in Action MEAP so far, by the way.
14:45:28*PMunch quit (Quit: leaving)
14:48:05Araqx = {1i16..3i16} needs to work, report it please
14:48:46michael_campbellWill do; on github?
14:49:12*elrood joined #nim
14:51:42Araqyes
14:55:21*btbytes quit (Quit: Textual IRC Client: www.textualapp.com)
14:57:10*xet7_ quit (Ping timeout: 260 seconds)
15:04:08*pregressive joined #nim
15:04:48endragorAraq: dom96: I'm working on intergrating nimue4 with Nimble (so that people can use Nimble packages in UE4 projects). The last piece is that Nim prefixes compiled .c/.cpp filenames with the package filename. I'd like to override that so that no prefix is added for the main package that is being built. Would it make sense to add such flag to Nim? An alternative way is to add nimble command that installs dependencies and lists out their paths. In
15:04:48endragor such case, I could manually invoke Nim with those paths, discarding the .nimble file for the main package. Which approach is better?
15:07:48Araqnot sure, but why are the prefixes unwanted?
15:09:15namnguyenis there a flag to force c++11?
15:10:05endragorAraq: the integration has to mess with the generated files (specifically, create proper .h files) and some macros rely on the .cpp filenames being the same as .nim filenames
15:10:59michael_campbellAraq, I was mistaken.
15:11:07namnguyenahh passC
15:11:09michael_campbellvar x: system.set[int16] <newline> x = {1'i16..3'i16} does work
15:12:18michael_campbellIs there a reason I have to specify "system.set[int16]"? The examples don't have it, but I get this error if I don't: "set.nim(1, 8) Error: Error: ambiguous identifier: 'set' --use system.set or .set"
15:12:35michael_campbellAm I not importing something that I should be?
15:14:35Araqmichael_campbell: name your file to something that doesn't clash with system.set
15:14:44Araqthe filename is used as the module name.
15:14:54AraqI dunno why everybody stumbles over this.
15:15:06michael_campbellAh hah! Of course; thanks
15:15:50dom96endragor: can't you edit the macros so that they look for the different filenames?
15:16:13michael_campbellIt's probably my noobness, but it wasn't clear that the filename is the module name (from the tutorial; the ref-man may say it more explicitly), and I haven't gotten that far in the MEAP yet.
15:16:21michael_campbellDo you guys take PR's for the tutorial?
15:16:38Araqsure
15:16:48michael_campbellBut even after that, I didn't put 2 and 2 together about the module name vs. system types - thanks for htat.
15:17:09Araqthe error message seems broken
15:17:17Araq"or .set "?
15:17:23Araqthat makes no sense.
15:17:25michael_campbellI was wondering about that too.
15:17:43namnguyenhmm, clib:ABC is prefixed with the current directory to -l/path/to/cwd/ABC
15:17:54michael_campbellMaybe if Nim were a *REAL* compiler.... (I kid, I kid - I was watching the shitshow from EEE yesterday)
15:18:04namnguyenis that intended? what's the use of -l/path...?
15:18:05endragordom96: the macros are invoked during the project compilation phase, they don't know about the nimble package. or is the package name provided to the Nim program in some way?
15:18:59dom96endragor: it will always be your package name
15:19:23endragormacros are part of the library, they don't know about package names of users
15:19:48dom96as in, if nimue4 includes ue4.nimble then it will prefix with ue4_file.cpp
15:20:04dom96*prefix with ue4_ ending up with ue4_file.cpp
15:21:38endragordom96: yes, I understand. I'm talking about packages (UE4 projects) that use macros from nimue4. those macros have no way to know the package name that invokes them
15:22:55dom96oh
15:25:30Araqnamnguyen: it's indented but I don't know if it's wise
15:25:55dom96endragor: how do your macros know what the names of those packages' files are?
15:26:00namnguyenAraq, what was the use case that called for it?
15:26:18Araq"consistency".
15:26:36Araqpeople always report when it's "inconsistent"
15:26:45endragordom96: using lineinfo proc from macros module
15:26:48Araqapparently it's better to be consistent than to be useful ...
15:27:18namnguyenwith cincludes, i guess?
15:27:46namnguyenbut the doc does say that clib:NAME where NAME is a name of the lib, not the path.
15:28:04AraqI have no idea what clib does.
15:28:14dom96endragor: then perhaps the best solution would be to ask Araq to include the .cpp/.c filenames in the lineinfo output
15:28:15Araqadds something to link?
15:28:19namnguyen--clib:LIBNAME link an additional C library (you should omit platform-specific extensions)
15:28:40namnguyenyes, it adds some libraries to link command.
15:28:55namnguyenthe workaround is to use passL:"-lLIBNAME"
15:28:56dom96endragor: or maybe via some system proc like getPackageName
15:28:59endragordom96: I think it would not be good for that procedure. It is supposed to return .nim filename
15:29:05Araqyeah, I always use the workaround
15:30:18Araqdom96, endragor yeah that cannot work, the frontend doesn't even know about how the file will be named
15:32:22endragorwell, since I already mess with generated files after Nim, I guess I could simply rename those prefixed with the nimble package name.
15:40:14Araqtrue
15:47:01michael_campbellIs `echo("foo")` any more or less idiomatic than `echo "foo"`? MEAP uses the parens, tutorial does not.
15:47:04*NimIsNotARealCom joined #nim
15:47:37*arnetheduck quit (Ping timeout: 252 seconds)
15:48:56NimIsNotARealComWhere is Nim's official office?
15:48:58lazypenguinmichael_campbell, from the docs "The expression x in x.f needs to be semantically checked (that means symbol lookup and type checking) before it can be decided that it needs to be rewritten to f(x). Therefore the dot syntax has some limiations when it is used to invoke templates/macros:"
15:49:17lazypenguinnot sure how that affects echo "foo" however
15:49:26lazypenguinbut there might be similar
15:49:53michael_campbell"foo".echo also works, which I found fun.
15:50:02michael_campbellUFCS... I kind of dig it.
15:50:04NimIsNotARealCom?
15:50:09NimIsNotARealComAraq: where is Nim's official office
15:50:42michael_campbell<3 that `if` and `case` are expressions.
15:51:08NimIsNotARealComWHERE IS NIM'S OFFICIAL OFFICE?????
15:51:18Demosyo: so w.r.t the winapi.
15:51:22Demosthe winapi itself is in C
15:51:31Demoshowever some components are exposed using COM
15:51:38DemosCOM is not C or C++
15:51:43AraqNimIsNotARealCom: in Mecca.
15:51:44michael_campbellMan, that due has a jihad.
15:51:49michael_campbells/due/dude
15:52:04Demosand in fact defineing C_INTERFACE before importing a COM header will expose a (slightly nonstandard) C interface
15:52:05lazypenguinhaha was that the EEE_ guy? Guess you guys changed your mind on ban policy?
15:52:39dom96nah, ban policy is still the same: Don't ban until you have no other choice.
15:52:58michael_campbellI guess only real compilers have offices. <shrug>
15:53:05*Demos quit (Read error: Connection reset by peer)
15:53:11*michael_campbell wishes he had an office.
15:53:36*J3RN too, wishes for an office
15:53:45*pandada8 quit (Ping timeout: 260 seconds)
15:54:25michael_campbellMy "office" is one of those open office layouts; it's the worst thing ever. It's neither collaborative nor private.
15:55:12michael_campbellAnd it's a cesspool of bacteria; since we moved to it we have a lot of "out sick" that we didn't before.
15:55:20*NimIsNotRealComp joined #nim
15:55:30lazypenguinhah
15:55:33lazypenguinwelcome back
15:55:35NimIsNotRealCompWhere is Nim's official office?
15:55:43NimIsNotRealCompThanks lazy.
15:55:59NimIsNotRealCompThey cannot beat my VPN
15:56:46NimIsNotRealCompWHERE IS NIM'S OFFICIAL OFFICE?
15:56:58lazypenguinWhy do you ask?
15:57:06NimIsNotRealCompI don't know.
15:57:17namnguyen<Araq> NimIsNotARealCom: in Mecca.
15:57:23namnguyenyou happy now?
15:57:36NimIsNotRealCompWhat a beautiful paradism.
15:57:54NimIsNotRealComp**Paradise
15:58:34namnguyenokay. great. now sit tight.
15:59:09dom96*sigh*
15:59:53lazypenguinWish I had that much free time
16:04:57*CC-BY-SA joined #nim
16:05:00CC-BY-SAds
16:05:00CC-BY-SAc
16:05:01CC-BY-SAsdc
16:05:02CC-BY-SAfd
16:05:03CC-BY-SAbtr
16:05:05CC-BY-SAbregdb
16:05:07CC-BY-SAfd
16:05:07CC-BY-SAbfd
16:05:07CC-BY-SAcsd
16:05:07CC-BY-SAds
16:05:07CC-BY-SAc
16:05:08CC-BY-SAbfd
16:05:08CC-BY-SAvbrd
16:05:08CC-BY-SAsdf
16:05:08CC-BY-SAv
16:05:09CC-BY-SAdr
16:05:09CC-BY-SAtr
16:05:10CC-BY-SAh
16:05:14*CC-BY-SA quit (Excess Flood)
16:06:02*lazypenguin quit (Ping timeout: 244 seconds)
16:06:02*lazypenguin1 joined #nim
16:06:41dom96lol
16:07:18*lazypenguin2 joined #nim
16:07:18*Mark___ joined #nim
16:07:35Mark___You are kiking me just because I'm muslim???!!!
16:07:42dom96Mark___: Not at all.
16:07:55Mark___So why you are kiking me?
16:08:03dom96Mark___: Because you are spamming
16:08:14Mark___Okay, am gonna stop
16:08:45dom96Mark___: Why are you doing it?
16:09:34Mark___What I want from you Mr. dom96 is that when I was in Nim forum (BP), I offensivly replied your comments. I'm sorry, can please forgive me for that?
16:10:21dom96Mark___: Of course I can
16:10:45*lazypenguin1 quit (Ping timeout: 276 seconds)
16:10:59Mark___Thanks, becuase if you can't, then my fasting may not be accepted.
16:11:47*lazypenguin2 is now known as lazypenguin
16:12:29*PMunch joined #nim
16:15:12*Mark___ quit (Ping timeout: 250 seconds)
16:18:01*yglukhov quit (Ping timeout: 240 seconds)
16:20:22*pandada8 joined #nim
16:25:32lazypenguinHey guys, any reason why dnylib is preferable over header?
16:25:55*akaisora joined #nim
16:26:23namnguyenlazypenguin, i guess because at runtime, you can use the system-provided dynlibs.
16:26:51namnguyenwhere as with a header, you will have to compile the static library, and build that in with your executable.
16:28:40*chemist69 quit (Ping timeout: 264 seconds)
16:28:50*akaisora quit (Remote host closed the connection)
16:30:40*chemist69 joined #nim
16:35:37michael_campbellI'll dig a little deeper, but is there any way to get a statically linked output other than passL and knowing a fair bit about how gcc does this?
16:36:29michael_campbellOne big advantage of golang here, for running inside docker anyway, is by-default statically linked bins without a lot of extra fuss.
16:37:37lazypenguinYes that's something i'd like to know more about as well. Looking to create a binding for a C library but would rather it statically compile vs shipping with dynamic libs
16:38:05*endragor quit (Ping timeout: 260 seconds)
16:39:59namnguyenlazypenguin, --app:staticlib
16:41:44namnguyenmichael_campbell, ^
16:44:02lazypenguinExcuse my lack of knowledge here, but is it possible to statically compile a library that is linked to a dynamic libarary? myNimLib -> someDnamicLib.so
16:45:23namnguyenlazypenguin, no sir. unles you do it yourself in code.
16:45:26namnguyenunless*
16:45:53namnguyenwhich is very possible with macros
16:46:03namnguyentell me more about your need though.
16:46:54namnguyenyou have code for the static liba.a and the dynamic libb.so, and you want to create libc.a that dynamically links to libb.so?
16:50:22lazypenguinHave source for clib, want to create nim bindings nimlib for clib. Looking to ship nimlib as static library. I'm thinking the only way to have users use nimlib statically is to download and compile clib static lib first?
16:50:40namnguyenyep.
16:51:06*Box_Jellyfish joined #nim
16:51:30lazypenguinIn your opinion, is that method preferred over porting the lib to nim (since source is available)?
16:53:43namnguyenlazypenguin, are you going to maintain the binding for a long run?
16:54:23*desophos quit (Read error: Connection reset by peer)
16:55:16lazypenguinIs the implication that maintaining bindings to match new versions is more work vs. initial port to nim can be useable indefinitely?
16:55:17*Jesin quit (Quit: Leaving)
16:56:09michael_campbellnamnguyen, that only *makes* a "libfoo.a". I'm looking to make a statically linked binary.
16:56:19*mal`` quit (Ping timeout: 244 seconds)
16:56:21michael_campbellnot a lib
16:56:49namnguyenmichael_campbell, have you tried it?
16:57:42michael_campbellyes, it creates a "libclient.a" from "client.nim".
16:57:57michael_campbellwhat I want is "client", but a staticly linked bin.
16:58:03*GangstaCat joined #nim
16:58:08namnguyenhmm, on my setup, it creates a static binary.
16:58:19michael_campbellI.e., not this -=> "chat: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=9e9e3513023db8c04debc1e22222619bcd37700f, not stripped"
16:58:41lazypenguin--passL?
16:59:00namnguyenELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24
16:59:02michael_campbelllazypenguin, sure, but not sure what options to pass.
16:59:34namnguyenmichael_campbell, do a ldd on that binary
16:59:36*Jesin joined #nim
16:59:40lazypenguinHaven't tested but wouldn't --passL:mylib.a work?
16:59:43namnguyenso what libraries are dynamic
16:59:59michael_campbell linux-vdso.so.1 => (0x00007fffb3ea1000)
17:00:00michael_campbell libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa1e409c000)
17:00:00michael_campbell libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa1e3e98000)
17:00:00michael_campbell libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa1e3ad2000)
17:00:00michael_campbell /lib64/ld-linux-x86-64.so.2 (0x00005605a1b03000)
17:00:01namnguyenand make sure you have all those static libraries
17:00:11michael_campbellThen pass them to --passL?
17:01:19namnguyenso you'll need -lm for the math library
17:01:24namnguyendl is automatically added
17:02:01namnguyenso, yea, the only thing i know is libm is probably not a static library
17:02:15namnguyenthe rest looks standard to me.
17:02:35namnguyendo you have libm.a in your system?
17:02:44michael_campbelllooking
17:03:43lazypenguinshould be /usr/lib/x86_64-linux-gnu/libm.a if you are on debian based
17:04:25michael_campbellYup. /usr/lib/x86_64-linux-gnu/libm.a
17:04:27namnguyenhttp://pastebin.com/k1H1TYiw
17:04:49namnguyenthat's the command i used to create static binary.
17:05:16michael_campbellGotcha, thanks. What happens if you take out the app:staticlib?
17:05:22lazypenguinyou get a binary
17:05:27namnguyenmichael_campbell, it created a dynamic dinary
17:05:30namnguyenbinary
17:06:05michael_campbell"staticlib" seems oddly named to me, then.
17:06:18michael_campbellIt DOES create a lib for me when used; I wouldn't expect it to create a bin.
17:06:30lazypenguinwhy is it oddly named?
17:06:36lazypenguinit produces a static library
17:06:44michael_campbellbecause it creates a lib.
17:06:58michael_campbellbut for namnguyen it creates (also) a binary.
17:07:03namnguyenmichael_campbell, is libclient.a really an archive file?
17:07:20michael_campbelllibclient.a: current ar archive
17:07:21namnguyendoes it not create anything else?
17:07:52namnguyenso it does create a static library for me too. but there's the static binary in addition to that.
17:08:05michael_campbellfor me it creates JUST the lib
17:08:10michael_campbell0.14.2
17:08:24michael_campbellthe source file is just import os and an echo
17:08:40michael_campbellusing: nim c --app:staticlib client.nim
17:08:49namnguyenerm, hold on
17:08:57namnguyeni might have done something differently.
17:09:09michael_campbell(and of course nimcache)
17:09:11namnguyeni removed the genarated files and ran my command again
17:09:21namnguyenno binary is created.
17:10:04namnguyenokay. try this: --passL:-static
17:10:10*jjido joined #nim
17:10:11namnguyenand sorry for the confusion
17:10:55lazypenguinI'm still struggling to decide to port library vs create binding
17:11:24michael_campbellThat seems to work namnguyen , but I get this in the output as well: /home/mcampbell/projects/nimchat/src/nimcache/stdlib_system.o: In function `nimLoadLibrary':
17:11:24michael_campbellstdlib_system.c:(.text+0xd7e7): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
17:11:29*akaisora joined #nim
17:11:29namnguyenlazypenguin, it all boils down to whether you want to maintain your binding for a long time.
17:11:56michael_campbellbut I do get a static binary that runs
17:12:01namnguyenmichael_campbell, it's usually okay.
17:12:06michael_campbellCool, thanks.
17:12:11namnguyenyw
17:12:29lazypenguinnamnguyen, so you are saying that bindings require more maintenance?
17:12:47namnguyenlazypenguin, less than porting.
17:13:12namnguyenwhen upstream changes, the port needs to be patched too, but the binding probably only needs a recompilation.
17:17:55lazypenguinsure, I'm just trying to figure out how to make it easiest for downstream
17:24:05*yglukhov joined #nim
17:24:45*Matthias247 joined #nim
17:26:16*Box_Jellyfish quit (Ping timeout: 250 seconds)
17:26:18*desophos joined #nim
17:28:14kteza1This might be the most frequently asked question (sorry. new user here). Is 1.0 planned before the end of this year?
17:28:52namnguyenkteza1, as far as i know, 1.0 is planned for "when it's ready".
17:29:24lazypenguinalright namnguyen, i'll go down the binding route. Will leave it up to the user to compile static libraries for the lib
17:30:47namnguyenlazypenguin, or they can use their own dynamic library too, just like the Nim binding to IUP.
17:31:04kteza1namnguyen. No estimates then. Ok
17:36:33*jjido quit (Ping timeout: 240 seconds)
17:46:23*alberti quit (Read error: Connection reset by peer)
17:54:18*mal`` joined #nim
18:00:44*akaisora quit (Read error: Connection reset by peer)
18:04:44*akaisora_ joined #nim
18:07:23*M-Flox is now known as M-Flox1
18:07:42*M-Flox1 is now known as Flox42
18:14:28*Google joined #nim
18:14:52*Google is now known as Guest8241
18:20:29Guest8241Araq: I think there is only one task remains for 1.0, am I right?
18:20:53Araqwhat would that be?
18:23:59*vendethiel joined #nim
18:24:42*akaisora_ quit (Remote host closed the connection)
18:24:46*Guest8241 quit (Ping timeout: 250 seconds)
18:25:17*ubhu joined #nim
18:25:35ubhuAraq: implement static[T] properly.
18:26:01*TheLemonMan joined #nim
18:26:09ubhuThat is what written in roadmap 1.0 (on GitHub)
18:26:33AraqI need to update the roadmap :-)
18:27:43ubhuYes, Araq please never hurry, take all your time, stability is very important for certain application programs.
18:32:51ubhuAraq: NimEdit's GUI is very not nice.
18:33:13Araqafaik I never even announced it anywhere.
18:33:23Araqthere is a reason for that.
18:33:32ubhuGUI is the reason?
18:34:29Araqit has bugs and looks ugly
18:34:56ubhuIt is not ugly, IT IS THE MOST UGLIEST THING
18:36:23ubhuFor god's sake, why don't you use Qt or GTK+? these both are very good, portable, free and open source and low-level.
18:36:49*Salewski joined #nim
18:37:35dom96ubhu: stop being rude and making demands.
18:37:38AraqI have answered this question already.
18:38:33SalewskiWhen the trolls may have a short break a short question: is using paranteses () as below the recommended style?
18:38:37Salewskiif word.toLower() in pkg.name.toLower():
18:38:58AraqI don't use () here
18:39:08*endragor joined #nim
18:39:14ubhuAraq & dom: You don't know.
18:39:21SalewskiThanks!
18:39:35*Salewski quit (Client Quit)
18:40:22*kteza1 quit (Ping timeout: 250 seconds)
18:41:41dom96ubhu: what don't we know?
18:42:53ubhudom96: In your book, you said that JVM is vulnerable.
18:43:10ubhuThat is TOTALLY WRONG.
18:43:16GangstaCatubhu, we spotted you EEE/Nimian
18:43:24dom96ubhu: Why are you wasting our time?
18:43:46ubhudom96: you are teaching people wrong stuffs. you are a student, you cannot write a book and teach people.
18:43:55ubhudom96: you don't have that right.
18:44:04vktecWho says?
18:44:13*vktec looks around
18:44:41GangstaCatno need to use a VPN we got your real IP my friend :p 93.91.194.164
18:44:44lazypenguinSorry dom96, ubhu says you don't have that right so you better leave
18:45:12vktec:D
18:45:18dom96lol
18:45:22*Satyajit joined #nim
18:45:22*fredrik92 left #nim ("Leaving channel")
18:45:39ubhuvktec: How many times should I tell you GaFY?
18:45:55lazypenguinN+1 times please
18:46:41ubhudom96: You are very responsible for sending people wrong information, because one of the Java advantages is secuity.
18:47:02ubhudom96: This is one of the many things that you and araq don't know.
18:47:13vktecubhu: And this is related to Nim.... how?
18:47:15vktecXD
18:47:21lazypenguinIs there a way to mute him without him knowing?
18:47:40vkteclazypenguin: That'd be cool :D
18:47:49dom96*cough* :P
18:47:53vktecDon't think so though...
18:48:10*ubhu quit (Quit: Page closed)
18:48:46lazypenguinhe figured it out...
18:49:02lazypenguintoo bad you can't do a mac address ban
18:49:13vktecOoh, IRCv3 should implement that
18:49:33*SuperNova joined #nim
18:49:36SuperNovatr
18:49:36SuperNovavt
18:49:37SuperNovad
18:49:38SuperNovatehhv
18:49:38SuperNovatrbeu
18:49:38SuperNova6
18:49:38SuperNovaytrb
18:49:39SuperNovaytr5
18:49:39SuperNovay54y
18:49:39SuperNovab
18:49:40SuperNova6u
18:49:40SuperNovayb
18:49:40SuperNovan
18:49:40SuperNovar5
18:49:44*SuperNova quit (Excess Flood)
18:49:47vktecHahahaha!
18:49:53lazypenguinlol
18:50:00vktecDidn't even have to do anything
18:50:31GangstaCatsomeone refused his PR? is he mad? :p
18:50:53lazypenguinHe wanted everyone to admit nim compiler is not a real compile
18:51:03lazypenguinstarted lecturing everyone
18:51:08*BoxJellyfish joined #nim
18:51:14BoxJellyfishWait!
18:51:34lazypenguin:'D
18:52:02jeffc_Very 'murrican of you there Dom. Pre-emptive strike and all that
18:52:10dom96hah
18:52:24GangstaCatis that the first ban in this channel history?
18:52:41cheatfateGangstaCat, nope
18:53:06dom96nah, but it's the first time we've had a troll that was as persistent as this one
18:53:40GangstaCatno big deal, that means Nim becomes to make waves
18:53:51GangstaCatbegin*
18:53:58dom96heh yeah
18:56:09cheatfatehe using tor i think, and he is not here until he looking for irc client
18:59:36*pregressive quit (Read error: Connection reset by peer)
19:00:12*pregressive joined #nim
19:01:13cheatfateI'm looking for some help, with this https://gist.github.com/cheatfate/1984f4b759fd750d4bffaa6feeb08343
19:01:43cheatfatethere 2 functions `sendTo`, first one works like expected, but second one always make SIGSEGV on call to WSASendTo...
19:02:11cheatfatebut this SIGSEGV happens only with gcc, vcc works properly
19:03:10*BitPuffin quit (Read error: Connection reset by peer)
19:05:46Flox42Can't help directly, but when I had problems with gcc under windows it was due to thread local storage not being nicely implemented by gcc
19:06:43*shodan45 joined #nim
19:07:01cheatfateFlox42, the problem is, this code don't use threads...
19:13:11Flox42valid point
19:15:00namnguyencheatfate, just a wild goose here, is the segfault related to dealloc?
19:15:24cheatfateit happens directly on call to WSASendTo
19:15:51namnguyenbecause you have dealloc aiList
19:16:03namnguyenand the WSASendTo uses aiList.ai_addr
19:16:11*jjido joined #nim
19:16:24namnguyenwhat if you comment out the dealloc lines?
19:18:12cheatfatenamnguyen, i think i'm wrong and first function is also makes sigsegv
19:19:41*pregress_ joined #nim
19:19:42*pregressive quit (Read error: Connection reset by peer)
19:20:08*akaisora joined #nim
19:20:37lazypenguinHey guys, are const limited to 32 bits?
19:21:30cheatfatelazypenguin, on 32bit systems - yes, iirc
19:24:58shodan45anyone familiar with both nim and pony and can compare the two?
19:25:32lazypenguinthanks cheatfate, have the following in a header file and trying to come up with nim equivalent: #define MPD_RADIX 10000000000000000000ULL
19:25:36shodan45I just discovered pony, and it looks interesting.... but I can't get the compiler to build for the life of me
19:26:08lazypenguinshodan45, what error are you getting?
19:27:15shodan45lazypenguin: with pony? I got several, I tried many different environments - several different distros
19:27:50lazypenguinsounds like nim is already better....
19:28:15dom96shodan45: you might be able to get some help in #ponylang :)
19:28:43shodan45I think the closest I got was a maybe-built ponyc that always failed trying to find "ld" (no idea why, it's in $PATH, etc.)
19:28:49shodan45dom96: yeah, already tried
19:29:09shodan45trying to figure if I should just give up on it
19:29:55shodan45granted, I also had some issues getting recent distros to boot in KVM
19:33:49shodan45seems nim's approach of compiling to C at least wins the ease-of-use battle :)
19:34:17shodan45(pony uses LLVM & compiles to LLVM IR)
19:35:49dom96yeah, i've met some people who use "compilation to C" as a reason not to use Nim and I really don't get them.
19:37:26shodan45from what I could tell, pony has less flexible syntax, which frankly I prefer over nim's fairly extreme flexibility
19:38:12shodan45nim is "cooler", but I like the practicality of less flexibility
19:38:29shodan45(IMHO, of course)
19:39:52lazypenguindom96, while you seem to be around going to hijack this convo for a sec. Any recommendation for handling large numbers in C #defines. Trying to convert this C header to nim but hitting limitation of const at this line ' #define MPD_RADIX 10000000000000000000ULL'
19:41:11dom96const x = 10000000000000000000'u64 seems to work
19:41:28lazypenguinperfect, thank you
19:59:52*abruanese quit (Ping timeout: 272 seconds)
20:07:06zaquesthello. is it possible to do something like this http://pastebin.com/XHs48Xrw inherit parametrized type from non-parametrized and have working dynamic dispatching? or maybe there's a better way to achieve this than inheritance?
20:12:48Araqdon't use uint for counting
20:13:12PMunchdevlog.peterme.net/index.php?p=23
20:13:23PMunch^Wrote a little something on my implementation of TinyWM in Nim
20:14:05Araqand usually I replace inheritance and methods with closures
20:14:25Araqbut it's hard to do that for your example because your example leaves out the algorithm
20:15:23Araqan alphabet could become a simple predicate: proc (elemInAlphabet: T): bool
20:16:01dom96PMunch: awesome
20:16:05zaquestAraq, why not uint? there should not be negative counts.
20:16:33Araquse Natural then. nor should the counter wrap around ...
20:16:34dom96PMunch: the citation/reference symbols are not rendering properly for me
20:17:01PMunchHmm, those are link symbols (the text before them are links). Are you on mobile?
20:17:20PMunchHade some trouble with mobile not rendering UTF-8 symbols, I'm looking into it
20:17:30dom96PMunch: nope, Firefox on OS X
20:17:35PMunchStrange
20:18:22*pregress_ quit (Remote host closed the connection)
20:18:42dom96PMunch: Some grammar feedback: "It's not there are a lack of them", I think you need a "that" in there.
20:19:06PMunchFixed
20:19:10PMunchAnd thanks :)
20:19:12dom96also s/you/of/ later in that sentence
20:19:26Flox42zaquest: http://forum.nim-lang.org/t/1894#11846 might give you some ideas how to replace inheritance with closures and the like. It starts to get interesting with brianrogoff's post.
20:19:53PMunchCrap, had an old window open and now I reverted to a worse version of the text..
20:20:23dom96Might want to re-read the text, there are a couple small mistakes :)
20:20:39zaquestFlox42, ok, thank you
20:21:46PMunchThere, now the version is at least back to the better of the two
20:23:34*jjido quit (Read error: Connection reset by peer)
20:26:14PMunchdom96, better?
20:27:06dom96PMunch: a bit, still a couple of mistakes
20:27:54PMunchHmm, any in particular that stand out? I think I've read myself blind on this..
20:28:33*gokr joined #nim
20:28:59*vqrs quit (Quit: ZNC 1.6.1 - http://znc.in)
20:31:19*jjido joined #nim
20:32:20dom96PMunch: I'll read it and send you a list :)
20:33:12PMunchThanks, really appreciate it :)
20:33:15*shodan45 quit (Quit: Konversation terminated!)
20:34:29PMunchBe right back
20:34:53*chemist69 quit (Ping timeout: 250 seconds)
20:36:48lazypenguindoes nim have an equivalent to limits.h?
20:40:54*xet7 quit (Quit: Leaving)
20:44:29elroodPMunch, jyfi, the u+f2fe codepoint you use for your link symbol is in a private use area of unicode. might work for you, very likely won't for others
20:45:22PMunchelrood, yeah I've noticed that. I'm thinking of either specifying the font for those explicitly or using an svg of the icon instead.
20:46:04*ldleworker is now known as ldlework
20:47:41*vendethiel quit (Quit: q+)
20:47:49cheatfatedom96, i think we break asyncdispatch somewhere
20:48:59cheatfateand i think its a bug in callSoon implementation
20:49:16dom96cheatfate: why do you think that?
20:49:37cheatfatedom96, there 2 problems appears
20:50:16cheatfateFirst, do you remember this issue? https://github.com/nim-lang/Nim/issues/3909
20:50:28*jjido quit (Read error: No route to host)
20:50:41cheatfateI can't make this test anymore
20:50:44*vqrs joined #nim
20:50:52cheatfatebecause `await client.recvLineInto(lineFut) or sleepAsync(1000)` is not working anymore
20:51:20cheatfateSecond, i have implemented async udp support and wrote test for it
20:51:44cheatfatethis test is similar to test tasyncawait.nim
20:51:48cheatfateusing localhost
20:51:52*chemist69 joined #nim
20:52:11cheatfateso in this test my functions heavy used immediate completion (udp is fast)
20:52:24elroodPMunch, might make more sense to just resort to a standardized rune. there are quite a few to choose from, you should be able to find something to your liking
20:52:28cheatfatebut if on unix systems everything is ok
20:52:39cheatfateon windows i have very strange SIGSEGVs
20:52:49cheatfatefirst call is OK, second is SIGSEGV
20:53:43cheatfateI'm suspect that for some reason stored `cb` loosing its environment parameter
20:53:55PMunchelrood, any good listings?
20:55:11dom96cheatfate: perhaps it's a Nim closure bug?
20:55:19*GangstaCat quit (Quit: Leaving)
20:56:31cheatfateand my SIGSEGV happens on return from `WSASendTo()` call, assign return value to variable causes SIGSEGV
20:56:43cheatfateso somewhere stack is smashed
20:57:29elroodPMunch, your charmap utility of choice ;P
20:58:12cheatfatedom96, does anything have been changed recently in closure handling?
20:58:24cheatfatei didnt remember
20:59:18PMunchelrood, obviously :P I was thinking about a list of some of the more useful ones for this kind of stuff.
21:00:54elroodnope, sorry, unicode is a vast field. you could try http://shapecatcher.com/ though
21:03:12*cheatfate quit (Ping timeout: 258 seconds)
21:05:09*cheatfate joined #nim
21:07:08cheatfateAraq, where is callback environment is stored? is it possible so that environment's values can be smashed with some stack usage?
21:08:58*lazypenguin quit (Quit: Leaving)
21:11:25*Vad joined #nim
21:13:52cheatfateAraq, nm
21:15:39VadHello.
21:16:47elroodnot again..
21:17:49dom96Vad: Hi there, welcome to #nim!
21:17:54VadI have a nice question. Why almost all programming languages are in English?
21:18:05Vaddom96: Thanks very much.
21:18:10dom96Vad: Are you new here?
21:18:32Vaddom96: Yes, I'm new to Nim.
21:20:13Vaddom96: I can do tha forever.
21:20:14dom96Vad: You might want to try asking that question in #programming. This is a nim-specific channel.
21:20:32VadSo don't make me do that again.
21:20:51VadI can always change the IP address
21:20:55elroodfasting obviously doesn't benefit that guy
21:21:17dom96Vad: Ahh, so you lied to me.
21:21:21*akaisora quit (Ping timeout: 246 seconds)
21:22:39*Kingsquee joined #nim
21:22:42*Vad left #nim (#nim)
21:24:54*ldlework is now known as ldleworker
21:25:38*jjido joined #nim
21:25:44dom96so, anybody who's on IRC usually who would like to help with moderating this channel?
21:26:33*kteza1 joined #nim
21:27:33*Matthias247 quit (Quit: Matthias247)
21:30:53elroodperhaps it's best to just ban /*!*@gateway/web/freenode* for a few days
21:31:18PMunchdom96, I'm on here often enough to lend a hand if I see anything obvious..
21:31:43*desophos_ joined #nim
21:34:40*desophos quit (Ping timeout: 250 seconds)
21:37:11*Matthias247 joined #nim
21:38:38dom96PMunch: ok
21:38:44dom96PMunch: thanks
21:39:08PMunchNo problem, giving something back to Nim :)
21:39:51dom96PMunch: okay, you can gain +o using /msg chanserv op #nim
21:39:56dom96or just /cs op #nim in some clients
21:40:11dom96and 'deop' to get rid of it
21:40:18PMunch /msg chanserv deop #nim
21:40:26PMunchThere we go
21:40:32dom96PMunch: keep this in mind https:/​/​github.​com/​Araq/​Nim/​wiki/​IRC-guidelines
21:40:48dom96To quiet use: /mode #nim +q username
21:40:55dom96change + to - to remove it
21:41:10dom96and prefer to quiet instead of ban :)
21:41:44PMunchOkay
21:41:52PMunchKeep them quiet until?
21:42:11dom96PMunch: however long you think is necessary
21:42:23dom96people who are just downright malicious are easy
21:42:57dom96when genuine fights occur best to make it temporary
21:43:04*jjido quit (Remote host closed the connection)
21:43:11dom96between people you know are regulars here for example
21:43:22dom96But that won't happen because we all love each other right? :)
21:43:28PMunchYay :)
21:43:48PMunchHmm, that IRC-guidelines link doesn't seem to work by the way
21:43:57*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
21:44:05PMunchhttps://github.com/nim-lang/Nim/wiki/IRC-guidelines
21:44:34kteza1Hi. How do I write python bytearray like this in nim --> msg = bytearray(b"\x10\0\0\x04MQTT\x04\x02\0\0")
21:49:09dom96kteza1: just var msg = "\0x10\0\0\0x04MQTT\0x04\0x02\0\0" (I think)
21:50:05dom96PMunch: oh, and probably best not to quiet the full freenode webchat as there may be genuine people trying to connect.
21:52:16dom96afk
21:52:46PMunchOf course
21:56:24*endragor quit (Ping timeout: 272 seconds)
21:58:06kteza1@dom96 Unfortunately no. msg[1] is relulting in 'x' where as in python, it would result in 0 (The byte after 0x10)
21:59:15PMunchHmm, couldn't quite figure out a good way to add the link icons yet (currently I use an ::after tag as my editor simply inputs <a> tags). But I added some useful buttons and updated the text thanks to dom96: devlog.peterme.net/index.php?p=23
22:06:29Araqkteza1: var msg = "\x10\0\0\0x04MQTT\x04\x02\0\0"
22:09:15elroodPMunch, how do you want it to look? would changing styles.css:46 to something like content:"\2bb0"; do?
22:10:50elroodthe way you're doing it is fine, just pick a standardized rune
22:14:06*zodiak_ quit (Ping timeout: 250 seconds)
22:17:06*Trustable quit (Remote host closed the connection)
22:17:19kteza1@Araq Will check that. Thanks
22:18:04*akaisora joined #nim
22:23:53*desophos_ quit (Remote host closed the connection)
22:26:08*kteza1 quit (Ping timeout: 250 seconds)
22:27:22*desophos joined #nim
22:29:23*desophos quit (Remote host closed the connection)
22:30:21*desophos joined #nim
22:31:23*arnetheduck joined #nim
22:34:34*desophos quit (Remote host closed the connection)
22:35:51PMunchHmm elrood, 2bb0 doesn't display for me..
22:36:35PMunchAnd I just noticed that the icons for home and RSS didn't convert the glyph to a path, it simply embedded them. So they don't work either -_-
22:36:47PMunchBut I've got to go to bed now, so I'll fix it tomorrow.
22:36:55*PMunch quit (Quit: leaving)
22:37:23*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:41:45*desophos joined #nim
22:42:42*gokr quit (Ping timeout: 276 seconds)
22:43:45*desophos quit (Remote host closed the connection)
22:51:20ldleworkerI had a hard time justifying the idea that Nim is designed as an AST with a batteries included syntax
22:51:33*desophos joined #nim
22:51:40ldleworkerSince other people mentioned like, you could invent any syntax for go as long as you wrote a translator to gofmt'd structure
22:51:53ldleworkerIf anyone wanted to give their thoughts about that I'll read it
22:59:17Araqsure. you could also invent any syntax for C as long as you have a translator that generates C ... oh wait.
23:01:46*MC__ joined #nim
23:02:26MC__Hi guys.
23:05:12MC__Araq & dom96: You may ask why I'm annoying you?, well, the true answer is because I'm alone.
23:06:04vktecMC__: If that's true, then perhaps be friendly rather than annoying ;)
23:08:39vktecI think the answer to this will be no, but here goes: can I run/import Nim (preferrably not NimScript) from within Nim in a way that I can use a DSL written in Nim to configure a Nim program?
23:08:51vktecWow, that was a confusing sentence :D
23:08:58Xeyeah lol
23:09:05Xedo you mean like outside of the realm of `nake`?
23:09:11*Matthias247 quit (Read error: Connection reset by peer)
23:09:20Xebecause well
23:09:21*vktec has never heard of nake
23:09:23Xeactually
23:09:27Xei have a terrible idea
23:09:36Xean in fact
23:09:43vktecI'm all ears :)
23:09:53Xeyou could use this to allow people to write the conifugration in any language they want that can export C symbols
23:10:05*akaisora quit (Read error: Connection reset by peer)
23:10:10vktecCool
23:10:13Xeall you need is a bunch of exposed functions in C space to do all the dirty configuration work
23:10:19Xethen make nim niceness around that
23:10:43vktecSo how would I read the configuration files?
23:10:47Xejust make sure to compile your configuration as a shared object and get nim to manually load an execute that function
23:11:09Xenote: this is a bad idea
23:11:17vktecIs there a better way?
23:11:17Araqvktec: use nimscript for this.
23:11:27vktecAraq: Okay.
23:11:43Xei like the idea of a .so configuration system
23:11:49*akaisora__ joined #nim
23:11:52vktecAraq: Can you provide a code snippet to show how I'd do that?
23:11:54Araqor: instead of a program, write a library
23:12:05vktecI remember struggling with NimScript a while back
23:12:18vktecAraq: It's a per-project configuration file
23:12:25Araqpeople can import your library and the config is the main program
23:12:28vktecSo that's not ideal
23:12:38Xewe really need to write ffi support for the nimrodvm
23:12:46Xehmm
23:12:53Xewhat would that entail exactly?
23:12:56*MC__ quit (Ping timeout: 250 seconds)
23:13:56AraqI wrote FFI support for the VM twice.
23:14:18Xewhy not include it then?
23:14:55Araqthe code still exists in compiler/evalffi.nim
23:15:36AraqI don't want to support it.
23:15:59Xehow come?
23:16:42*saml_ joined #nim
23:17:15*zodiak joined #nim
23:18:10dom96ooh https://www.youtube.com/watch?v=yXYV_srRDaw
23:18:31vktecSo.... any code I can look at for loading a NimScript config into my Nim program?
23:18:52Araqvktec: Nimble does it
23:19:04Araqlook at its code for an extensive example
23:19:18vktecYeah, I remember looking at that a while ago, is that the best example?
23:20:10Araqcompiler/nimeval.nim is a better starting point
23:20:24Araqbut only shows how to run Nim code as a string
23:20:34*desophos quit (Remote host closed the connection)
23:20:47vktecOkay
23:21:14vktecSo I could load it from the file and then run it using the method shown there?
23:21:18AraqXe: people report strange crashes that I then have to look at
23:21:58Araqvktec: usually you need the script to call functions from your program
23:22:08*desophos joined #nim
23:22:11Araqso ... it's never this easy and you need to look at Nimble
23:22:12vktecAraq: Yeah
23:22:16vktecOkay
23:22:36vktecI'll see what I can do, thanks Araq
23:22:39Araqbut what about my "don't write programs, write libraries instead" idea?
23:22:50Xe^ it worked for xmonad
23:23:12vktecI'd normally do it that way, but this is a per-project configuration file, so it wouldn't really work very well
23:25:43*Jesin quit (Quit: Leaving)
23:27:29vktecI assume this is the function I should be looking at? https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/nimscriptsupport.nim#L197
23:29:35Araqyes
23:29:45vktecThanks
23:32:13*elrood quit (Quit: Leaving)
23:33:12*yglukhov quit (Remote host closed the connection)
23:34:14*cheatfate quit (Read error: Connection reset by peer)
23:34:46*Kaini joined #nim
23:43:43*Demos joined #nim
23:44:48Demoswhat editors are you guys using, I'm using the atom plugin but I'm wondering if there are any new/better nimsuggest integrations
23:45:41*cheatfate joined #nim
23:46:12*vktec uses Vim
23:47:41AraqDemos: VSCode + nim plugin seems to be the best currently
23:49:43Demoscool. I quite like VSCode
23:49:49Demosthanks
23:53:02Demosalso I may start work on better cuda support for my job. We're getting a DGX-1 and I'd really love to not have to use c++ to really exploit it
23:53:12*GangstaCat joined #nim
23:53:39*desophos quit (Remote host closed the connection)
23:54:55*desophos joined #nim
23:55:45*yglukhov joined #nim
23:58:10Araqyummy
23:59:56*yglukhov quit (Ping timeout: 250 seconds)