00:03:39 | * | rnrwashere quit (Remote host closed the connection) |
00:04:49 | * | noeontheend joined #nim |
00:06:41 | * | seni quit (Quit: Leaving) |
00:10:37 | * | rnrwashere joined #nim |
00:11:39 | * | rnrwashere quit (Read error: Connection reset by peer) |
00:11:58 | * | rnrwashere joined #nim |
00:13:26 | * | rnrwashe_ joined #nim |
00:16:08 | * | rnrwashere quit (Ping timeout: 246 seconds) |
00:18:00 | * | rnrwashe_ quit (Ping timeout: 255 seconds) |
00:23:02 | * | c3v0axz quit (Ping timeout: 250 seconds) |
00:26:07 | * | noeontheend quit (Ping timeout: 240 seconds) |
00:32:32 | * | rnrwashere joined #nim |
00:35:13 | * | rnrwashere quit (Remote host closed the connection) |
00:35:18 | * | rnrwashe_ joined #nim |
00:35:24 | * | rnrwashe_ quit (Remote host closed the connection) |
00:39:49 | * | vlad1777d quit (Remote host closed the connection) |
00:40:51 | * | vlad1777d joined #nim |
00:50:55 | * | rnrwashere joined #nim |
01:02:39 | * | rnrwashere quit (Remote host closed the connection) |
01:03:56 | * | rnrwashere joined #nim |
01:04:58 | * | sz0 joined #nim |
01:12:48 | * | rnrwashere quit (Remote host closed the connection) |
01:32:31 | * | rockcavera joined #nim |
01:38:08 | * | dddddd quit (Remote host closed the connection) |
02:06:57 | * | banc quit (Quit: Bye) |
02:27:30 | * | banc joined #nim |
02:48:04 | * | i_Right_i quit (Remote host closed the connection) |
02:50:02 | FromGitter | <deech> If I know an object's size will fit is there any way I can allocate it on the stack instead of the heap? This is assuming no GC option is enabled. |
02:52:53 | FromGitter | <mratsim> objects are on stack by default |
02:53:13 | FromGitter | <mratsim> type Foo = object means it's stack (unless it is used in a container) |
02:54:04 | FromGitter | <deech> Oh cool! I had no idea. Is this somewhere in the manual? In that case I also have a similar question about seq's. |
02:55:31 | FromGitter | <mratsim> seqs are on the heap but use value semantics |
02:57:58 | FromGitter | <mratsim> It's not in the manual. I suppose that's because the manua is supposed to specify what Nim should look like at a high level (value semantics/ref semantics) and that stack/heap alloc is a low-level detail. But better ask @Araq |
02:58:37 | FromGitter | <deech> So there's no way to tell the runtime to allocate a seq on the stack if I know it won't overflow? |
02:59:14 | FromGitter | <mratsim> Use an array |
02:59:27 | FromGitter | <deech> Awesome. |
02:59:42 | FromGitter | <mratsim> Alternatively feel free to use that: https://github.com/numforge/laser/blob/master/laser/dynamic_stack_arrays.nim |
03:00:57 | FromGitter | <deech> Precisely what I wanted. Thanks! |
03:08:12 | FromGitter | <kayabaNerve> Why can a func call raise, but not getCurrentException? |
03:08:44 | leorize | what do you mean? |
03:08:49 | FromGitter | <kayabaNerve> I mean, aren't raise and `raise (ref CurrentException)(getCurrentException())` the same? |
03:09:15 | FromGitter | <kayabaNerve> `raise`, with nothing else, raises the current exception, keeping the type and data. |
03:09:35 | FromGitter | <kayabaNerve> getCurrentException returns the current Exception, without its type, and must be casted. |
03:10:02 | FromGitter | <kayabaNerve> I'm trying to 'manually' raise so I don't have to deal with ReraiseError |
03:10:43 | FromGitter | <kayabaNerve> That said, you can't call gCE from a func. I'm trying to check if there's a reason for this. It seems... inconsistent6 |
03:11:38 | leorize | you can call gCE from a func |
03:12:07 | leorize | http://ix.io/1FIj/nim |
03:13:00 | leorize | also it seems like the exception handler can do dynamic dispatch, as the exception type is kept for the re-raise with `getCurrentException()` |
03:16:48 | leorize | ah, you mean from a `func` |
03:17:27 | leorize | yea it looks like a bug |
03:20:32 | * | noeontheend joined #nim |
03:24:51 | FromGitter | <kayabaNerve> LOL |
03:24:59 | FromGitter | <kayabaNerve> Yeah, from a func :P |
03:25:46 | FromGitter | <kayabaNerve> I'll create an issue tomorrow |
04:02:07 | * | kapil____ joined #nim |
04:04:15 | * | noeontheend quit (Remote host closed the connection) |
04:16:20 | * | noeontheend joined #nim |
04:32:02 | * | uvegbot joined #nim |
04:33:02 | * | nsf joined #nim |
04:43:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
04:44:08 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:48:26 | * | nif quit (Read error: Connection reset by peer) |
04:49:01 | * | nif joined #nim |
05:08:58 | * | narimiran joined #nim |
05:13:50 | * | solitudesf joined #nim |
06:02:33 | * | solitudesf quit (Ping timeout: 245 seconds) |
06:20:25 | * | kapil____ quit (Quit: Connection closed for inactivity) |
06:23:52 | * | krux02 joined #nim |
06:24:15 | * | noeontheend quit (Ping timeout: 252 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:38 | * | gmpreussner joined #nim |
07:04:52 | * | PMunch joined #nim |
07:33:08 | livcd | how do I represent this in Nim ? https://glot.io/snippets/fb43trn74x |
07:42:58 | PMunch | for i in 0..<srvCount: echo lpservice[i].lpDisplayName, "n" |
07:43:02 | PMunch | Something like that? |
07:43:52 | PMunch | livcd ^ |
07:43:59 | * | absolutejam quit (Quit: WeeChat 1.9.1) |
07:45:57 | livcd | https://glot.io/snippets/fb4necjlnj |
07:46:02 | livcd | sorry I had to reboot |
07:47:14 | * | stefanos82 joined #nim |
07:51:22 | * | nc-x joined #nim |
07:52:22 | * | jxy_ quit (Quit: leaving) |
07:52:40 | * | jxy joined #nim |
07:53:26 | PMunch | livcd, what is LPDWORD here? |
07:53:32 | nc-x | livcd: according to microsoft docs, LPDWORD is a pointer. What are you expecting the loop to do? You will need to dereference srvcount |
07:54:23 | PMunch | Ah, it's a pointer to a DWORD |
07:54:35 | nc-x | PMunch: LPDWORD = Pointer to DWORD (uint32) |
07:55:07 | PMunch | Yeah |
07:55:39 | PMunch | But what does that original code do? Doesn't seem right to have it loop from 0 to some random pointer |
07:55:53 | PMunch | I think we need a bigger snippet livcd, in order to tell what you're actually trying to do here |
07:56:13 | livcd | ah ok |
07:56:14 | livcd | let me |
07:57:12 | livcd | so basically i am trying to do this in Nim https://glot.io/snippets/fb4noxtvts I am using winim's library for types and winapi procs |
07:57:23 | livcd | but i am sure i am not working with the types correctly :/ |
08:00:00 | * | kapil____ joined #nim |
08:02:11 | nc-x | livcd: In this code, srvCount is DWORD |
08:02:34 | nc-x | whereas in Nim, you are using LPDWORD |
08:05:45 | * | floppydh joined #nim |
08:10:31 | * | nc-x quit (Quit: Page closed) |
08:11:30 | livcd | oh you are right |
08:17:02 | livcd | But I am still struggling to translate this line: lpservice = new ENUM_SERVICE_STATUS [dwBytes]; and printf("%sn",lpservice[i].lpDisplayName); |
08:28:11 | leorize | the printf can be translated to this: `echo lpservice[i].lpDisplayName, "n"` |
08:29:23 | livcd | yes but i need the first line first :X |
08:54:11 | * | Vladar joined #nim |
08:59:01 | livcd | no tips ? ^^ |
08:59:48 | Araq | new T[] is newSeq[T]() |
09:04:12 | * | disruptek quit (Ping timeout: 245 seconds) |
09:14:41 | * | shomodj joined #nim |
09:17:19 | * | shomodj quit (Client Quit) |
09:41:27 | * | shomodj joined #nim |
09:57:49 | * | PMunch_ joined #nim |
09:58:04 | * | PMunch quit (Ping timeout: 250 seconds) |
10:03:18 | FromGitter | <alehander42> how to copy a node |
10:03:22 | FromGitter | <alehander42> deepCopy ? |
10:04:06 | FromGitter | <alehander42> NimN ode |
10:04:18 | * | abm joined #nim |
10:04:49 | FromGitter | <alehander42> it seems `.copy` |
10:08:31 | Araq | copyTree vs copyNode is in macros.nim |
10:08:34 | Araq | iirc |
10:11:38 | * | PMunch_ quit (Remote host closed the connection) |
10:12:13 | * | PMunch_ joined #nim |
10:16:49 | FromGitter | <alehander42> what is the difference between them and `.copy` o.O |
10:17:04 | Araq | I don't know .copy |
10:17:23 | FromGitter | <alehander42> copy is copyNimTree |
10:17:35 | FromGitter | <alehander42> i guess copyNimTree copies recursively |
10:17:39 | FromGitter | <alehander42> and copyNimNode shallowly |
10:18:41 | Araq | yup |
10:23:41 | * | c3v0axz joined #nim |
10:24:19 | Araq | lib\pure\os.nim(2465, 17) Hint: passing 'a' to a sink parameter introduces an implicit copy; use 'move(a)' to prevent it [Performance] |
10:24:29 | Araq | true ... bloody compiler is getting smart |
10:24:54 | Araq | lib\pure\parseopt.nim(384, 20) Error: internal error: '=destroy' operator not found for type seq[string] |
10:25:04 | Araq | damn :-) |
10:25:25 | Araq | time for lunch... |
10:30:04 | FromGitter | <alehander42> btw |
10:30:10 | leorize | Araq: now the question is when can the compiler decide that it could just do the `move()` automatically :p |
10:30:12 | FromGitter | <alehander42> how is docstring moved in nimnodes |
10:30:23 | FromGitter | <alehander42> when it's after <call>: |
10:30:28 | FromGitter | <alehander42> macro call |
10:30:49 | FromGitter | <alehander42> can i force it to be after a certain node |
10:30:52 | FromGitter | <alehander42> @krux02 ? |
10:33:40 | krux02 | currently you are lucky if you can access the docstring reliably. |
10:34:00 | krux02 | many docstrings you cannot access from macros at all. |
10:34:07 | FromGitter | <alehander42> hm but what about |
10:34:08 | FromGitter | <alehander42> when i do |
10:34:21 | FromGitter | <alehander42> a arg: ⏎ ## docstring ⏎ other code |
10:34:22 | krux02 | you can only access them when they are doc statemsts |
10:34:24 | FromGitter | <alehander42> ugh |
10:34:33 | FromGitter | <alehander42> i dont know if its visible in gitter |
10:34:34 | FromGitter | <alehander42> irc* |
10:34:42 | krux02 | it's not |
10:34:44 | FromGitter | <alehander42> so `##` doesn't matter |
10:35:08 | krux02 | the documentation comment needs to be it's own statement if you want to be able to acces it via macros. |
10:35:27 | FromGitter | <alehander42> the thing is , i see in repr that the macro result keeps the ## docstring somewhere, but i dont know why its after a certain node |
10:35:45 | FromGitter | <alehander42> so what is a document statement? |
10:36:05 | krux02 | a doccomment that is not within an expressien |
10:36:15 | FromGitter | <alehander42> ok, that's the case |
10:36:19 | krux02 | foo(); <newline> ## some doc |
10:36:20 | krux02 | this is ok |
10:36:27 | FromGitter | <alehander42> yes |
10:36:31 | FromGitter | <alehander42> ah |
10:36:34 | FromGitter | <alehander42> not exactly |
10:37:19 | dom96 | Araq: that's cool |
10:37:25 | FromGitter | <alehander42> https://paste.ofcode.org/U7mcZf6aa7d2hB2mWeGmjN |
10:37:35 | FromGitter | <alehander42> check is a macro |
10:37:45 | krux02 | that is ok too |
10:38:11 | krux02 | you have check with a stmtListExpr as argument and the first satement in the stmtListEXpr is the doc comment. |
10:38:12 | FromGitter | <alehander42> ahh |
10:38:20 | FromGitter | <alehander42> so it's just a direct child |
10:38:24 | krux02 | no |
10:38:25 | FromGitter | <alehander42> not a field or something |
10:38:26 | FromGitter | <alehander42> i see |
10:38:35 | krux02 | it is a direct child of the stmtListExpr |
10:38:49 | FromGitter | <alehander42> ok, some kind of a child |
10:38:53 | krux02 | the stmtListEXpr has only one child if I see it correctly |
10:39:02 | krux02 | but without the stmtListExpr it is invalid |
10:39:29 | FromGitter | <alehander42> is stmtListExpr used for anything else |
10:40:00 | krux02 | with stmtListEXpr you can inject visible doc comments to anything expression |
10:40:31 | krux02 | stmtListExpr is everywhere in nim |
10:41:33 | FromGitter | <alehander42> interesting, because dumpTree shows me just a CommentStmt |
10:41:34 | krux02 | stmtList and stmtListExpr has the sematical difference that a stmtListExpr is an expression that can be used for example as a function argument, where a stmtList i just top level |
10:41:44 | FromGitter | <alehander42> is it swallowed or is it possible that i use an older nim |
10:42:04 | krux02 | ? |
10:42:10 | krux02 | what do you want? |
10:42:31 | krux02 | what is swallowed? |
10:42:34 | FromGitter | <alehander42> i expected that dumpTree will also show "StmtListExpr: .. CommentStmt" |
10:42:43 | krux02 | it should |
10:43:18 | FromGitter | <alehander42> hm i use a month-old nim, i should update |
10:43:48 | krux02 | well I tested it, dump tree emits a stmtList, not a stmtList expr |
10:44:01 | FromGitter | <alehander42> yeah |
10:44:21 | krux02 | the difference betweenStmtList expr got lost somewhere in the development of Nim. |
10:44:30 | FromGitter | <alehander42> sorry |
10:44:41 | FromGitter | <alehander42> well i guess it doesnt make a big difference for me\ |
10:44:45 | FromGitter | <alehander42> i am glad that i can access it |
10:46:17 | krux02 | you can't acces any doccomments that are part of a let section or type section though |
10:47:17 | FromGitter | <alehander42> can i insert a docstring into a type section then |
10:47:42 | FromGitter | <alehander42> i generate a type section based on my args |
10:47:44 | krux02 | you can insert it, yes, but you can't acces it from macros |
10:47:47 | FromGitter | <alehander42> and i want to insert the docstring there |
10:47:49 | FromGitter | <alehander42> ok |
10:48:16 | FromGitter | <alehander42> cool |
10:48:17 | FromGitter | <alehander42> thanks a lot |
10:55:53 | narimiran | @alehander42 while we're at documentation topic: any news about jsffi documentation? :) |
10:57:22 | * | stefanos82 quit (Remote host closed the connection) |
11:04:17 | dom96 | where is the Nim evangelism? https://news.ycombinator.com/item?id=19610199 (narimiran?) |
11:04:41 | narimiran | dom96: it is in reddit thread about it :P |
11:05:09 | dom96 | HN has far more presence than Reddit |
11:05:39 | narimiran | ...and far more of "oh, nim-fanboys strike again" ;) |
11:06:53 | dom96 | There is a balance |
11:07:09 | dom96 | And I don't even see any comments by any of you guys on that reddit thread |
11:07:16 | dom96 | when someone is asking for a comparison |
11:07:18 | livcd | uhm I lost all the replies |
11:07:42 | livcd | still did not figure out how to do: lpservice = new ENUM_SERVICE_STATUS [dwBytes]; |
11:08:57 | * | dddddd joined #nim |
11:13:18 | leorize | @livcd Araq said you should use newSeq |
11:16:03 | livcd | ahmmm like this ? let lpServices = newSeq[ENUM_SERVICE_STATUS](dwBytes) |
11:16:24 | narimiran | livcd: there is always https://irclogs.nim-lang.org/ to look what has been written ;) |
11:17:28 | * | solitudesf joined #nim |
11:20:28 | * | PMunch_ is now known as PMunch |
11:21:30 | livcd | ty |
11:22:10 | livcd | https://glot.io/snippets/fb4tbllrsj |
11:27:38 | FromGitter | <alehander42> narimiran: sorry, i really have to take a look at it |
11:35:36 | * | kobi7 joined #nim |
11:38:31 | * | pwntus quit (Remote host closed the connection) |
11:41:56 | * | lritter joined #nim |
11:48:46 | * | pwntus joined #nim |
11:48:46 | * | pwntus quit (Changing host) |
11:48:46 | * | pwntus joined #nim |
12:00:51 | * | Etheco quit (Read error: Connection reset by peer) |
12:01:13 | * | Etheco joined #nim |
12:08:57 | * | kapil____ quit (Quit: Connection closed for inactivity) |
12:25:27 | * | uvegbot quit (Ping timeout: 240 seconds) |
12:25:59 | * | lritter quit (Read error: Connection reset by peer) |
12:27:30 | * | uvegbot joined #nim |
12:28:28 | FromGitter | <liquid600pgm> do converters take precedence over overloads? |
12:28:37 | FromGitter | <liquid600pgm> overloads and generics*, that is |
12:29:12 | PMunch | liquid600pgm, don't think so |
12:46:10 | * | Snircle joined #nim |
13:12:12 | FromGitter | <arnetheduck> ugh, write a nim wiki page on nim-vs-whatever so as to have somewhere to deflect zealots to, but why feed the trolls on a thread that's there to celebrate the release? |
13:15:11 | * | kobi7 quit (Quit: Leaving) |
13:17:03 | * | Vladar quit (Remote host closed the connection) |
13:25:31 | * | lritter joined #nim |
13:30:52 | FromGitter | <arnetheduck> is there any reason why unread globals are not dead-code-eliminated? I'm looking at the generated code, and there are some globals in there that pollute the generated code even though they're not used - trivial example is `nim_program_result` |
13:33:16 | Araq | that one is marked with .exportc and thus cannot be removed |
13:36:17 | FromGitter | <arnetheduck> oh. ouch. but I tried it with a simple `var x: int` as well |
13:37:05 | Araq | maybe it never was implemented for vars :-) |
13:39:18 | FromGitter | <arnetheduck> wdyt of removing nim_program_result? :) it's one of the things with pretty shaky semantics - ie creating a nim library means having multiple copies of it, it's a shared writable global, list goes on |
13:44:41 | FromGitter | <arnetheduck> in particular, I'm seeing it turn up with `--os:standalone` in a way that doesn't really make sense - when writing an without the `c` library, you end the process with the `exit` syscall, would be easier to get to a zero-cost / raw nim compile without it |
13:46:27 | FromGitter | <arnetheduck> but, this is a peculiarity of linux/unix - on other systems, it will be different |
13:46:58 | FromGitter | <arnetheduck> (think controllers, embedded, bioses, kernels etc) |
13:54:41 | * | nsf quit (Quit: WeeChat 2.4) |
13:55:12 | * | PMunch quit (Remote host closed the connection) |
14:32:29 | Araq | arnetheduck: it should never have been added |
14:43:00 | livcd | so this somehow works as GetLastError() returns at least some error codes but I am still not there yet for the commented lines :O https://glot.io/snippets/fb4yv2f2qo |
14:44:20 | FromGitter | <arnetheduck> I can do a `{.deprecated.}` pr :) |
14:44:26 | Araq | +1 |
14:44:35 | Araq | unittest.nim uses it iirc |
14:47:06 | * | Trustable joined #nim |
14:48:18 | FromGitter | <arnetheduck> unittest can have it's own ugly global and deal with the semantic nuances as it sees fit |
14:48:47 | FromGitter | <arnetheduck> we've been close to forking off unittest several times as well, it has some fundamental flaws that will be hard to solve otherwise |
14:48:58 | Araq | exactly. |
14:49:11 | Araq | I want to make 'testament' Nim's general testing tool |
14:49:32 | Araq | as I believe a tool is better than a "framework" for this |
14:50:00 | Araq | for instance, you can then easily write tests that the compiler/macro system produces nice error messages |
14:50:32 | Araq | and I enjoy the process isolation for running tests in parallel |
14:51:04 | FromGitter | <arnetheduck> eh, that I'm not sure about yet.. testament is a bit clunky for run-of-the-mill tests in applications - stdio is generally a bit coarse as far as granularity goes and requires non-trivial marshalling |
14:51:58 | FromGitter | <arnetheduck> I mean, it's good for the compiler that it's external, but not all things will be like this.. |
14:52:39 | Araq | sure it's clunky but it's also battle-tested and has lots of features |
14:53:18 | Araq | and getting the logic right is often surprisingly tricky |
14:54:21 | Araq | but hey, you don't have to agree with me ;-) |
14:55:45 | FromGitter | <arnetheduck> well, I could still use that exclude feature in it ;) |
14:56:42 | FromGitter | <arnetheduck> also, the megatest thing is a bit.. brittle. since you enjoy process isolation, you start using tests that subtly rely on it (ordering for example, like those pesky dll tests) |
14:57:09 | Araq | for NLVM yes, but we also need a general 'testament <mydir>' |
14:58:05 | FromGitter | <arnetheduck> well, I a PR on that long ago, that split up test discovery and running into a two-stage pipeline, making such things much easier to implement |
14:59:54 | FromGitter | <arnetheduck> anyway, with `func`/nosideffect and a few other goodies, the test running could actually detect when it's safe to reorder tests, and thus combine them into a megatest |
15:01:24 | * | tiorock joined #nim |
15:01:24 | * | tiorock quit (Changing host) |
15:01:24 | * | tiorock joined #nim |
15:01:24 | * | rockcavera is now known as Guest56826 |
15:01:24 | * | Guest56826 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
15:01:24 | * | tiorock is now known as rockcavera |
15:12:55 | Araq | arnetheduck: I know, I didn't like the PR because I don't want testament to use threading, regardless how stable/shitty Nim's threads are |
15:14:59 | FromGitter | <arnetheduck> that went away in a later commit to use processes (_also_ because the threads were broken even for the very simple usage 😛), but then there was something else as well, and I didn't have time to deal with it |
15:15:18 | Araq | it uses processes for concurrency and only because it has to ;-) |
15:15:46 | Araq | btw we now have tests for testament itself |
15:17:14 | Araq | and they are a bit flawed iirc, if I change the logic to always return "green" then its tests are green too because testament is used for testing itself... |
15:17:27 | FromGitter | <arnetheduck> well, the biggest problem I remember was actually that there were interdependent tests that required serial running and an isolated environment, and that requirement was hard-coded inside testament itself.. to make it generic, you'd need to implement a language to let tests themselves specify such constraints |
15:18:11 | FromGitter | <arnetheduck> think stuff where one test creates a particular file in a particular (shared, global) location, and another that reads it, or similar.. same story as with globals in code :) |
15:18:51 | Araq | yeah, these tests are bad, we rewrote at least one of them |
15:20:41 | Araq | every test that is now order dependent is in special category afaik |
15:20:43 | FromGitter | <arnetheduck> well, if someone is looking into it, I think that branch had a few good ideas.. by separating test discovery, it was also very easy to create test matrixes (so you can express running those combinations of gc, c/c++, etc easily) |
15:21:11 | Araq | we have some support for that via 'targets' in the spec section |
15:21:57 | FromGitter | <arnetheduck> well, I know because I added that too earlier :) but that branch laid the groundwork to make it generic |
15:22:35 | Araq | I don't think it was you but it also was broken and I had to fix the logic |
15:22:42 | Araq | was very annoying |
15:22:59 | shashlick | @narimiran: any idea why this is failing only on windows x64 - https://travis-ci.org/nim-lang/nightlies/jobs/517617808#L7978 |
15:23:04 | Araq | somebody used 'continue' in the loop and so it would skip the test counting and the numbers were off :P |
15:23:09 | FromGitter | <arnetheduck> ok, maybe not.. I remember doing something with it, because I needed to exclude c++ tests in nlvm :) |
15:23:34 | CcxWrk | Are negative indices allowed for strings/sequences? (Python-like indexing from end) |
15:23:49 | FromGitter | <alehander42> ^index |
15:23:53 | FromGitter | <arnetheduck> ah yeah, I might have added the command line option to exclude some targets |
15:24:06 | FromGitter | <alehander42> Instead of -index |
15:24:09 | narimiran | CcxWrk: you use `^1` for the last index, and so on |
15:24:31 | Araq | shashlick, gah are nightlies broken *again*? |
15:25:15 | narimiran | Araq: well, you broke devel yesterday evening ;) |
15:25:49 | narimiran | tonight's nightlies should be fine if nothing breaks devel in the mean time |
15:27:41 | Araq | ok... |
15:28:19 | CcxWrk | Hmm, not sure if that's exactly what I want, but thanks. Can I use multiple iterators in lockstep? (for x, y in zip(...)) |
15:31:42 | * | stefanos82 joined #nim |
15:32:53 | shashlick | funny cause xmltree.nim hasn't changed since Feb 20 so looks like oserror is a random failure - let me restart that job to see if it passes now |
15:44:01 | * | rnrwashere joined #nim |
15:55:17 | * | floppydh quit (Quit: WeeChat 2.4) |
15:55:40 | krux02 | CcxWrk, you can only do that with closure iterators right now. Currently the best way to zip is to use indices |
15:57:05 | narimiran | CcxWrk: yes, this works http://ix.io/1FKR/ on nim devel (v0.19.9), not in previous/stable versions |
16:00:15 | CcxWrk | Thanks. FWIU zip() is a proc rather than iterator though, so it involves copying? Or was zip iterator added? |
16:04:51 | CcxWrk | I've solved it via computing indices here, but would definitely want this in the future on possibly lazy iterators. |
16:05:53 | CcxWrk | Does nim-lang.org/docs point to stable or dev? |
16:06:03 | FromGitter | <liquid600pgm> stable |
16:06:13 | FromGitter | <liquid600pgm> for dev, look here: https://nim-lang.github.io/Nim/ |
16:07:30 | CcxWrk | Hmm, still no zip(It) iterator there. But thanks! |
16:19:24 | * | rnrwashere quit (Remote host closed the connection) |
16:24:12 | federico3 | how can I do bitwise or between values of an enum? |
16:25:15 | federico3 | is there a cleaner way to do it? |
16:26:08 | federico3 | https://github.com/nim-lang/Nim/issues/4486 |
16:35:51 | * | c3v0axz quit (Ping timeout: 255 seconds) |
16:36:06 | * | c3v0axz joined #nim |
16:47:31 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:51:19 | FromGitter | <dawkot> How can you check if type `A` is `distinct B`? |
16:51:39 | FromGitter | <dawkot> it returns false when I do it the most obvious way |
16:51:43 | FromGitter | <dawkot> even though it shouldn't |
16:58:30 | FromGitter | <disruptek> how hard would it be to implement `pydoc` for nim? `ndoc`? seems doable. |
17:01:18 | narimiran | disruptek: you mean `nim doc <filename>`? |
17:03:58 | FromDiscord | <exelotl> I want to define a list structure that lets you delete from it while looping over it |
17:04:39 | shashlick | nice to see nightlies binaries getting downloaded, onesies/twosies and mostly windows |
17:05:10 | FromDiscord | <exelotl> like, for i,v in mpairs(mylist): if foo: mylist.removeAt(i) |
17:05:27 | FromDiscord | <exelotl> and then `i` would be corrected for the next iteration of the loop |
17:07:04 | narimiran | shashlick: it seems that restarting that one test helped with nightlies :) |
17:07:15 | shashlick | yep random failure |
17:09:53 | * | NimBot joined #nim |
17:10:28 | * | disruptek joined #nim |
17:14:27 | * | nsf joined #nim |
17:16:53 | * | shomodj joined #nim |
17:30:23 | * | rockcavera quit (Remote host closed the connection) |
17:34:13 | FromGitter | <dawkot> ```code paste, see link``` ⏎ ⏎ why [https://gitter.im/nim-lang/Nim?at=5cacd794a0790b29c98b88be] |
17:40:58 | * | rockcavera joined #nim |
17:41:06 | * | neceve quit (Read error: Connection reset by peer) |
18:02:04 | * | narimiran quit (Read error: Connection reset by peer) |
18:02:34 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:04:38 | * | narimiran joined #nim |
18:05:00 | * | neceve joined #nim |
18:09:32 | FromGitter | <liquid600pgm> why would you use a macro here anyways? |
18:10:07 | FromGitter | <dawkot> it's just a minimal example |
18:10:24 | * | narimiran quit (Read error: Connection reset by peer) |
18:10:41 | * | narimiran joined #nim |
18:14:56 | * | Jesin quit (Quit: Leaving) |
18:15:25 | FromGitter | <dawkot> Also, any idea why the last line raises? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cace13d0aad63501956d4d6] |
18:21:14 | * | narimiran quit (Read error: Connection reset by peer) |
18:25:40 | * | narimiran joined #nim |
18:26:06 | * | theelous3__ joined #nim |
18:33:10 | * | drewr quit (Remote host closed the connection) |
18:37:22 | * | narimiran quit (Ping timeout: 246 seconds) |
18:39:09 | * | drewr joined #nim |
18:42:38 | * | narimiran joined #nim |
18:44:48 | * | Jesin joined #nim |
18:45:26 | * | neceve quit (Remote host closed the connection) |
18:53:58 | Araq | I doubt concepts work with hasPragma |
18:54:11 | Araq | hasPragma only works on NimNode, I guess? |
19:00:31 | federico3 | Araq: any documentation of using sets of enums and converting them to/from int? e.g. https://github.com/nim-lang/Nim/issues/4486 |
19:00:55 | Araq | 'cast' works |
19:02:49 | federico3 | I'll contribute some examples to the manual |
19:06:25 | Araq | ok ty |
19:09:27 | * | shashlick quit (Remote host closed the connection) |
19:10:41 | * | rnrwashere joined #nim |
19:13:20 | FromGitter | <disruptek> narimiran: nah, `ndoc` would search for sources of documentation for the symbol supplied on the command-line. i think it's probably best implemented as a nimsuggest client. could probably be done in shell. |
19:30:02 | * | uvegbot quit (Quit: Konversation terminated!) |
19:30:08 | * | zyklon joined #nim |
19:37:58 | FromGitter | <liquid600pgm> gosh, OpenGL textures are driving me nuts |
19:38:29 | FromGitter | <liquid600pgm> why is my texture not being rendered at all? the sampler just returns black texels |
19:41:08 | FromGitter | <liquid600pgm> I've been debugging it this whole day and I just can't see it |
19:41:23 | Zevv | glEnable(GL_TEXTURE_2D) :) |
19:41:34 | FromGitter | <liquid600pgm> what!? |
19:41:39 | FromGitter | <liquid600pgm> that's the problem!? |
19:41:45 | Zevv | I don't know |
19:41:51 | Zevv | I always have problems with opengl |
19:42:05 | Zevv | and this was one that happened to me years ago |
19:42:17 | FromGitter | <liquid600pgm> nope, not the case |
19:42:20 | FromGitter | <liquid600pgm> still black |
19:42:20 | Zevv | not sure if it even applies to modern GL, that was in the 1.0 time |
19:42:34 | Zevv | what was your repo url gain? |
19:42:37 | Zevv | s/gain/again/ |
19:42:41 | FromGitter | <liquid600pgm> https://github.com/liquid600pgm/rapid |
19:43:33 | Zevv | missing file 'glm' |
19:43:49 | FromGitter | <liquid600pgm> `nimble install glm` |
19:43:58 | Zevv | makes sense :) |
19:44:15 | * | sz0 joined #nim |
19:44:36 | FromGitter | <liquid600pgm> nim-glm is a very nice library, I use it because there's no point in re-inventing the wheel |
19:45:04 | FromGitter | <liquid600pgm> I'm even thinking about making a simple GLFW for Nim, I mean, how hard can it be |
19:45:22 | Zevv | what is the expected output? |
19:45:57 | FromGitter | <liquid600pgm> a 64×64 rectangle with this texture https://github.com/liquid600pgm/rapid/blob/master/sampleData/logo-4x.png |
19:46:21 | Zevv | I get a diagonal gradient green to red only |
19:46:35 | FromGitter | <liquid600pgm> aah, forgot the commit |
19:47:10 | FromGitter | <liquid600pgm> try now |
19:47:36 | Zevv | black :) |
19:48:00 | * | Trustable quit (Remote host closed the connection) |
19:48:08 | FromGitter | <liquid600pgm> yeah, and that's the problem |
19:48:30 | FromGitter | <liquid600pgm> there should be a textured rectangle in the top left corner |
19:49:16 | FromGitter | <liquid600pgm> I compared my old code with the new code in apitrace but I just can't see the problem |
19:49:36 | FromGitter | <liquid600pgm> and the old code worked perfectly |
19:49:46 | FromGitter | <dawkot> is there any reason you're not using more high-level libraries? |
19:50:10 | FromGitter | <liquid600pgm> yes, I want to learn OpenGL, finally |
19:50:37 | FromGitter | <liquid600pgm> I used so many high-level libraries for a long time now so I thought learning OpenGL might be a good next step |
19:55:22 | FromGitter | <dawkot> it seems to me that unless you already know what you're doing, it's better to start with something high level that's not too intrusive because you can always replace its rendering calls whenever you feel like it |
19:55:28 | FromGitter | <dawkot> if it really is not intrusive |
19:58:10 | FromGitter | <liquid600pgm> the problem is, I am already experienced in high-level libs and I wanted to make my own to create an API I like |
19:58:11 | * | rockcavera quit (Remote host closed the connection) |
19:58:59 | Zevv | so if you put hardcoded colors in your shader you get output, right |
19:59:08 | FromGitter | <liquid600pgm> yes |
19:59:08 | * | shashlick joined #nim |
19:59:13 | * | shashlick quit (Remote host closed the connection) |
19:59:26 | FromGitter | <liquid600pgm> it's the sampler that returns zeroes |
19:59:38 | FromGitter | <liquid600pgm> and makes everything black |
19:59:38 | * | shomodj joined #nim |
20:00:06 | FromGitter | <liquid600pgm> I'm sure the right data is sent to OpenGL, I checked that with apitrace |
20:01:54 | * | shashlick joined #nim |
20:06:26 | Araq | today I made koch.nim work with --newruntime, a significant milestone |
20:07:00 | Zevv | \o/ Congrats Araq! |
20:07:52 | Araq | thanks |
20:08:09 | Araq | tomorrow I'll test callbacks and .async |
20:08:27 | Araq | which is the most risky part in this experiment |
20:09:17 | Araq | the changes so far are really just adding 'owned' where the compiler tells me to do so |
20:09:23 | Zevv | liquid600pgm: I got your logo |
20:09:37 | Araq | crazy stuff :-) |
20:10:27 | Zevv | wow, lets get some stdlib working as well :) |
20:11:36 | Araq | koch uses parseopt, strutils, osproc, os ... |
20:11:51 | Araq | that is "some stdlib" |
20:11:51 | Zevv | wow |
20:16:30 | Zevv | liquid600pgm: your problem is in setting your rTexEnable uniform, somehow: http://paste.debian.net/1076893/ |
20:16:44 | Zevv | Araq: so, is it already time to get our own code working with the newruntime? |
20:17:14 | Araq | I doubt it, the hard part is .async and callbacks |
20:20:09 | * | nsf quit (Quit: WeeChat 2.4) |
20:20:26 | * | jjido joined #nim |
20:22:18 | * | narimiran quit (Remote host closed the connection) |
20:27:11 | FromGitter | <liquid600pgm> Zevv: oh wow, I never thought of that. the strange part is, if I hardcode the colors in the true branch it works just fine |
20:27:25 | * | rockcavera joined #nim |
20:28:22 | Zevv | I guess you're settign the wrong uniform |
20:28:26 | FromGitter | <liquid600pgm> I think it's a problem with the GLSL compiler optimizing stuff away. I might have to create a texel function which will return white when the texture is disabled |
20:29:17 | Zevv | it doesn't matter if you set it to 0 or to 1, it breaks either way |
20:29:23 | FromGitter | <liquid600pgm> I'll leave that for tommorow, I'm tired and I gotta get some sleep |
20:43:28 | Zevv | liquid600pgm: in case you're still here: your with() template is wrong. It restores to an invalid state when you use it the first time. |
20:43:56 | Zevv | currentProgram vs ctx.program |
20:44:05 | Zevv | "don't use globals" :) |
20:45:01 | Zevv | add `currentProgram = program.id` to `program=` is your fix |
20:57:34 | * | rnrwashere quit (Remote host closed the connection) |
21:00:24 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:04:34 | * | jjido joined #nim |
21:09:50 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:22:32 | * | noeontheend joined #nim |
21:28:53 | * | noeontheend quit (Remote host closed the connection) |
21:48:40 | * | rnrwashere joined #nim |
21:49:23 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:53:30 | * | theelous3__ quit (Ping timeout: 250 seconds) |
22:04:47 | * | stefanos82 quit (Remote host closed the connection) |
22:06:02 | * | shomodj joined #nim |
22:16:41 | * | Etheco quit (Ping timeout: 246 seconds) |
22:42:16 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:44:36 | * | stefantalpalaru joined #nim |
22:44:41 | * | MightyJoe quit (Ping timeout: 246 seconds) |
22:45:20 | * | cyraxjoe joined #nim |
22:45:26 | stefantalpalaru | Does anyone have a macro for importing constants from C headers, as described here: https://github.com/nim-lang/Nim/issues/4441#issuecomment-230441949 ? |
23:01:38 | shashlick | what are you trying to wrap |
23:03:18 | stefantalpalaru | It doesn't matter. This is valid for all C header defines. I'm trying to avoid typing two lines per import instead of one. |
23:04:18 | shashlick | if i can see some code, i'll better understand what you are trying to do |
23:04:42 | shashlick | perhaps even add it to nimterop |
23:05:47 | stefantalpalaru | Have you seen the issue comment I linked to? Assume that the header "foo.h" used as an example contains "#define BAR 1". |
23:07:06 | shashlick | no, #define doesn't exist in the C binary, it's like a text replace |
23:07:17 | stefantalpalaru | Running c2nim on it will result in "const BAR = (1)", but you want to do an {.importc.} instead of copying that value, in case upstream changes it at some point. |
23:08:00 | stefantalpalaru | We're talking compile time header inclusion here, not runtime symbols. |
23:08:06 | shashlick | that issue is talking of static constants, not preproc defs |
23:08:21 | stefantalpalaru | Same thing. |
23:09:51 | shashlick | #defs are used as constants, doesn't mean they actually exist in memory as is |
23:09:56 | shashlick | let is pointing to memory |
23:11:57 | stefantalpalaru | You're arguing the wrong thing. Try it and convince yourself that it works like I'm already seeing it working. Now, I've tried a quick and dirty "quote do" macro with no luck. I need manual AST construction and thought to ask if someone already wrote it since 2016. |
23:12:33 | shashlick | okay cannot do much if you don't show me any code |
23:13:34 | * | krux02_ joined #nim |
23:13:48 | * | krux02_ quit (Remote host closed the connection) |
23:16:11 | stefantalpalaru | See line 89: https://gist.github.com/stefantalpalaru/b54bf0ee500d75d51fe6b35b3d82d0c5 |
23:16:15 | * | krux02 quit (Ping timeout: 252 seconds) |
23:18:00 | stefantalpalaru | And line 14 here: https://github.com/miniupnp/miniupnp/blob/master/miniupnpc/upnpcommands.h |
23:18:54 | stefantalpalaru | If I didn't make myself clear, the wrapper is fully working. I just don't like the verbosity of that scheme. |
23:19:22 | shashlick | okay I get what you are saying, just didn't expect nim to importc #defines as well |
23:19:29 | shashlick | nim's too smart for me |
23:20:18 | shashlick | http://nim-lang.github.io/Nim/manual.html#templates-identifier-construction <= this will help |
23:21:59 | stefantalpalaru | It's easier to understand by thinking about the C output. As long as you don't try to get the address of a let symbol, Nim doesn't care what it points to, so when the corresponding header is included in the resulting C file, it's just replaced by the C preprocessor with a literal value. |
23:22:33 | stefantalpalaru | Identifier construction doesn't seem to work inside the double quotes I need for the pragmas. |
23:23:23 | shashlick | okay, gotta run but will check in an hour |
23:23:56 | shashlick | here's the two spots i've used inject in the past - https://github.com/genotrance/feud/blob/master/src/plugin.nim#L13 |
23:24:24 | shashlick | https://github.com/genotrance/nimgen/blob/master/src/nimgen/file.nim#L99 |
23:24:29 | shashlick | in case it helps, bbl |
23:29:28 | * | lritter quit (Quit: Leaving) |
23:41:01 | * | rnrwashere quit () |
23:45:13 | shashlick | So while you pursue that, the way I have done wrappers with nimgen and now nimterop is to generate them automatically rather than have a static copy checked in |
23:45:29 | shashlick | That way, the wrappers stay up to date as upstream changes |
23:45:51 | shashlick | Then you don't care if it is a const or a let |
23:55:23 | stefantalpalaru | I don't trust automated wrapping done by external tools, in the long run. Something like this should be done by the compiler, with a thoroughly tested mechanism that doesn't bail on simple preprocessor defines like c2nim. I also don't like adding new build dependencies, even cool ones like these. |