00:47:41 | * | mcc joined #nim |
00:49:14 | mcc | Few 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:03 | mcc | Second 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:02 | lazypenguin | @cheatfate, nice catch |
00:57:49 | mcc | Actually, 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:49 | mcc | https://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:52 | mcc | One more question. I do not understand how dynamic dispatch works on objects which are not ref-objects? |
00:59:27 | mcc | In 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:09 | mcc | So 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:34 | lazypenguin | hmm i've never seen 'method' before, is that an alias for 'proc'? |
01:02:07 | mcc | In 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:45 | lazypenguin | mcc, 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:13 | mcc | lazypenguin: yes, sorry, that is the problem, if i change Player to Mover i no longer get the warning |
01:15:00 | lazypenguin | :) |
01:16:41 | mcc | how 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:53 | lazypenguin | Looks 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:09 | mcc | but they both take op as the second argument |
01:20:59 | mcc | oh, is it controlled by the second argument's return value... that's subtle D: |
01:21:12 | lazypenguin | subtle indeed |
01:28:59 | * | yglukhov joined #nim |
01:33:02 | * | yglukhov quit (Ping timeout: 244 seconds) |
01:33:37 | renesac | mcc: you might be interested in this blog post series: |
01:33:37 | renesac | http://goran.krampe.se/category/oop/ |
01:33:54 | renesac | the older 5 |
01:34:47 | mcc | renesac: Hm. Which of these are out of date? |
01:35:11 | mcc | renesac: 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:09 | renesac | I don't know that changed since then.. |
01:40:16 | renesac | *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:42 | Demos | so 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:34 | endragor | Is it possible to pass sequence to a proc expecting varargs parameter? |
08:00:31 | PMunch | endragor, 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:41 | endragor | PMunch: how exactly, given the seq contents are not known in compile-time? |
08:06:51 | PMunch | Hmm, 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:13 | PMunch | endragor, macros run during runtime so they should at least be able to do it. |
08:10:04 | * | chemist69 joined #nim |
08:10:41 | endragor | hm, 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:49 | PMunch | Yes, but sometimes it's a lot easier to do it at with a macro |
08:14:24 | PMunch | Technically 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:34 | Araq | Demos: yes but varargs[typed] exists and can be manipulated with macros |
08:20:43 | Salewski | Dom, Listing 7.5, last line: requires "jester >= 0.0.1" is missing! Bye. |
08:20:48 | * | Salewski quit (Client Quit) |
08:20:48 | Demos | but that won't work if you have a query with multiple different parameter types |
08:20:55 | Demos | anyway it's not a big deal |
08:26:37 | Araq | hmm? |
08:27:21 | Demos | like if I have a table: |
08:27:52 | Demos | CREATE TABLE t (bin BLOB, name TEXT); |
08:29:00 | Demos | I can't do db.exec(sql"INSERT INTO t (bin, name) VALUES (?, ?)", addr something, "test") |
08:29:24 | Araq | yes you can |
08:29:35 | Araq | just not with db's current implementation |
08:29:46 | Araq | which doesn't make use of Nim's newer features |
08:30:01 | Demos | oh, allright. I'll look forward to that then |
08:30:17 | Demos | for now I'm just using the low level API |
08:36:40 | * | gokr joined #nim |
08:38:10 | Demos | OOOOOoooo the type mismatch errors have become really awesome since I last used nim |
09:12:26 | * | kingofoz joined #nim |
09:19:45 | Demos | the pragma syntax for macros does not seem to work in the latest version, although I could be screwing up my macro |
09:22:30 | Demos | I'll try and come up with a minimal test case tomorrow |
09:23:05 | endragor | Shouldn'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:03 | flyx | Demos: 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:16 | Demos | hm maybe its just when they are on types |
09:39:43 | Araq | the AST changed for these |
09:39:50 | Araq | do you use getType()? |
10:04:23 | Demos | no |
10:04:58 | * | gokr quit (Ping timeout: 252 seconds) |
10:16:16 | Araq | hmm |
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:50 | Nimian | Hello guys! |
11:06:51 | PMunch | Hi Nimian |
11:10:02 | Nimian | PMunch: What's up? |
11:10:24 | PMunch | Not much, trying to migrate a server |
11:10:33 | PMunch | You? |
11:11:14 | Nimian | Translating Nim tutorials to Arabic, Kurdish and Persian |
11:11:36 | PMunch | Oh nice |
11:11:44 | cheatfate | PMunch, you are talking with bot... |
11:12:00 | PMunch | I am? |
11:12:12 | cheatfate | PMunch, yep |
11:12:15 | PMunch | That's a good bot then :P |
11:12:37 | PMunch | And why does it say it's translating tutorials? |
11:13:34 | cheatfate | PMunch, because somebody programmed it :) |
11:13:40 | * | elrood joined #nim |
11:13:52 | Nimian | PMunch: It's not bad at all. |
11:14:31 | cheatfate | PMunch, this "tutorials translation" monolog was yesterday already |
11:14:55 | Nimian | what do you mean, cheatface? |
11:15:21 | PMunch | Haha, it even has spelling mistakes? That's pretty good |
11:15:53 | cheatfate | dom96, could you please ban the whole network 93.91.194.0? |
11:15:55 | Nimian | I like to call him cheatface. |
11:16:08 | Nimian | Why? |
11:17:09 | Nimian | cheatface: I lied about something, I don't really have master degree, I'm just an IT diploma student (year 1) |
11:17:30 | M-Flox | Hi Nimian |
11:17:42 | Nimian | Hello M-Flox! |
11:17:49 | Nimian | What's up? |
11:17:57 | M-Flox | Nimian: How are you? |
11:18:15 | Nimian | I'm fine thanks, and you? |
11:18:44 | M-Flox | Nimian: Good, thanks. What's the weather like? |
11:19:30 | Nimian | M-Flox: I think your are cheatfate, but you are registered another account in this channel? |
11:19:35 | Nimian | Am I right? |
11:19:44 | Nimian | Because I have that fellling? |
11:20:17 | M-Flox | Nimian: I am not cheatfate |
11:20:45 | * | chemist69 quit (Ping timeout: 260 seconds) |
11:20:54 | Nimian | M-Flox: Okay, I said that because cheatfate wanted to fool me. |
11:21:24 | Nimian | M-Flox: I'm in Kurdistan, the weather is very hot, |
11:21:40 | Nimian | M-Flox: We are also fasting in Ramadan month. |
11:22:03 | M-Flox | I have a feeling cheatfate is behind the bot typing |
11:22:43 | * | chemist69 joined #nim |
11:22:44 | Nimian | M-Flox: If I say anything offensive, my fasting won't be accepted. |
11:24:29 | Nimian | M-Flox: Would you like to know why I do care of Nim? |
11:24:46 | M-Flox | Ahm, not really :-) |
11:26:29 | Nimian | M-Flox: Just like I said, I cannot say offensive stuffs while I'm fasting. |
11:27:02 | Nimian | The rulse are rules and business is business. |
11:30:48 | Nimian | I have a question |
11:31:05 | Nimian | Any Nim developers here? |
11:32:12 | Nimian | Hello? |
11:33:14 | Araq | I'm here. |
11:33:52 | Nimian | Alright, 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:14 | Nimian | Ohh! Hi Araq! |
11:34:32 | Araq | to C. |
11:34:56 | Nimian | May I know why? |
11:36:03 | Araq | windows exposes a C API and the C++ codegen still has some issues wrt c++'s const |
11:36:10 | flyx | the Windows API is C, not C++. MFC is C++ |
11:38:01 | Nimian | flyx: It's both C and C++ |
11:38:11 | Nimian | But the C codes are more than C++ |
11:39:35 | flyx | afaik there is no C++ in the Windows API. please provide an example. |
11:39:56 | Nimian | I don't know actually, just like I said, I'm just a student at an IT diploma (2nd year) |
11:40:20 | elrood | don't feed the troll, guys |
11:40:35 | Nimian | elrood: I lied about master degree. |
11:40:38 | Nimian | Sorry |
11:41:46 | Nimian | elrood: But I'm still sure that Nim is not a real compiler. |
11:42:25 | elrood | you 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:17 | Araq | damn it. stop it. I don't want to moderate this channel. |
11:43:26 | Nimian | Okay |
11:44:11 | Nimian | Araq: calm down, I never seen you like this anger |
11:44:31 | * | yglukhov quit (Ping timeout: 252 seconds) |
11:48:37 | Nimian | Araq: As you know many major languages have International standard(s) from ANSI, ISO and/or ECMA. Will Nim have one? |
11:49:33 | Nimian | For example, C++11, C++17 (upcoming), Single Java Specification etc... |
11:51:31 | Nimian | Would 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:55 | Nimian | Welcome Shafdhuwdh3d |
11:53:50 | Nimian | Can anyone answer my question |
11:54:18 | Araq | Nimian: the manual evolves into a proper spec |
11:54:49 | Nimian | Araq: Am talking about international standard (a big stuff) |
11:54:56 | * | PMunch quit (Ping timeout: 244 seconds) |
11:55:51 | Nimian | Araq: Like standards from ISO, ANSI, ECMA etc... |
11:56:17 | M-Flox | sigh |
11:56:17 | Nimian | Araq: How can we get a standard? |
11:58:01 | Nimian | M-Fox: How many times I have to tell you that I'm fasting? |
11:58:42 | * | Araq2 joined #nim |
11:59:06 | Nimian | Hello Araq2! Welcome to the Nim IRC channel! |
11:59:24 | Araq2 | Thank you Nimian. |
11:59:40 | Nimian | You are welcome Araq2 |
12:00:33 | Nimian | May I ask why in the earth you named yourself Araq2? |
12:00:39 | * | PMunch joined #nim |
12:00:56 | Araq2 | I like Mr. Araq. That's why |
12:01:15 | Nimian | NP (No Problem) |
12:01:32 | gokr | So is this a bot or what? |
12:01:40 | flyx | they have the same IP. |
12:02:04 | Nimian | I think it's the same person. |
12:02:20 | Nimian | I 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:53 | Nimian | Let me ask you a question Araq2, why Nim language is so good? |
12:03:58 | flyx | anyway, can we please just ban him. this is getting ridiculous |
12:04:19 | Nimian | flyx: what I have don? |
12:04:29 | Nimian | I just asking him questions. |
12:04:52 | Nimian | He is the only one who answers me. he is the best helper here. |
12:06:59 | dom96 | Guess we need more mods. |
12:07:18 | cheatfate | dom96, you need to ban whole 93.91.194.0 |
12:07:26 | dom96 | cheatfate: ok |
12:07:42 | dom96 | I hope that will work |
12:08:03 | gokr | Oops, there went half our users... ;) |
12:08:39 | dom96 | Hope not |
12:08:48 | dom96 | I'll likely remove it after a while |
12:08:52 | gokr | That would've been scary - if it turned out half of us are bots ;) |
12:08:52 | dom96 | the troll will forget |
12:09:04 | dom96 | I don't know why you guys think that that was a bot though |
12:09:15 | dom96 | It was simply a human trying to troll. |
12:09:30 | gokr | Someone said so - but... I agree, it seemed slightly too sophisticated. not sure. |
12:10:37 | cheatfate | dom96, just because human dont like to talk with bots and start to ignore it... |
12:10:43 | cheatfate | till moderators kick him |
12:10:55 | elrood | AIs write movie scripts these days, you never know ;) thanks, dom |
12:13:29 | dom96 | https://twitter.com/polyconfhq/status/742322383722151936 |
12:14:55 | cheatfate | `nim async voodoo` what does it mean? :) |
12:17:33 | dom96 | I 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:05 | WW_ | Is NimEdit open source? |
12:42:25 | * | SchaffGeischd left #nim (#nim) |
12:43:20 | WW_ | Is NimEdit open source? |
12:43:50 | WW_ | Hello?? |
12:44:08 | dom96 | WW_: no |
12:44:18 | * | bjz_ joined #nim |
12:44:19 | dom96 | WW_: Be patient with your questions. |
12:44:43 | WW_ | dom96: excuse me, what do you mean? |
12:45:04 | dom96 | WW_: I mean, don't repeat your question. Ask it and wait. |
12:45:47 | WW_ | dom96: sorry, but I cannot wait, so please excuse me. |
12:46:03 | * | bjz quit (Ping timeout: 240 seconds) |
12:47:09 | WW_ | dom96: when will your amazing book be complete? |
12:47:23 | WW_ | I mean all chapters. |
12:48:30 | dom96 | WW_: No idea. Estimate is early 2017 (completely finished, so printed too) |
12:49:23 | WW_ | dom96: why did you kik me? I love Nim more than anyone else, even Mr. Andreas Rumpf. |
12:50:39 | dom96 | WW_: Ah, so you're the same person. I kicked you because you were causing trouble. |
12:51:31 | WW_ | I'm also BP (from Nim forum) |
12:52:52 | WW_ | But dom96, for real, I love Nim more than anyone else. |
12:52:59 | WW_ | I want to create a state-of-at operating system i entirely in Nim and assembly languages. |
12:53:11 | WW_ | **state-of-art |
12:58:00 | dom96 | Great. Why are you coming in here to argue then? |
12:58:02 | * | yglukhov joined #nim |
12:58:40 | * | WW__ joined #nim |
12:59:27 | WW__ | 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:33 | kteza1 | Hi. Very new to nim. What am I doing wrong here --> http://pastebin.com/TnuP1vSF |
13:04:50 | kteza1 | protocol.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:06 | kteza1 | That's the error I'm facing |
13:05:51 | WW_ | because I exited |
13:05:52 | WW_ | Dom can you repeat your answer |
13:06:56 | flyx | kteza1: your pasted source does not seem complete, it does not contain 31 lines. |
13:08:09 | kteza1 | @flyx Sorry. I didn't paste entire code. Error is at line 14 in pastebin |
13:09:12 | flyx | kteza1: 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:08 | flyx | kteza1: 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:47 | kteza1 | Ahh. all the 'var's are pointers then? |
13:12:24 | flyx | proper term is „call by reference“ |
13:13:09 | flyx | it does not necessarily have to be implemented as pointer, though it probably is (I do not know about the implementation details) |
13:13:35 | kteza1 | Ok. But I'm not able to modify length by declaring it like this --> proc encodeRemainingLength*(length: int): int = |
13:13:43 | kteza1 | with our 'var' |
13:13:56 | flyx | yes. you should copy it to a local var and modify that |
13:14:18 | flyx | modifying by-value parameters is considered bad practice even in languages that allow it |
13:14:57 | kteza1 | Hmm. Is shadowing allowed? (like rust) |
13:15:34 | kteza1 | I guess it is |
13:15:43 | flyx | not sure if Rust does something special about it, but yes, it is possible in Nim |
13:19:13 | kteza1 | @flyx Also I tried changing 'length' to uint64 and mod operation is failing (coz it is expecting int) |
13:19:23 | kteza1 | endocedLength = length mod 128 |
13:19:55 | kteza1 | Error: type mismatch: got (uint64) but expected 'int' |
13:20:18 | kteza1 | Why isn't mod accepting uint64? |
13:21:22 | kier | '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:43 | kier | but i'm not certain if mod is implemented on uint64 anyway |
13:21:58 | * | arnetheduck joined #nim |
13:22:10 | flyx | `length mod 128'u64` will work if length is uint64 |
13:22:36 | flyx | while `length mod 128` will not work because there is no `mod`(x: uint64, y: int) |
13:23:47 | arnetheduck | hey Araq, saw you merged ansi_c, everything ok so far? |
13:23:57 | flyx | kier: http://nim-lang.org/docs/system.html#mod,T,T |
13:24:33 | kier | ah yeah just spotted that |
13:25:04 | kier | though 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:12 | kier | ah I'm thinking of the fact that uint/uint64 aren't ordinals |
13:27:36 | flyx | yeah, that's https://github.com/nim-lang/Nim/issues/2613 |
13:31:24 | * | WW_ quit (Ping timeout: 250 seconds) |
13:32:07 | kteza1 | @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:11 | kteza1 | Wouldn't code become too verbose if I keep doing that? I there an alternate to this? |
13:33:18 | kteza1 | cast* |
13:34:35 | flyx | kteza1: all numeric literals without explicit type suffix are int and suffer this problem. there's no easy way around it |
13:34:56 | flyx | but you could, for example, write a template like this: |
13:35:40 | flyx | template `>`(x: uint64, y: int): bool = x > uint64(y) |
13:36:29 | flyx | there's an issue about implicit conversion here: https://github.com/nim-lang/Nim/issues/936 |
13:36:34 | renesac | kteza1: https://github.com/nim-lang/Nim/issues/936 |
13:36:41 | renesac | yep |
13:37:46 | renesac | the alternative is to avoid usnigned types in nim.. |
13:38:38 | kteza1 | Ok. Thanks @flyx @renesac |
13:46:05 | * | Anonymous joined #nim |
13:46:28 | * | Anonymous is now known as Guest46869 |
13:46:53 | Guest46869 | Where 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:51 | PMunch | Guest46869, a print version or just high-res? |
13:50:01 | renesac | flyx: I wonder if there is any side effect of putting https://github.com/nim-lang/Nim/tree/devel/web/assets/images |
13:50:03 | renesac | ops |
13:50:04 | renesac | https://github.com/nim-lang/Nim/tree/devel/web/assets/images |
13:50:34 | * | nsf joined #nim |
13:50:53 | renesac | flyx: 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:55 | renesac | I was trying for u32 and the uint32() don't seems to truncate the input like a cast, I'm not sure |
13:52:05 | renesac | *uint32 seems to |
13:53:03 | flyx | renesac: well, that's a question Araq would need to answer. |
13:53:28 | renesac | the bitwise operations are the most complicated |
13:53:39 | renesac | maybe we should just ignore them for now |
13:53:57 | renesac | and fix some of the rest |
13:53:59 | * | yglukhov joined #nim |
13:54:37 | renesac | there is no problem in upconverting to uint64 for boolean operations |
13:54:39 | renesac | for example |
13:55:30 | flyx | dunno, wouldn't that mean that `length > -2` would raise a runtime error? |
13:55:39 | flyx | (assuming length is uint64) |
13:56:50 | renesac | no error of any type |
13:57:35 | renesac | it seems to cast the integer value to unsigned one |
13:57:50 | renesac | ops |
13:57:53 | renesac | that was with a proc |
13:58:12 | renesac | with a templete I get a compile time error: Error: conversion from int literal(-2) to uint32 is invalid |
13:58:31 | flyx | uh, that's nice |
13:58:32 | renesac | curious... |
13:58:56 | renesac | should the proc beehaviour be differnt? |
13:59:09 | flyx | um |
13:59:26 | flyx | so why does uint32(-2) raise a compile-time error, but uint64(-2) doesn't? |
14:00:29 | flyx | the 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:05 | renesac | and at runtime, even in a debug build, it don't complains and just casts... |
14:01:23 | flyx | so the proc behaving in a different way makes sense to me. but uint32(-2) being handled differently than uint64(-2) does not. |
14:01:51 | renesac | I'm not able to reproduce that second thing as I'm getting a weird type mismatch here |
14:02:11 | flyx | `echo uint64(-2)` works for me. `echo uint32(-2)` does not. |
14:03:04 | renesac | strange, I had to manually convert uint32 to wuint64 |
14:03:10 | renesac | it didn't implicitly convert there |
14:03:18 | renesac | *uint64 |
14:03:58 | renesac | because 18446744073709551614 fits in a uint64, but not in a uint62... |
14:04:17 | renesac | *32 |
14:05:03 | renesac | I'm not sure if this behaviour is intended though.. |
14:12:18 | flyx | renesac: 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:47 | renesac | flyx: at least both fail when not inside a proc |
14:20:33 | renesac | *not working with proc arguments |
14:22:51 | * | gokr quit (Ping timeout: 276 seconds) |
14:22:59 | Araq | yeah 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:23 | Araq | I 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:57 | renesac | yay! If this means at least that literals will get automatically converted to the proper uint, I will be very happy |
14:30:51 | renesac | although 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:51 | dom96 | +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:31 | michael_campbell | Why does this work: let z = {1..3}, but this does not? var x: set[int16]; x = {1..3}? I get: |
14:41:32 | michael_campbell | Error: type mismatch: got (set[range 0..65535(int)]) but expected 'set[int16]' |
14:41:47 | michael_campbell | user error I've no doubt, just not sure where I've gone wrong |
14:42:12 | michael_campbell | (the var example is on 2 lines; just put it on one for brevity) |
14:42:21 | Araq | the compiler is picky about the 'convertible' relation |
14:43:07 | michael_campbell | What 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:19 | Araq | try x = {1i16..3i16} |
14:43:55 | michael_campbell | same. Both with 1i16 and 1'i16 |
14:43:57 | michael_campbell | (on both ends) |
14:44:35 | michael_campbell | Pushing values into the set piecemeal works. |
14:45:08 | michael_campbell | Am enjoying the Nim in Action MEAP so far, by the way. |
14:45:28 | * | PMunch quit (Quit: leaving) |
14:48:05 | Araq | x = {1i16..3i16} needs to work, report it please |
14:48:46 | michael_campbell | Will do; on github? |
14:49:12 | * | elrood joined #nim |
14:51:42 | Araq | yes |
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:48 | endragor | Araq: 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:48 | endragor | such case, I could manually invoke Nim with those paths, discarding the .nimble file for the main package. Which approach is better? |
15:07:48 | Araq | not sure, but why are the prefixes unwanted? |
15:09:15 | namnguyen | is there a flag to force c++11? |
15:10:05 | endragor | Araq: 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:59 | michael_campbell | Araq, I was mistaken. |
15:11:07 | namnguyen | ahh passC |
15:11:09 | michael_campbell | var x: system.set[int16] <newline> x = {1'i16..3'i16} does work |
15:12:18 | michael_campbell | Is 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:35 | michael_campbell | Am I not importing something that I should be? |
15:14:35 | Araq | michael_campbell: name your file to something that doesn't clash with system.set |
15:14:44 | Araq | the filename is used as the module name. |
15:14:54 | Araq | I dunno why everybody stumbles over this. |
15:15:06 | michael_campbell | Ah hah! Of course; thanks |
15:15:50 | dom96 | endragor: can't you edit the macros so that they look for the different filenames? |
15:16:13 | michael_campbell | It'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:21 | michael_campbell | Do you guys take PR's for the tutorial? |
15:16:38 | Araq | sure |
15:16:48 | michael_campbell | But even after that, I didn't put 2 and 2 together about the module name vs. system types - thanks for htat. |
15:17:09 | Araq | the error message seems broken |
15:17:17 | Araq | "or .set "? |
15:17:23 | Araq | that makes no sense. |
15:17:25 | michael_campbell | I was wondering about that too. |
15:17:43 | namnguyen | hmm, clib:ABC is prefixed with the current directory to -l/path/to/cwd/ABC |
15:17:54 | michael_campbell | Maybe if Nim were a *REAL* compiler.... (I kid, I kid - I was watching the shitshow from EEE yesterday) |
15:18:04 | namnguyen | is that intended? what's the use of -l/path...? |
15:18:05 | endragor | dom96: 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:59 | dom96 | endragor: it will always be your package name |
15:19:23 | endragor | macros are part of the library, they don't know about package names of users |
15:19:48 | dom96 | as in, if nimue4 includes ue4.nimble then it will prefix with ue4_file.cpp |
15:20:04 | dom96 | *prefix with ue4_ ending up with ue4_file.cpp |
15:21:38 | endragor | dom96: 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:55 | dom96 | oh |
15:25:30 | Araq | namnguyen: it's indented but I don't know if it's wise |
15:25:55 | dom96 | endragor: how do your macros know what the names of those packages' files are? |
15:26:00 | namnguyen | Araq, what was the use case that called for it? |
15:26:18 | Araq | "consistency". |
15:26:36 | Araq | people always report when it's "inconsistent" |
15:26:45 | endragor | dom96: using lineinfo proc from macros module |
15:26:48 | Araq | apparently it's better to be consistent than to be useful ... |
15:27:18 | namnguyen | with cincludes, i guess? |
15:27:46 | namnguyen | but the doc does say that clib:NAME where NAME is a name of the lib, not the path. |
15:28:04 | Araq | I have no idea what clib does. |
15:28:14 | dom96 | endragor: then perhaps the best solution would be to ask Araq to include the .cpp/.c filenames in the lineinfo output |
15:28:15 | Araq | adds something to link? |
15:28:19 | namnguyen | --clib:LIBNAME link an additional C library (you should omit platform-specific extensions) |
15:28:40 | namnguyen | yes, it adds some libraries to link command. |
15:28:55 | namnguyen | the workaround is to use passL:"-lLIBNAME" |
15:28:56 | dom96 | endragor: or maybe via some system proc like getPackageName |
15:28:59 | endragor | dom96: I think it would not be good for that procedure. It is supposed to return .nim filename |
15:29:05 | Araq | yeah, I always use the workaround |
15:30:18 | Araq | dom96, endragor yeah that cannot work, the frontend doesn't even know about how the file will be named |
15:32:22 | endragor | well, since I already mess with generated files after Nim, I guess I could simply rename those prefixed with the nimble package name. |
15:40:14 | Araq | true |
15:47:01 | michael_campbell | Is `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:56 | NimIsNotARealCom | Where is Nim's official office? |
15:48:58 | lazypenguin | michael_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:17 | lazypenguin | not sure how that affects echo "foo" however |
15:49:26 | lazypenguin | but there might be similar |
15:49:53 | michael_campbell | "foo".echo also works, which I found fun. |
15:50:02 | michael_campbell | UFCS... I kind of dig it. |
15:50:04 | NimIsNotARealCom | ? |
15:50:09 | NimIsNotARealCom | Araq: where is Nim's official office |
15:50:42 | michael_campbell | <3 that `if` and `case` are expressions. |
15:51:08 | NimIsNotARealCom | WHERE IS NIM'S OFFICIAL OFFICE????? |
15:51:18 | Demos | yo: so w.r.t the winapi. |
15:51:22 | Demos | the winapi itself is in C |
15:51:31 | Demos | however some components are exposed using COM |
15:51:38 | Demos | COM is not C or C++ |
15:51:43 | Araq | NimIsNotARealCom: in Mecca. |
15:51:44 | michael_campbell | Man, that due has a jihad. |
15:51:49 | michael_campbell | s/due/dude |
15:52:04 | Demos | and in fact defineing C_INTERFACE before importing a COM header will expose a (slightly nonstandard) C interface |
15:52:05 | lazypenguin | haha was that the EEE_ guy? Guess you guys changed your mind on ban policy? |
15:52:39 | dom96 | nah, ban policy is still the same: Don't ban until you have no other choice. |
15:52:58 | michael_campbell | I 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:25 | michael_campbell | My "office" is one of those open office layouts; it's the worst thing ever. It's neither collaborative nor private. |
15:55:12 | michael_campbell | And 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:30 | lazypenguin | hah |
15:55:33 | lazypenguin | welcome back |
15:55:35 | NimIsNotRealComp | Where is Nim's official office? |
15:55:43 | NimIsNotRealComp | Thanks lazy. |
15:55:59 | NimIsNotRealComp | They cannot beat my VPN |
15:56:46 | NimIsNotRealComp | WHERE IS NIM'S OFFICIAL OFFICE? |
15:56:58 | lazypenguin | Why do you ask? |
15:57:06 | NimIsNotRealComp | I don't know. |
15:57:17 | namnguyen | <Araq> NimIsNotARealCom: in Mecca. |
15:57:23 | namnguyen | you happy now? |
15:57:36 | NimIsNotRealComp | What a beautiful paradism. |
15:57:54 | NimIsNotRealComp | **Paradise |
15:58:34 | namnguyen | okay. great. now sit tight. |
15:59:09 | dom96 | *sigh* |
15:59:53 | lazypenguin | Wish I had that much free time |
16:04:57 | * | CC-BY-SA joined #nim |
16:05:00 | CC-BY-SA | ds |
16:05:00 | CC-BY-SA | c |
16:05:01 | CC-BY-SA | sdc |
16:05:02 | CC-BY-SA | fd |
16:05:03 | CC-BY-SA | btr |
16:05:05 | CC-BY-SA | bregdb |
16:05:07 | CC-BY-SA | fd |
16:05:07 | CC-BY-SA | bfd |
16:05:07 | CC-BY-SA | csd |
16:05:07 | CC-BY-SA | ds |
16:05:07 | CC-BY-SA | c |
16:05:08 | CC-BY-SA | bfd |
16:05:08 | CC-BY-SA | vbrd |
16:05:08 | CC-BY-SA | sdf |
16:05:08 | CC-BY-SA | v |
16:05:09 | CC-BY-SA | dr |
16:05:09 | CC-BY-SA | tr |
16:05:10 | CC-BY-SA | h |
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:41 | dom96 | lol |
16:07:18 | * | lazypenguin2 joined #nim |
16:07:18 | * | Mark___ joined #nim |
16:07:35 | Mark___ | You are kiking me just because I'm muslim???!!! |
16:07:42 | dom96 | Mark___: Not at all. |
16:07:55 | Mark___ | So why you are kiking me? |
16:08:03 | dom96 | Mark___: Because you are spamming |
16:08:14 | Mark___ | Okay, am gonna stop |
16:08:45 | dom96 | Mark___: Why are you doing it? |
16:09:34 | Mark___ | 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:21 | dom96 | Mark___: Of course I can |
16:10:45 | * | lazypenguin1 quit (Ping timeout: 276 seconds) |
16:10:59 | Mark___ | 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:32 | lazypenguin | Hey guys, any reason why dnylib is preferable over header? |
16:25:55 | * | akaisora joined #nim |
16:26:23 | namnguyen | lazypenguin, i guess because at runtime, you can use the system-provided dynlibs. |
16:26:51 | namnguyen | where 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:37 | michael_campbell | I'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:29 | michael_campbell | One big advantage of golang here, for running inside docker anyway, is by-default statically linked bins without a lot of extra fuss. |
16:37:37 | lazypenguin | Yes 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:59 | namnguyen | lazypenguin, --app:staticlib |
16:41:44 | namnguyen | michael_campbell, ^ |
16:44:02 | lazypenguin | Excuse 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:23 | namnguyen | lazypenguin, no sir. unles you do it yourself in code. |
16:45:26 | namnguyen | unless* |
16:45:53 | namnguyen | which is very possible with macros |
16:46:03 | namnguyen | tell me more about your need though. |
16:46:54 | namnguyen | you 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:22 | lazypenguin | Have 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:40 | namnguyen | yep. |
16:51:06 | * | Box_Jellyfish joined #nim |
16:51:30 | lazypenguin | In your opinion, is that method preferred over porting the lib to nim (since source is available)? |
16:53:43 | namnguyen | lazypenguin, are you going to maintain the binding for a long run? |
16:54:23 | * | desophos quit (Read error: Connection reset by peer) |
16:55:16 | lazypenguin | Is 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:09 | michael_campbell | namnguyen, 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:21 | michael_campbell | not a lib |
16:56:49 | namnguyen | michael_campbell, have you tried it? |
16:57:42 | michael_campbell | yes, it creates a "libclient.a" from "client.nim". |
16:57:57 | michael_campbell | what I want is "client", but a staticly linked bin. |
16:58:03 | * | GangstaCat joined #nim |
16:58:08 | namnguyen | hmm, on my setup, it creates a static binary. |
16:58:19 | michael_campbell | I.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:41 | lazypenguin | --passL? |
16:59:00 | namnguyen | ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24 |
16:59:02 | michael_campbell | lazypenguin, sure, but not sure what options to pass. |
16:59:34 | namnguyen | michael_campbell, do a ldd on that binary |
16:59:36 | * | Jesin joined #nim |
16:59:40 | lazypenguin | Haven't tested but wouldn't --passL:mylib.a work? |
16:59:43 | namnguyen | so what libraries are dynamic |
16:59:59 | michael_campbell | linux-vdso.so.1 => (0x00007fffb3ea1000) |
17:00:00 | michael_campbell | libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa1e409c000) |
17:00:00 | michael_campbell | libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa1e3e98000) |
17:00:00 | michael_campbell | libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa1e3ad2000) |
17:00:00 | michael_campbell | /lib64/ld-linux-x86-64.so.2 (0x00005605a1b03000) |
17:00:01 | namnguyen | and make sure you have all those static libraries |
17:00:11 | michael_campbell | Then pass them to --passL? |
17:01:19 | namnguyen | so you'll need -lm for the math library |
17:01:24 | namnguyen | dl is automatically added |
17:02:01 | namnguyen | so, yea, the only thing i know is libm is probably not a static library |
17:02:15 | namnguyen | the rest looks standard to me. |
17:02:35 | namnguyen | do you have libm.a in your system? |
17:02:44 | michael_campbell | looking |
17:03:43 | lazypenguin | should be /usr/lib/x86_64-linux-gnu/libm.a if you are on debian based |
17:04:25 | michael_campbell | Yup. /usr/lib/x86_64-linux-gnu/libm.a |
17:04:27 | namnguyen | http://pastebin.com/k1H1TYiw |
17:04:49 | namnguyen | that's the command i used to create static binary. |
17:05:16 | michael_campbell | Gotcha, thanks. What happens if you take out the app:staticlib? |
17:05:22 | lazypenguin | you get a binary |
17:05:27 | namnguyen | michael_campbell, it created a dynamic dinary |
17:05:30 | namnguyen | binary |
17:06:05 | michael_campbell | "staticlib" seems oddly named to me, then. |
17:06:18 | michael_campbell | It DOES create a lib for me when used; I wouldn't expect it to create a bin. |
17:06:30 | lazypenguin | why is it oddly named? |
17:06:36 | lazypenguin | it produces a static library |
17:06:44 | michael_campbell | because it creates a lib. |
17:06:58 | michael_campbell | but for namnguyen it creates (also) a binary. |
17:07:03 | namnguyen | michael_campbell, is libclient.a really an archive file? |
17:07:20 | michael_campbell | libclient.a: current ar archive |
17:07:21 | namnguyen | does it not create anything else? |
17:07:52 | namnguyen | so it does create a static library for me too. but there's the static binary in addition to that. |
17:08:05 | michael_campbell | for me it creates JUST the lib |
17:08:10 | michael_campbell | 0.14.2 |
17:08:24 | michael_campbell | the source file is just import os and an echo |
17:08:40 | michael_campbell | using: nim c --app:staticlib client.nim |
17:08:49 | namnguyen | erm, hold on |
17:08:57 | namnguyen | i might have done something differently. |
17:09:09 | michael_campbell | (and of course nimcache) |
17:09:11 | namnguyen | i removed the genarated files and ran my command again |
17:09:21 | namnguyen | no binary is created. |
17:10:04 | namnguyen | okay. try this: --passL:-static |
17:10:10 | * | jjido joined #nim |
17:10:11 | namnguyen | and sorry for the confusion |
17:10:55 | lazypenguin | I'm still struggling to decide to port library vs create binding |
17:11:24 | michael_campbell | That 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:24 | michael_campbell | stdlib_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:29 | namnguyen | lazypenguin, it all boils down to whether you want to maintain your binding for a long time. |
17:11:56 | michael_campbell | but I do get a static binary that runs |
17:12:01 | namnguyen | michael_campbell, it's usually okay. |
17:12:06 | michael_campbell | Cool, thanks. |
17:12:11 | namnguyen | yw |
17:12:29 | lazypenguin | namnguyen, so you are saying that bindings require more maintenance? |
17:12:47 | namnguyen | lazypenguin, less than porting. |
17:13:12 | namnguyen | when upstream changes, the port needs to be patched too, but the binding probably only needs a recompilation. |
17:17:55 | lazypenguin | sure, 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:14 | kteza1 | This might be the most frequently asked question (sorry. new user here). Is 1.0 planned before the end of this year? |
17:28:52 | namnguyen | kteza1, as far as i know, 1.0 is planned for "when it's ready". |
17:29:24 | lazypenguin | alright namnguyen, i'll go down the binding route. Will leave it up to the user to compile static libraries for the lib |
17:30:47 | namnguyen | lazypenguin, or they can use their own dynamic library too, just like the Nim binding to IUP. |
17:31:04 | kteza1 | namnguyen. 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:29 | Guest8241 | Araq: I think there is only one task remains for 1.0, am I right? |
18:20:53 | Araq | what 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:35 | ubhu | Araq: implement static[T] properly. |
18:26:01 | * | TheLemonMan joined #nim |
18:26:09 | ubhu | That is what written in roadmap 1.0 (on GitHub) |
18:26:33 | Araq | I need to update the roadmap :-) |
18:27:43 | ubhu | Yes, Araq please never hurry, take all your time, stability is very important for certain application programs. |
18:32:51 | ubhu | Araq: NimEdit's GUI is very not nice. |
18:33:13 | Araq | afaik I never even announced it anywhere. |
18:33:23 | Araq | there is a reason for that. |
18:33:32 | ubhu | GUI is the reason? |
18:34:29 | Araq | it has bugs and looks ugly |
18:34:56 | ubhu | It is not ugly, IT IS THE MOST UGLIEST THING |
18:36:23 | ubhu | For 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:35 | dom96 | ubhu: stop being rude and making demands. |
18:37:38 | Araq | I have answered this question already. |
18:38:33 | Salewski | When the trolls may have a short break a short question: is using paranteses () as below the recommended style? |
18:38:37 | Salewski | if word.toLower() in pkg.name.toLower(): |
18:38:58 | Araq | I don't use () here |
18:39:08 | * | endragor joined #nim |
18:39:14 | ubhu | Araq & dom: You don't know. |
18:39:21 | Salewski | Thanks! |
18:39:35 | * | Salewski quit (Client Quit) |
18:40:22 | * | kteza1 quit (Ping timeout: 250 seconds) |
18:41:41 | dom96 | ubhu: what don't we know? |
18:42:53 | ubhu | dom96: In your book, you said that JVM is vulnerable. |
18:43:10 | ubhu | That is TOTALLY WRONG. |
18:43:16 | GangstaCat | ubhu, we spotted you EEE/Nimian |
18:43:24 | dom96 | ubhu: Why are you wasting our time? |
18:43:46 | ubhu | dom96: you are teaching people wrong stuffs. you are a student, you cannot write a book and teach people. |
18:43:55 | ubhu | dom96: you don't have that right. |
18:44:04 | vktec | Who says? |
18:44:13 | * | vktec looks around |
18:44:41 | GangstaCat | no need to use a VPN we got your real IP my friend :p 93.91.194.164 |
18:44:44 | lazypenguin | Sorry dom96, ubhu says you don't have that right so you better leave |
18:45:12 | vktec | :D |
18:45:18 | dom96 | lol |
18:45:22 | * | Satyajit joined #nim |
18:45:22 | * | fredrik92 left #nim ("Leaving channel") |
18:45:39 | ubhu | vktec: How many times should I tell you GaFY? |
18:45:55 | lazypenguin | N+1 times please |
18:46:41 | ubhu | dom96: You are very responsible for sending people wrong information, because one of the Java advantages is secuity. |
18:47:02 | ubhu | dom96: This is one of the many things that you and araq don't know. |
18:47:13 | vktec | ubhu: And this is related to Nim.... how? |
18:47:15 | vktec | XD |
18:47:21 | lazypenguin | Is there a way to mute him without him knowing? |
18:47:40 | vktec | lazypenguin: That'd be cool :D |
18:47:49 | dom96 | *cough* :P |
18:47:53 | vktec | Don't think so though... |
18:48:10 | * | ubhu quit (Quit: Page closed) |
18:48:46 | lazypenguin | he figured it out... |
18:49:02 | lazypenguin | too bad you can't do a mac address ban |
18:49:13 | vktec | Ooh, IRCv3 should implement that |
18:49:33 | * | SuperNova joined #nim |
18:49:36 | SuperNova | tr |
18:49:36 | SuperNova | vt |
18:49:37 | SuperNova | d |
18:49:38 | SuperNova | tehhv |
18:49:38 | SuperNova | trbeu |
18:49:38 | SuperNova | 6 |
18:49:38 | SuperNova | ytrb |
18:49:39 | SuperNova | ytr5 |
18:49:39 | SuperNova | y54y |
18:49:39 | SuperNova | b |
18:49:40 | SuperNova | 6u |
18:49:40 | SuperNova | yb |
18:49:40 | SuperNova | n |
18:49:40 | SuperNova | r5 |
18:49:44 | * | SuperNova quit (Excess Flood) |
18:49:47 | vktec | Hahahaha! |
18:49:53 | lazypenguin | lol |
18:50:00 | vktec | Didn't even have to do anything |
18:50:31 | GangstaCat | someone refused his PR? is he mad? :p |
18:50:53 | lazypenguin | He wanted everyone to admit nim compiler is not a real compile |
18:51:03 | lazypenguin | started lecturing everyone |
18:51:08 | * | BoxJellyfish joined #nim |
18:51:14 | BoxJellyfish | Wait! |
18:51:34 | lazypenguin | :'D |
18:52:02 | jeffc_ | Very 'murrican of you there Dom. Pre-emptive strike and all that |
18:52:10 | dom96 | hah |
18:52:24 | GangstaCat | is that the first ban in this channel history? |
18:52:41 | cheatfate | GangstaCat, nope |
18:53:06 | dom96 | nah, but it's the first time we've had a troll that was as persistent as this one |
18:53:40 | GangstaCat | no big deal, that means Nim becomes to make waves |
18:53:51 | GangstaCat | begin* |
18:53:58 | dom96 | heh yeah |
18:56:09 | cheatfate | he 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:13 | cheatfate | I'm looking for some help, with this https://gist.github.com/cheatfate/1984f4b759fd750d4bffaa6feeb08343 |
19:01:43 | cheatfate | there 2 functions `sendTo`, first one works like expected, but second one always make SIGSEGV on call to WSASendTo... |
19:02:11 | cheatfate | but this SIGSEGV happens only with gcc, vcc works properly |
19:03:10 | * | BitPuffin quit (Read error: Connection reset by peer) |
19:05:46 | Flox42 | Can'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:01 | cheatfate | Flox42, the problem is, this code don't use threads... |
19:13:11 | Flox42 | valid point |
19:15:00 | namnguyen | cheatfate, just a wild goose here, is the segfault related to dealloc? |
19:15:24 | cheatfate | it happens directly on call to WSASendTo |
19:15:51 | namnguyen | because you have dealloc aiList |
19:16:03 | namnguyen | and the WSASendTo uses aiList.ai_addr |
19:16:11 | * | jjido joined #nim |
19:16:24 | namnguyen | what if you comment out the dealloc lines? |
19:18:12 | cheatfate | namnguyen, 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:37 | lazypenguin | Hey guys, are const limited to 32 bits? |
19:21:30 | cheatfate | lazypenguin, on 32bit systems - yes, iirc |
19:24:58 | shodan45 | anyone familiar with both nim and pony and can compare the two? |
19:25:32 | lazypenguin | thanks cheatfate, have the following in a header file and trying to come up with nim equivalent: #define MPD_RADIX 10000000000000000000ULL |
19:25:36 | shodan45 | I just discovered pony, and it looks interesting.... but I can't get the compiler to build for the life of me |
19:26:08 | lazypenguin | shodan45, what error are you getting? |
19:27:15 | shodan45 | lazypenguin: with pony? I got several, I tried many different environments - several different distros |
19:27:50 | lazypenguin | sounds like nim is already better.... |
19:28:15 | dom96 | shodan45: you might be able to get some help in #ponylang :) |
19:28:43 | shodan45 | I 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:49 | shodan45 | dom96: yeah, already tried |
19:29:09 | shodan45 | trying to figure if I should just give up on it |
19:29:55 | shodan45 | granted, I also had some issues getting recent distros to boot in KVM |
19:33:49 | shodan45 | seems nim's approach of compiling to C at least wins the ease-of-use battle :) |
19:34:17 | shodan45 | (pony uses LLVM & compiles to LLVM IR) |
19:35:49 | dom96 | yeah, 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:26 | shodan45 | from what I could tell, pony has less flexible syntax, which frankly I prefer over nim's fairly extreme flexibility |
19:38:12 | shodan45 | nim is "cooler", but I like the practicality of less flexibility |
19:38:29 | shodan45 | (IMHO, of course) |
19:39:52 | lazypenguin | dom96, 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:11 | dom96 | const x = 10000000000000000000'u64 seems to work |
19:41:28 | lazypenguin | perfect, thank you |
19:59:52 | * | abruanese quit (Ping timeout: 272 seconds) |
20:07:06 | zaquest | hello. 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:48 | Araq | don't use uint for counting |
20:13:12 | PMunch | devlog.peterme.net/index.php?p=23 |
20:13:23 | PMunch | ^Wrote a little something on my implementation of TinyWM in Nim |
20:14:05 | Araq | and usually I replace inheritance and methods with closures |
20:14:25 | Araq | but it's hard to do that for your example because your example leaves out the algorithm |
20:15:23 | Araq | an alphabet could become a simple predicate: proc (elemInAlphabet: T): bool |
20:16:01 | dom96 | PMunch: awesome |
20:16:05 | zaquest | Araq, why not uint? there should not be negative counts. |
20:16:33 | Araq | use Natural then. nor should the counter wrap around ... |
20:16:34 | dom96 | PMunch: the citation/reference symbols are not rendering properly for me |
20:17:01 | PMunch | Hmm, those are link symbols (the text before them are links). Are you on mobile? |
20:17:20 | PMunch | Hade some trouble with mobile not rendering UTF-8 symbols, I'm looking into it |
20:17:30 | dom96 | PMunch: nope, Firefox on OS X |
20:17:35 | PMunch | Strange |
20:18:22 | * | pregress_ quit (Remote host closed the connection) |
20:18:42 | dom96 | PMunch: Some grammar feedback: "It's not there are a lack of them", I think you need a "that" in there. |
20:19:06 | PMunch | Fixed |
20:19:10 | PMunch | And thanks :) |
20:19:12 | dom96 | also s/you/of/ later in that sentence |
20:19:26 | Flox42 | zaquest: 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:53 | PMunch | Crap, had an old window open and now I reverted to a worse version of the text.. |
20:20:23 | dom96 | Might want to re-read the text, there are a couple small mistakes :) |
20:20:39 | zaquest | Flox42, ok, thank you |
20:21:46 | PMunch | There, 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:14 | PMunch | dom96, better? |
20:27:06 | dom96 | PMunch: a bit, still a couple of mistakes |
20:27:54 | PMunch | Hmm, 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:20 | dom96 | PMunch: I'll read it and send you a list :) |
20:33:12 | PMunch | Thanks, really appreciate it :) |
20:33:15 | * | shodan45 quit (Quit: Konversation terminated!) |
20:34:29 | PMunch | Be right back |
20:34:53 | * | chemist69 quit (Ping timeout: 250 seconds) |
20:36:48 | lazypenguin | does nim have an equivalent to limits.h? |
20:40:54 | * | xet7 quit (Quit: Leaving) |
20:44:29 | elrood | PMunch, 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:22 | PMunch | elrood, 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:49 | cheatfate | dom96, i think we break asyncdispatch somewhere |
20:48:59 | cheatfate | and i think its a bug in callSoon implementation |
20:49:16 | dom96 | cheatfate: why do you think that? |
20:49:37 | cheatfate | dom96, there 2 problems appears |
20:50:16 | cheatfate | First, 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:41 | cheatfate | I can't make this test anymore |
20:50:44 | * | vqrs joined #nim |
20:50:52 | cheatfate | because `await client.recvLineInto(lineFut) or sleepAsync(1000)` is not working anymore |
20:51:20 | cheatfate | Second, i have implemented async udp support and wrote test for it |
20:51:44 | cheatfate | this test is similar to test tasyncawait.nim |
20:51:48 | cheatfate | using localhost |
20:51:52 | * | chemist69 joined #nim |
20:52:11 | cheatfate | so in this test my functions heavy used immediate completion (udp is fast) |
20:52:24 | elrood | PMunch, 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:28 | cheatfate | but if on unix systems everything is ok |
20:52:39 | cheatfate | on windows i have very strange SIGSEGVs |
20:52:49 | cheatfate | first call is OK, second is SIGSEGV |
20:53:43 | cheatfate | I'm suspect that for some reason stored `cb` loosing its environment parameter |
20:53:55 | PMunch | elrood, any good listings? |
20:55:11 | dom96 | cheatfate: perhaps it's a Nim closure bug? |
20:55:19 | * | GangstaCat quit (Quit: Leaving) |
20:56:31 | cheatfate | and my SIGSEGV happens on return from `WSASendTo()` call, assign return value to variable causes SIGSEGV |
20:56:43 | cheatfate | so somewhere stack is smashed |
20:57:29 | elrood | PMunch, your charmap utility of choice ;P |
20:58:12 | cheatfate | dom96, does anything have been changed recently in closure handling? |
20:58:24 | cheatfate | i didnt remember |
20:59:18 | PMunch | elrood, obviously :P I was thinking about a list of some of the more useful ones for this kind of stuff. |
21:00:54 | elrood | nope, 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:08 | cheatfate | Araq, 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:52 | cheatfate | Araq, nm |
21:15:39 | Vad | Hello. |
21:16:47 | elrood | not again.. |
21:17:49 | dom96 | Vad: Hi there, welcome to #nim! |
21:17:54 | Vad | I have a nice question. Why almost all programming languages are in English? |
21:18:05 | Vad | dom96: Thanks very much. |
21:18:10 | dom96 | Vad: Are you new here? |
21:18:32 | Vad | dom96: Yes, I'm new to Nim. |
21:20:13 | Vad | dom96: I can do tha forever. |
21:20:14 | dom96 | Vad: You might want to try asking that question in #programming. This is a nim-specific channel. |
21:20:32 | Vad | So don't make me do that again. |
21:20:51 | Vad | I can always change the IP address |
21:20:55 | elrood | fasting obviously doesn't benefit that guy |
21:21:17 | dom96 | Vad: 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:44 | dom96 | so, 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:53 | elrood | perhaps it's best to just ban /*!*@gateway/web/freenode* for a few days |
21:31:18 | PMunch | dom96, 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:38 | dom96 | PMunch: ok |
21:38:44 | dom96 | PMunch: thanks |
21:39:08 | PMunch | No problem, giving something back to Nim :) |
21:39:51 | dom96 | PMunch: okay, you can gain +o using /msg chanserv op #nim |
21:39:56 | dom96 | or just /cs op #nim in some clients |
21:40:11 | dom96 | and 'deop' to get rid of it |
21:40:18 | PMunch | /msg chanserv deop #nim |
21:40:26 | PMunch | There we go |
21:40:32 | dom96 | PMunch: keep this in mind https://github.com/Araq/Nim/wiki/IRC-guidelines |
21:40:48 | dom96 | To quiet use: /mode #nim +q username |
21:40:55 | dom96 | change + to - to remove it |
21:41:10 | dom96 | and prefer to quiet instead of ban :) |
21:41:44 | PMunch | Okay |
21:41:52 | PMunch | Keep them quiet until? |
21:42:11 | dom96 | PMunch: however long you think is necessary |
21:42:23 | dom96 | people who are just downright malicious are easy |
21:42:57 | dom96 | when genuine fights occur best to make it temporary |
21:43:04 | * | jjido quit (Remote host closed the connection) |
21:43:11 | dom96 | between people you know are regulars here for example |
21:43:22 | dom96 | But that won't happen because we all love each other right? :) |
21:43:28 | PMunch | Yay :) |
21:43:48 | PMunch | Hmm, 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:05 | PMunch | https://github.com/nim-lang/Nim/wiki/IRC-guidelines |
21:44:34 | kteza1 | Hi. How do I write python bytearray like this in nim --> msg = bytearray(b"\x10\0\0\x04MQTT\x04\x02\0\0") |
21:49:09 | dom96 | kteza1: just var msg = "\0x10\0\0\0x04MQTT\0x04\0x02\0\0" (I think) |
21:50:05 | dom96 | PMunch: oh, and probably best not to quiet the full freenode webchat as there may be genuine people trying to connect. |
21:52:16 | dom96 | afk |
21:52:46 | PMunch | Of course |
21:56:24 | * | endragor quit (Ping timeout: 272 seconds) |
21:58:06 | kteza1 | @dom96 Unfortunately no. msg[1] is relulting in 'x' where as in python, it would result in 0 (The byte after 0x10) |
21:59:15 | PMunch | Hmm, 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:29 | Araq | kteza1: var msg = "\x10\0\0\0x04MQTT\x04\x02\0\0" |
22:09:15 | elrood | PMunch, how do you want it to look? would changing styles.css:46 to something like content:"\2bb0"; do? |
22:10:50 | elrood | the 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:19 | kteza1 | @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:51 | PMunch | Hmm elrood, 2bb0 doesn't display for me.. |
22:36:35 | PMunch | And 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:47 | PMunch | But 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:20 | ldleworker | I 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:40 | ldleworker | Since other people mentioned like, you could invent any syntax for go as long as you wrote a translator to gofmt'd structure |
22:51:53 | ldleworker | If anyone wanted to give their thoughts about that I'll read it |
22:59:17 | Araq | sure. 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:26 | MC__ | Hi guys. |
23:05:12 | MC__ | Araq & dom96: You may ask why I'm annoying you?, well, the true answer is because I'm alone. |
23:06:04 | vktec | MC__: If that's true, then perhaps be friendly rather than annoying ;) |
23:08:39 | vktec | I 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:51 | vktec | Wow, that was a confusing sentence :D |
23:08:58 | Xe | yeah lol |
23:09:05 | Xe | do you mean like outside of the realm of `nake`? |
23:09:11 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:09:20 | Xe | because well |
23:09:21 | * | vktec has never heard of nake |
23:09:23 | Xe | actually |
23:09:27 | Xe | i have a terrible idea |
23:09:36 | Xe | an in fact |
23:09:43 | vktec | I'm all ears :) |
23:09:53 | Xe | you 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:10 | vktec | Cool |
23:10:13 | Xe | all you need is a bunch of exposed functions in C space to do all the dirty configuration work |
23:10:19 | Xe | then make nim niceness around that |
23:10:43 | vktec | So how would I read the configuration files? |
23:10:47 | Xe | just make sure to compile your configuration as a shared object and get nim to manually load an execute that function |
23:11:09 | Xe | note: this is a bad idea |
23:11:17 | vktec | Is there a better way? |
23:11:17 | Araq | vktec: use nimscript for this. |
23:11:27 | vktec | Araq: Okay. |
23:11:43 | Xe | i like the idea of a .so configuration system |
23:11:49 | * | akaisora__ joined #nim |
23:11:52 | vktec | Araq: Can you provide a code snippet to show how I'd do that? |
23:11:54 | Araq | or: instead of a program, write a library |
23:12:05 | vktec | I remember struggling with NimScript a while back |
23:12:18 | vktec | Araq: It's a per-project configuration file |
23:12:25 | Araq | people can import your library and the config is the main program |
23:12:28 | vktec | So that's not ideal |
23:12:38 | Xe | we really need to write ffi support for the nimrodvm |
23:12:46 | Xe | hmm |
23:12:53 | Xe | what would that entail exactly? |
23:12:56 | * | MC__ quit (Ping timeout: 250 seconds) |
23:13:56 | Araq | I wrote FFI support for the VM twice. |
23:14:18 | Xe | why not include it then? |
23:14:55 | Araq | the code still exists in compiler/evalffi.nim |
23:15:36 | Araq | I don't want to support it. |
23:15:59 | Xe | how come? |
23:16:42 | * | saml_ joined #nim |
23:17:15 | * | zodiak joined #nim |
23:18:10 | dom96 | ooh https://www.youtube.com/watch?v=yXYV_srRDaw |
23:18:31 | vktec | So.... any code I can look at for loading a NimScript config into my Nim program? |
23:18:52 | Araq | vktec: Nimble does it |
23:19:04 | Araq | look at its code for an extensive example |
23:19:18 | vktec | Yeah, I remember looking at that a while ago, is that the best example? |
23:20:10 | Araq | compiler/nimeval.nim is a better starting point |
23:20:24 | Araq | but only shows how to run Nim code as a string |
23:20:34 | * | desophos quit (Remote host closed the connection) |
23:20:47 | vktec | Okay |
23:21:14 | vktec | So I could load it from the file and then run it using the method shown there? |
23:21:18 | Araq | Xe: people report strange crashes that I then have to look at |
23:21:58 | Araq | vktec: usually you need the script to call functions from your program |
23:22:08 | * | desophos joined #nim |
23:22:11 | Araq | so ... it's never this easy and you need to look at Nimble |
23:22:12 | vktec | Araq: Yeah |
23:22:16 | vktec | Okay |
23:22:36 | vktec | I'll see what I can do, thanks Araq |
23:22:39 | Araq | but what about my "don't write programs, write libraries instead" idea? |
23:22:50 | Xe | ^ it worked for xmonad |
23:23:12 | vktec | I'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:29 | vktec | I 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:35 | Araq | yes |
23:29:45 | vktec | Thanks |
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:48 | Demos | what 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:41 | Araq | Demos: VSCode + nim plugin seems to be the best currently |
23:49:43 | Demos | cool. I quite like VSCode |
23:49:49 | Demos | thanks |
23:53:02 | Demos | also 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:10 | Araq | yummy |
23:59:56 | * | yglukhov quit (Ping timeout: 250 seconds) |