00:00:11 | flaviu | Does that play nice with autocomplete? |
00:00:31 | Araq | not yet |
00:00:43 | Araq | for reasons that currently escape me |
00:00:49 | Araq | but it's in my todo ... |
00:01:22 | * | mwbrown joined #nim |
00:01:57 | reactormonk | Araq, https://github.com/reactormonk/nim/commit/ceb7260a87827883de11c6a4d1e1d24d4916171d reasonable? |
00:02:35 | Araq | yup |
00:03:59 | EXetoC | Araq: "template t(e: expr) = e.foo" ... "getAst(t(someVar))" is it possible to take advantage of this when someVar does not refer to an identifier that has been defined outside the macro? say if that code resides in a macro like this "macro m(someVar: expr)" |
00:04:07 | EXetoC | the purpose being increased readability |
00:04:20 | reactormonk | Araq, push or PR? |
00:04:46 | EXetoC | I'll try something else |
00:05:34 | EXetoC | nope |
00:05:50 | Araq | reactormonk: push it |
00:06:06 | EXetoC | "foo(e)" to be specific |
00:06:13 | reactormonk | rebooting compiler just to make sure |
00:06:22 | Araq | oh i see |
00:06:27 | Araq | you never test your stuff |
00:07:36 | Araq | EXetoC: I'm rethinking expr/stmt and immediate but I don't understand what you mean |
00:07:46 | reactormonk | I have a certain threshold where I start testing a lot |
00:07:50 | EXetoC | ok |
00:08:27 | gmpreussner|work | thx dom96 :) |
00:12:58 | EXetoC | Araq: say if I do this instead "getAst(t(genSym()))" or by turning it into an identifier first. I then get "undeclared identifier: :tmp" |
00:19:42 | EXetoC | the template can be used for this situation: "forEach x, declaredVar: ..", but not for this: "forEach x, @[1, 2]: ..". I suppose there could be a feature more specific to templates for this purpose |
00:22:05 | Araq | still not sure what you're after but note that 'expr' makes .immediate superfluous |
00:23:47 | Araq | so ... good news is |
00:24:09 | Araq | Nim is getting a[^1] to access the last element |
00:24:10 | EXetoC | works: "t(declaredVar)", doesn't work: "t(newIdentifierNode($genSym()))" |
00:24:17 | EXetoC | so, very macro specific I guess |
00:24:32 | Araq | ah well, how can that work? |
00:24:32 | EXetoC | Araq: great |
00:24:32 | def- | Araq: very cool, no more foo.bar.baz[foo.bar.baz.high] |
00:24:51 | Araq | def-: want me to push it already? |
00:25:08 | def- | Araq: if it's ready and working, sure |
00:25:15 | EXetoC | Araq: that's why I thought that maybe it'd have to be a separate language feature |
00:25:29 | EXetoC | or maybe just a new pragma |
00:27:16 | BlaXpirit | Araq, what will ^ be replaced with? |
00:27:41 | BlaXpirit | if it's going to be len, don't forget to consider arrays that start with something other than 0 |
00:27:54 | * | reem quit (Remote host closed the connection) |
00:27:59 | dom96 | Araq: It will still be possible to overload `^` right? |
00:28:18 | def- | dom96: i hope so, `^` is in math |
00:29:00 | * | HakanD_________ quit (Quit: Be back later ...) |
00:29:02 | Araq | dom96: yes |
00:29:14 | Araq | BlaXpirit: a[^1] is rewritten to a[a.len-1] |
00:29:18 | EXetoC | the purpose is to replace complex node construction chains with the way the node would look in the source representation of the AST generated in the macro |
00:29:33 | BlaXpirit | Araq, what about array[5..10] |
00:29:56 | Araq | dunno what about it? |
00:30:09 | EXetoC | like above, but without the limitations, but maybe I'm omitting something |
00:30:14 | Araq | ah ok, I see |
00:30:23 | Araq | well that's a good point fuck |
00:30:26 | BlaXpirit | array[5..10] [^1] would be... 5 |
00:30:31 | flaviu | more syntax sugar :/ |
00:31:09 | EXetoC | why not? |
00:31:18 | BlaXpirit | i think this is a good opportunity to make the rear end 0-indexed as well |
00:31:40 | BlaXpirit | and consider making special syntax for both low,high instead of len |
00:31:43 | flaviu | .eval import macros; dumpLisp("123"[1.. ^2]) |
00:31:46 | Mimbus | flaviu: BracketExpr(StrLit(123), Infix(Ident(!".."), IntLit(1), Prefix(Ident(!"^"), IntLit(2)))) |
00:31:48 | * | banister is now known as banisterfiend |
00:32:11 | Araq | BlaXpirit: but then people coming from python cannot translate a[-1] to a[^1] |
00:32:23 | BlaXpirit | too bad |
00:32:23 | Araq | but need to translate it into a[^0] |
00:32:41 | BlaXpirit | easy for me to throw ideas.. |
00:32:49 | * | Senketsu quit (Quit: Leaving) |
00:32:51 | EXetoC | haven't we already deviated from some common things? |
00:33:09 | Araq | but your array point is a good one, we need to rewrite a[^1] to use 'high' |
00:33:19 | * | reem joined #nim |
00:33:40 | Araq | and then a[^0] is a[a.high-0] |
00:33:41 | BlaXpirit | ^ rewritten to high+1 ? :| |
00:33:50 | Araq | yeah that sux |
00:34:24 | EXetoC | yes |
00:34:30 | Araq | flaviu: technically speaking it's not the parser that changes |
00:34:43 | Araq | so there is not more syntax here. |
00:35:51 | BlaXpirit | hmmm funny thing is |
00:35:59 | BlaXpirit | if everything is compiletime optimized |
00:36:08 | BlaXpirit | and high is almost always defined as len - 1 |
00:36:34 | BlaXpirit | then maybe len - 1 + 1 will be optimized and no need to cry |
00:37:01 | Araq | what? that's already optimized on the C level |
00:37:16 | EXetoC | and then it can crash faster? :p |
00:37:24 | BlaXpirit | no i mean ^ = high+1 = len-1+1 |
00:37:30 | BlaXpirit | just wondering if it's good |
00:37:46 | Araq | I care about conceptual clarity here |
00:38:00 | Araq | -1+1 is optimized away anyway |
00:38:04 | BlaXpirit | hopefully |
00:38:23 | Araq | and if it isn't we can optimize it away |
00:39:26 | Araq | on the other hand ... who uses array [5..10] anyway? I only use it for lookup tables and for these I never use a[^1] |
00:39:35 | BlaXpirit | yeah, u should remove it |
00:39:59 | Araq | no, they are nice for array[low(enum)+1 .. high(enum)] etc |
00:40:00 | * | Senketsu joined #nim |
00:40:01 | BlaXpirit | the only thing i can come up with is |
00:40:13 | BlaXpirit | when you're doing ^, assert len==high-1 |
00:40:20 | BlaXpirit | uh +1 |
00:40:30 | Araq | aye |
00:40:39 | Araq | can do that easily |
00:40:50 | BlaXpirit | :> |
00:41:46 | BlaXpirit | ok so basically ^5 will be len-5 but it will work only when len-1 == high |
00:42:03 | Araq | yes |
00:42:13 | * | sampwing quit (Ping timeout: 252 seconds) |
00:43:44 | BlaXpirit | i dont know why i havent thought of this before (you probably did), but at first only warn about negative indices |
00:45:22 | Araq | that's in my proposal, yes |
00:45:51 | Araq | but we need to do "warning + here is the workaround" at the same time |
00:46:40 | BlaXpirit | sure |
00:47:30 | Araq | but it's a particularly nasty warning |
00:47:42 | Araq | that produces output at *runtime* |
00:48:01 | BlaXpirit | oh |
00:48:57 | Araq | er ... low+1 != len iff low != 0, right? |
00:49:15 | Araq | high+1 != len iff low != 0, I mean |
00:49:43 | BlaXpirit | interesting |
00:49:47 | BlaXpirit | sure seems to be the case |
00:50:43 | * | irrequietus quit () |
00:54:59 | * | jasondotstar joined #nim |
00:57:33 | * | alex99 joined #nim |
00:57:43 | * | ChrisMAN joined #nim |
00:58:29 | * | wink-s joined #nim |
00:59:33 | * | bcinman quit (Ping timeout: 248 seconds) |
01:00:33 | * | BlaXpirit quit (Quit: Quit Konversation) |
01:01:51 | * | bcinman joined #nim |
01:02:00 | * | bcinman quit (Remote host closed the connection) |
01:03:45 | * | bcinman joined #nim |
01:06:16 | * | gokr quit (Ping timeout: 255 seconds) |
01:06:35 | * | bcinman_ joined #nim |
01:08:21 | * | bcinman quit (Ping timeout: 250 seconds) |
01:18:44 | * | saml_ joined #nim |
01:19:48 | * | fizzbooze quit (Ping timeout: 272 seconds) |
01:20:09 | EXetoC | is gist broken or something? |
01:20:40 | * | bcinman joined #nim |
01:21:06 | * | bcinman quit (Read error: Connection reset by peer) |
01:23:01 | * | alex99 quit (Ping timeout: 246 seconds) |
01:24:14 | * | bcinman_ quit (Ping timeout: 272 seconds) |
01:27:55 | Araq | good night |
01:34:13 | * | wink-s quit (Ping timeout: 246 seconds) |
01:41:23 | * | hamgom95 joined #nim |
01:41:57 | fowl | this is one person http://en.wikipedia.org/w/index.php?title=Nim_(programming_language)&action=history |
01:42:03 | fowl | marking for deletion |
01:43:43 | * | fizzbooze joined #nim |
01:44:11 | fowl | all this user does is mark things for deletion |
01:45:43 | flaviu | fowl: There is no need to get upset or take it personally, and accusing that user isn't going to accomplish anything but make you look bad. |
01:46:17 | fowl | noted |
01:46:25 | fowl | my public image is my own concern |
01:48:38 | * | reem quit (Remote host closed the connection) |
01:49:22 | flaviu | Yes, completely correct, although questionable tactics might annoy them away from objectivity. |
01:49:48 | * | reem joined #nim |
01:55:26 | * | fizzbooze is now known as slash |
01:57:41 | * | darkf joined #nim |
02:09:35 | * | brson quit (Quit: leaving) |
02:17:12 | * | brson joined #nim |
02:29:53 | * | brson quit (Quit: leaving) |
02:32:56 | * | hamgom95 quit (Read error: Connection reset by peer) |
02:42:07 | * | Senketsu_ joined #nim |
02:42:45 | * | mwbrown_ joined #nim |
02:45:25 | * | Senketsu quit (Ping timeout: 250 seconds) |
02:45:25 | * | mwbrown quit (Ping timeout: 250 seconds) |
02:51:24 | * | Michael__ joined #nim |
02:51:34 | * | slash quit (Ping timeout: 255 seconds) |
02:51:48 | * | Michael__ is now known as Guest46822 |
02:55:51 | * | mwbrown_ quit (Ping timeout: 250 seconds) |
02:57:33 | * | vince- quit (Ping timeout: 250 seconds) |
02:57:41 | * | vinnie joined #nim |
03:08:00 | * | reem quit (Remote host closed the connection) |
03:09:46 | * | jefus_ joined #nim |
03:10:19 | * | saml_ quit (Quit: Leaving) |
03:12:47 | * | reem joined #nim |
03:13:37 | * | jefus quit (Ping timeout: 264 seconds) |
03:20:21 | * | noriok joined #nim |
03:20:42 | * | noriok quit (Client Quit) |
03:25:51 | * | slash joined #nim |
03:31:32 | * | slash quit (Ping timeout: 272 seconds) |
03:35:01 | * | jholland quit (Quit: Connection closed for inactivity) |
03:59:50 | * | Senketsu_ quit (Read error: Connection reset by peer) |
04:20:05 | * | fizzbooze joined #nim |
04:39:50 | * | Guest46822 quit (Ping timeout: 246 seconds) |
04:51:07 | * | polkm joined #nim |
04:52:32 | polkm | I have a ptr to a c style array how do I go about indexing a ptr like a nim array? |
05:02:21 | * | reem quit (Read error: Connection reset by peer) |
05:03:27 | * | reem joined #nim |
05:06:49 | fowl | polkm, cast it to an unchecked array |
05:07:08 | polkm | is that a keyword? |
05:07:11 | fowl | https://gist.github.com/fowlmouth/42c762d6ad81e7a4dfb9 |
05:07:39 | polkm | perfect thank you |
05:56:44 | polkm | do you think const file = readFile("foo.txt") could work? |
05:58:00 | fowl | polkm, there is a function for reading a file at compile time that would work there |
05:58:08 | fowl | staticRead() |
05:59:32 | cazov | fowl: you mean slurp? :] |
06:04:33 | polkm | Dank, but I am getting errors reading the file |
06:05:26 | polkm | I use the same path from readFile is that correct? |
06:20:16 | polkm | oh its working dir is different |
06:22:22 | reactormonk | polkm, yeah, const is evaluated compile-time, so you can't use readFile because there's no FFI at compile-time |
06:22:41 | reactormonk | ... that's what slurp is for. |
06:25:12 | * | reem quit (Remote host closed the connection) |
06:26:21 | reactormonk | how do I ensure stuff works with spawn? |
06:43:32 | * | gokr joined #nim |
06:45:43 | * | reem joined #nim |
06:45:55 | * | bjz joined #nim |
06:48:34 | * | reem quit (Remote host closed the connection) |
06:49:55 | * | reem joined #nim |
06:53:04 | * | reem quit (Remote host closed the connection) |
06:53:53 | * | reem joined #nim |
07:02:16 | * | fizzbooze quit (Ping timeout: 256 seconds) |
07:15:27 | * | Demon_Fox quit (Quit: Leaving) |
07:22:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:28:05 | * | gsingh93 quit (Ping timeout: 265 seconds) |
07:38:42 | * | bjz joined #nim |
07:40:02 | * | bjz quit (Client Quit) |
07:41:19 | * | bjz joined #nim |
07:46:51 | * | dtscode quit (Quit: ZNC - 1.6.0 - http://znc.in) |
07:47:59 | * | Ven joined #nim |
07:48:02 | * | dtscode joined #nim |
07:51:10 | * | bjz quit (Ping timeout: 250 seconds) |
07:52:55 | * | polkm quit (Ping timeout: 246 seconds) |
07:59:02 | * | ekarlso quit (Quit: WeeChat 0.4.3) |
08:06:59 | * | Ven quit (Ping timeout: 252 seconds) |
08:15:42 | * | BlaXpirit joined #nim |
08:17:41 | Araq | reactormonk: the point of merge ops is to mitigate the thread local heaps |
08:17:48 | Araq | so you do something like: |
08:17:57 | Araq | in parallel: |
08:17:59 | * | reem quit (Remote host closed the connection) |
08:18:30 | Araq | result.merge( ^someFlowVar) |
08:20:15 | Araq | and actually the language should ensure your merge is correct but I haven't thought too much about it and it needs much more testing anyway |
08:20:21 | * | reem joined #nim |
08:20:53 | * | johnsoft quit (Read error: Connection reset by peer) |
08:27:19 | * | reem quit (Remote host closed the connection) |
08:29:02 | * | johnsoft joined #nim |
08:33:37 | * | reem joined #nim |
08:36:06 | * | bjz joined #nim |
08:41:39 | * | HakanD_________ joined #nim |
08:47:40 | * | reem quit (Remote host closed the connection) |
08:48:28 | * | HakanD_________ quit (Quit: Be back later ...) |
08:49:11 | * | reem joined #nim |
08:52:10 | * | reem quit (Remote host closed the connection) |
08:53:12 | * | BlaXpirit_ joined #nim |
08:56:19 | * | BlaXpirit quit (Ping timeout: 256 seconds) |
08:59:11 | * | reem joined #nim |
09:03:43 | * | Trustable joined #nim |
09:11:22 | * | Ven joined #nim |
09:14:03 | * | Sembei joined #nim |
09:16:40 | * | wb quit (Read error: Connection reset by peer) |
09:18:46 | * | HakanD_________ joined #nim |
09:42:58 | gokr | Hmmm, the IDE support for VS, is that https://github.com/barcharcraz/VisualNimrod ? |
09:43:16 | Araq | I think so |
09:43:39 | Araq | maybe we can summon Demos who wrote it |
09:56:57 | gokr | I am writing a followup article for yesterday |
09:57:12 | gokr | Wanted to pick up a few loose ends I missed, like IDE support for example |
09:57:33 | * | ekarlso joined #nim |
10:00:16 | Araq | ekarlso! |
10:00:20 | ekarlso | Araq: ello.. |
10:00:30 | Araq | got CGI to work? ;-) :P |
10:00:41 | ekarlso | Araq: .... nope |
10:00:49 | ekarlso | haven't had the time for nim the last two weeks ish : | |
10:01:02 | Araq | then ask for help here please, we want that thing |
10:01:17 | ekarlso | Araq: you can figure out why it crashes... |
10:01:20 | ekarlso | :P |
10:01:37 | Araq | no, next month perhaps |
10:01:37 | * | reem quit (Remote host closed the connection) |
10:01:50 | Araq | there are far more pressing crashes and leaks to figure out, sorry |
10:02:31 | ekarlso | :p |
10:02:33 | Araq | as I said, it doesn't help you really anyway. use (S)CGI |
10:02:52 | ekarlso | Araq: .... I dont wanna have to rewrite stuff :( |
10:03:13 | Araq | ekarlso: so let somebody else do it |
10:03:37 | Araq | there are people here enjoying to program in Nim :P |
10:08:31 | ekarlso | any hints Araq on how I can debug the selector issue ? |
10:08:54 | Araq | could be dom96's bug |
10:09:08 | Araq | or could be that you forgot to initialize something |
10:09:25 | ekarlso | what bug is dom96's ? |
10:12:17 | Araq | dom96 wrote async |
10:12:30 | * | HakanD_________ quit (Read error: Connection reset by peer) |
10:12:47 | * | HakanD_________ joined #nim |
10:14:00 | ekarlso | dom96: you about ? :D |
10:18:59 | gokr | I am looking at what tools we have, we do have doc generation, niminst and nimfix (although beta) - and nimsuggest. And nimble, c2nim and so on but those are external. Do we have more? |
10:19:27 | gokr | No lintish tool and no formatting tool, right? Just so i didn't miss them. |
10:23:01 | * | TEttinger quit (Ping timeout: 256 seconds) |
10:28:35 | def- | don't think so, gokr |
10:29:37 | * | cazov quit (Ping timeout: 252 seconds) |
10:29:43 | * | cazov joined #nim |
10:32:40 | * | NimBot joined #nim |
10:34:05 | ekarlso | Araq: just curious, so the bug happens with something related to selectors.nim and using startProcess at least.. |
10:34:27 | ekarlso | around selectors.nim#169 |
10:35:08 | ekarlso | dunno how to narrow it down but :/ |
10:35:12 | def- | ekarlso: oh, I had a problem around there before |
10:35:25 | def- | ekarlso: does the assert fail or what? |
10:35:30 | ekarlso | def-: yeah |
10:35:45 | ekarlso | I changed it to a "if" instead and continue if it's nil |
10:36:54 | ekarlso | at least now it doesnt blow up... |
10:39:53 | ekarlso | so yeah, ill just "patch" my install of the compiler for the time being to ignore that ... |
10:39:58 | ekarlso | then the service should be "stable" |
10:40:18 | ekarlso | though it would be interesting to know why it happens.. |
10:40:20 | Araq | and ... erm ... I don't dare to ask |
10:40:25 | ekarlso | Araq: ? ... |
10:40:35 | Araq | can it then handle more than a single user? |
10:40:53 | ekarlso | lemme test :p |
10:43:26 | gokr | Hmmm, I don't really understand this nimrtl thing I suppose. |
10:44:13 | gokr | It seems to contain lots of stuff - I was under the false impression that it was the GC basically. |
10:44:45 | Araq | but only the GC is required to be in there |
10:45:01 | * | HakanD_________ quit (Read error: Connection reset by peer) |
10:45:08 | Araq | we included other parts of the stdlib too to save space |
10:45:36 | * | HakanD_________ joined #nim |
10:46:04 | Araq | for the people who care about 10KB in their exes and then forget about efficiency and download gigabytes of porn |
10:47:51 | LoneTech | what about my kind, who run Nim on hardware with 32KiB flash and 4+2KiB RAM? |
10:49:46 | Araq | LoneTech: do you need dynamic linking in this setting? |
10:49:47 | federico3 | LoneTech: we'll provide compressed ascii porn |
10:49:52 | LoneTech | nope (: |
10:50:08 | Araq | LoneTech: there you go :-) |
10:50:46 | LoneTech | the biggest waste I've noticed so far is that modules with no initializing code still get two subroutines and calls to them for initializations |
10:50:48 | federico3 | LoneTech: that's really tiny hw, what is it? |
10:51:01 | Araq | LoneTech: yeah I need to fix that |
10:51:04 | LoneTech | MSP430F5510, a 16-bit microcontroller |
10:51:19 | LoneTech | it's not a big deal, I have plenty of space still |
10:53:31 | LoneTech | also just getting started so far. I've blinked a LED and run an interrupt proc when I push a button |
10:53:59 | LoneTech | nim thinks it's an avr, just because what nim thinks an avr is describes the msp430 more closely |
10:54:29 | Araq | lol nim thinks embedded == avr |
10:54:51 | LoneTech | yes, but nim's idea of avr seems to be little endian 16 bit |
10:55:03 | LoneTech | avr is 8 bit and doesn't truly have endianness |
10:55:27 | Araq | hrm yeah but C's int is always 16bit at least too |
10:55:31 | LoneTech | yes |
10:55:42 | Araq | also it's address space is not 8 bit |
10:55:47 | Araq | and only address space counts |
10:56:19 | Araq | the other definitions of "how many bits does the machine use natively" make no sense ;-) |
10:56:57 | Araq | *its |
10:57:02 | LoneTech | depends on what part you're designing. but in that sense, it may matter more that avr is modified Harvard; it has different address spaces |
10:57:30 | LoneTech | a flash const pointer cannot be used the same as a ram const pointer |
10:58:01 | LoneTech | msp430 is von neumann, its address space includes both memories and IO |
10:58:19 | ekarlso | Araq: meh, async stuff with osproc seems to be totally b0rk atm |
10:58:31 | LoneTech | my next step is getting some buffers allocated in USB memory using a region attribute, I think. |
10:58:36 | Araq | ekarlso: oh really? tell me about it |
10:59:38 | ekarlso | Araq: it bugs at around selectors#169... |
11:00:02 | LoneTech | oh, also I haven't figured out how to get a computedGoto to play nicely with interrupt vector registers. some of the indirect vectoring is designed to be done with an array of jump instructions |
11:00:46 | ekarlso | https://bpaste.net/show/e261645a4fc8 < in theory Araq shouldn't that work ? |
11:00:54 | LoneTech | but nim+gcc seem to think odd values matter even though they're not in the enum (the physical register read cannot produce them) |
11:02:49 | Araq | LoneTech: nim's computedgoto is limited and designed for interpreter *loops* |
11:03:32 | LoneTech | yep. just wasn't my use case. leaving it alone as a minor optimization |
11:04:21 | Araq | usually a 'case' produces an array of jumps if gcc thinks it's better |
11:04:44 | LoneTech | the problem is GCC seems to think odd values can occur |
11:05:00 | LoneTech | and doesn't recognize that all non-default case ones are even |
11:05:14 | LoneTech | maybe it would do better if I put in "and not 1"? |
11:05:38 | Araq | Nim generates __assume(0) or something for you |
11:05:51 | Araq | but your case needs to be exhaustive for that |
11:06:14 | LoneTech | it is |
11:06:25 | LoneTech | I made an enum |
11:06:45 | Araq | ekarlso: dunno, looks correct to me |
11:07:12 | Araq | LoneTech: check the generated C code please |
11:09:01 | LoneTech | if I use computedGoto, nim generates an array with references to the nonexistent odd cases, and gcc won't compile it |
11:09:05 | * | HakanD__________ joined #nim |
11:10:18 | LoneTech | no hint of assume either way |
11:10:21 | Araq | LoneTech: don't use computedgoto |
11:10:33 | Araq | use an ordinary 'case' instead |
11:10:34 | LoneTech | okay |
11:11:17 | LoneTech | it's just the underlying values are literally designed for a computed goto; the register values are chosen for use as an indirect jump |
11:11:18 | EXetoC | is anyone able to post things on gist? |
11:11:48 | def- | EXetoC: yes, works for me |
11:12:40 | EXetoC | very odd |
11:12:53 | * | HakanD_________ quit (Ping timeout: 256 seconds) |
11:17:34 | * | mikolalysenko_ joined #nim |
11:17:48 | LoneTech | I'd like to be able to make parameterised user defined pragmas, and attributes with something less clunky than codegenDecl (which crashes the compiler without hinting why if I have a $# more than the particular declaration should) |
11:18:55 | LoneTech | right now I have a macro injecting codegendecl pragmas in the AST, and another custom pragma doing the same, but neither method stacks |
11:18:58 | * | keypusher joined #nim |
11:19:15 | * | cazov_ joined #nim |
11:19:21 | LoneTech | not that I need to yet, but it's a mechanism I might have liked. |
11:19:52 | * | Ven_ joined #nim |
11:20:07 | * | arnetheduck_ joined #nim |
11:21:30 | LoneTech | huh. is volatile implemented that way? because it broke. |
11:22:04 | * | BlaXpirit joined #nim |
11:22:13 | * | armin joined #nim |
11:22:31 | * | silven_ joined #nim |
11:24:33 | * | dts joined #nim |
11:25:05 | * | Ven quit (*.net *.split) |
11:25:05 | * | banisterfiend quit (*.net *.split) |
11:25:05 | * | silven quit (*.net *.split) |
11:25:06 | * | ggVGc quit (*.net *.split) |
11:25:06 | * | mikolalysenko quit (*.net *.split) |
11:25:06 | * | dv- quit (*.net *.split) |
11:25:06 | * | polde quit (*.net *.split) |
11:25:06 | * | Guest67437 quit (*.net *.split) |
11:25:07 | * | dom96 quit (*.net *.split) |
11:27:17 | * | ggVGc joined #nim |
11:27:55 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
11:28:12 | * | mikolalysenko_ is now known as mikolalysenko |
11:29:17 | * | dv- joined #nim |
11:29:17 | * | polde joined #nim |
11:29:17 | * | Guest67437 joined #nim |
11:29:17 | * | dom96 joined #nim |
11:29:35 | * | polde quit (Max SendQ exceeded) |
11:30:18 | * | polde joined #nim |
11:30:30 | * | cazov quit (*.net *.split) |
11:30:30 | * | dtscode quit (*.net *.split) |
11:30:30 | * | arnetheduck quit (*.net *.split) |
11:30:30 | * | reloc0 quit (*.net *.split) |
11:30:30 | * | key_ quit (*.net *.split) |
11:30:30 | * | flaviu quit (*.net *.split) |
11:30:31 | * | delian66 quit (*.net *.split) |
11:30:31 | * | ekarlso quit (*.net *.split) |
11:30:32 | * | vendethiel quit (*.net *.split) |
11:30:32 | * | clynamen quit (*.net *.split) |
11:30:33 | * | jj2baile quit (*.net *.split) |
11:30:33 | * | xandy quit (*.net *.split) |
11:30:33 | * | def- quit (*.net *.split) |
11:30:33 | * | Amrykid quit (*.net *.split) |
11:33:41 | * | delian66_ joined #nim |
11:33:42 | * | ekarlso joined #nim |
11:33:42 | * | vendethiel joined #nim |
11:33:42 | * | clynamen joined #nim |
11:33:42 | * | jj2baile joined #nim |
11:33:42 | * | xandy joined #nim |
11:33:42 | * | def- joined #nim |
11:33:42 | * | Amrykid joined #nim |
11:34:19 | LoneTech | yep. codegendecl completely excludes the cgen part that would include volatile or register |
11:45:49 | LoneTech | it sets constraint, which is checked in localVarDecl and assignGlobalVar. |
11:48:37 | ekarlso | meh ok |
11:48:40 | ekarlso | I give the crap up ... |
11:48:56 | ekarlso | apparantly that approach of using selects doesn't work either with multiple requests *yay for being async eh* |
12:01:47 | EXetoC | LoneTech: what are you passing to the macros? procs? |
12:01:59 | LoneTech | yes |
12:02:31 | LoneTech | like the port2 isr in https://github.com/lonetech/nim-msp430/blob/master/blink.nim |
12:03:13 | EXetoC | if it doesn't stack then I guess you aren't applying the pragmas to the procs directly |
12:03:48 | EXetoC | "proc p {.foo, bar.} = .." |
12:03:53 | LoneTech | oh, the macro isn't the problem. the problem is I have found no pragma or similar to just add an attribute. |
12:04:26 | LoneTech | as it turns out, volatile and register pragmas both break if you use a codegendecl pragma |
12:05:03 | LoneTech | which I found because I needed a section attribute to place some buffers in the USB RAM |
12:06:12 | LoneTech | I may need a function boundary just to keep a barrier between filling the buffer and submitting it for transfer |
12:06:33 | LoneTech | (probably a better way than making it volatile anyway, but I didn't expect it to break) |
12:07:38 | EXetoC | but it is adding an attribute, isn't it? so the problem is bugs then? |
12:08:06 | LoneTech | no. there's no way to add generic attributes. register and volatile are hardcoded into the compiler. |
12:08:08 | * | irrequietus joined #nim |
12:08:28 | LoneTech | codegendecl isn't the most elegant way of adding attributes with names the compiler doesn't know imho |
12:08:49 | EXetoC | ok |
12:09:11 | LoneTech | it just bypasses sections of the compiler in undocumented ways |
12:09:30 | LoneTech | perhaps more significantly, it would also break extern |
12:09:35 | EXetoC | but if the compiler crashed at some point then you should be able to get a stack trace if you do './koch temp' and then compile with the generated nim_temp |
12:10:42 | EXetoC | it's similar to ./koch boot but it outputs nim_temp. I assume you booted with -d:release |
12:11:14 | LoneTech | yes, at whatever place it actually uses p.module.s to insert the name and type in code generation. |
12:11:22 | LoneTech | correct |
12:12:13 | EXetoC | and nothing like that seems to have been reported |
12:13:02 | LoneTech | I figured codegendecl use overall is a bit of a kludge with compiler internals. I didn't know until just now how many other pragmas it broke. |
12:13:57 | LoneTech | all my uses so far would have been better served with a stackable attribute pragma |
12:17:02 | EXetoC | ok. feel free to make a feature request, but don't hold your breath :p |
12:17:43 | LoneTech | of course. I'm still just getting oriented |
12:22:01 | * | banister joined #nim |
12:38:41 | * | mwbrown joined #nim |
12:44:53 | * | armin is now known as reloc0 |
12:47:35 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:48:02 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:56:29 | * | banister joined #nim |
12:56:33 | * | banister quit (Max SendQ exceeded) |
12:58:00 | * | mpthrapp joined #nim |
13:01:56 | * | banister joined #nim |
13:02:16 | * | reem joined #nim |
13:05:55 | * | pafmaf joined #nim |
13:07:01 | * | reem quit (Ping timeout: 248 seconds) |
13:07:25 | * | BlaXpirit quit (Quit: Quit Konversation) |
13:09:40 | * | arhuman_ joined #nim |
13:09:45 | arhuman_ | hello |
13:10:42 | LoneTech | hello |
13:13:13 | * | mwbrown quit (Quit: Leaving) |
13:16:53 | Araq | LoneTech: the codegenDecl issues have already been reported :-) |
13:17:07 | Araq | and it looks like you already know how to fix them? |
13:17:11 | Araq | so go ahead please |
13:18:44 | * | emilsp quit (Remote host closed the connection) |
13:18:56 | * | vendethiel quit (Ping timeout: 246 seconds) |
13:19:55 | * | vendethiel joined #nim |
13:22:36 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:24:25 | LoneTech | Araq: I might give it a try, thanks for the encouragement |
13:24:38 | LoneTech | will be later though |
13:28:28 | Araq | aha so now companies using Nim doesn't count for a wikipedia article either. |
13:28:53 | Araq | how bizarre can it get? |
13:29:14 | EXetoC | maybe if nasa starts using it |
13:29:14 | LoneTech | much more. wikipedia is roamed by roving bands of editors each with their own ideas of what the rules are. |
13:29:52 | LoneTech | some of them have turfs, and not all of them are honest, and many of them disagree |
13:30:15 | gokr | It does feel kinda hopeless - no, there is no book yet. But I suspect an article in some magazine will appear soon, so that may turn out to be the "rescue". |
13:30:51 | Araq | well if *I* write the book it doesn't count either anyway |
13:31:13 | Araq | it has to be written by somebody who knows less about Nim |
13:31:51 | def- | Hm, one of my Nim articles is in some magazin, but it's probably not serious enough: http://hackermonthly.com/issue-58.html |
13:32:19 | Araq | but if the author then contributes enough to Nim, he is a coredev and then it doesn't count again |
13:34:18 | gokr | So we need a clueless person on some magazine to whip up an article :) |
13:34:43 | Araq | dunno, they will then say it's not peer reviewed |
13:36:16 | EXetoC | so, find someone who doesn't know too much. ok it all makes sense now |
13:37:13 | * | arhuman_ quit (Quit: leaving) |
13:40:31 | * | emilsp joined #nim |
13:40:39 | gokr | Wrote a followup btw: http://goran.krampe.se/2015/03/26/nim-visits-gtug/ |
13:42:10 | * | yymoto2 joined #nim |
13:44:30 | * | wb joined #nim |
13:46:15 | * | gokr quit (Ping timeout: 250 seconds) |
13:46:44 | * | pafmaf__ joined #nim |
13:47:46 | wb | About the asyncdispatch module, do procs marked {.async.} run automatically or do I need to explicitly create a thread from runForever()? |
13:47:49 | * | pafmaf quit (Ping timeout: 264 seconds) |
13:50:26 | Araq | you need to run them |
13:52:00 | wb | alright, thanks |
13:54:13 | * | a5i joined #nim |
13:57:17 | tstm | What are you guys using for editing Nim? |
13:57:33 | emilsp | vim |
13:57:47 | EXetoC | vim |
13:58:42 | bw_ | vim + https://github.com/zah/nimrod.vim |
13:58:49 | tstm | Are you using any code completion or doc features in vim for such? |
13:59:09 | emilsp | tstm, I'm using nimrod.vim and ycm |
14:12:25 | * | pafmaf__ quit (Ping timeout: 264 seconds) |
14:17:36 | * | gokr joined #nim |
14:20:01 | * | banister joined #nim |
14:20:09 | * | Ven joined #nim |
14:32:28 | * | yymoto2 quit (Quit: leaving) |
14:33:03 | * | pregressive joined #nim |
14:41:16 | * | untitaker quit (Ping timeout: 256 seconds) |
14:41:31 | EXetoC | tstm: I can't remember. I know there's good-to-definition functionality. idetools was broken before so I don't know if it works now |
14:42:03 | tstm | ycm seems to work |
14:42:06 | Araq | EXetoC: it should be updated to use nimsuggest which does work |
14:42:13 | tstm | With a quick check. |
14:46:58 | * | untitaker joined #nim |
15:10:15 | * | jefus__ joined #nim |
15:11:07 | * | irrequietus_ joined #nim |
15:11:18 | EXetoC | Araq: ok |
15:11:29 | EXetoC | ycm support? has that been announced anywhere? |
15:11:29 | * | gokr quit (Quit: Leaving.) |
15:13:01 | * | irrequietus quit (Ping timeout: 264 seconds) |
15:13:25 | * | jefus_ quit (Ping timeout: 252 seconds) |
15:15:07 | * | jefus__ is now known as jefus |
15:17:55 | * | polkm joined #nim |
15:19:03 | EXetoC | tstm: there's no code that adds nim support or anything, so I don't know what you mean |
15:29:40 | gmpreussner|work | tstm: Sublime with NimLime (https://github.com/Varriount/NimLime/) is my favorite. runs on Windows/Mac/Linux :) |
15:30:55 | * | jholland joined #nim |
15:35:36 | Araq | gmpreussner|work: does sublime use nimsuggest already? |
15:43:31 | * | darkf quit (Quit: Leaving) |
15:46:27 | * | ekarlso quit (Quit: WeeChat 0.4.3) |
15:51:39 | gmpreussner|work | Araq: i actually don't know. it does offer auto-completion, but that may only be based on previously used words. Variount should know. |
15:55:00 | * | Senketsu joined #nim |
16:03:33 | * | sampwing joined #nim |
16:11:37 | * | gokr joined #nim |
16:12:31 | * | irrequietus_ quit () |
16:12:57 | * | irrequietus joined #nim |
16:21:25 | * | pafmaf joined #nim |
16:25:48 | EXetoC | Araq: "template t(e: expr) = foo(e)" "getAst(t(newIdentNode($genSym()))" that works. I did something wrong yesterday |
16:26:01 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:26:17 | Araq | EXetoC: ok, glad to hear |
16:27:14 | * | BitPuffin joined #nim |
16:32:32 | * | banister joined #nim |
16:32:36 | * | banister quit (Max SendQ exceeded) |
16:33:15 | * | BlaXpirit joined #nim |
16:35:53 | * | Demon_Fox joined #nim |
16:48:42 | * | drewsrem joined #nim |
16:56:17 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:59:07 | * | Demon_Fox quit (Quit: Leaving) |
16:59:23 | * | Demon_Fox joined #nim |
17:08:05 | * | BitPuffin quit (Ping timeout: 265 seconds) |
17:15:10 | * | wizard0 joined #nim |
17:15:42 | * | Matthias247 joined #nim |
17:18:07 | * | wizard0 left #nim (#nim) |
17:19:16 | * | HakanD__________ quit (Ping timeout: 250 seconds) |
17:20:57 | * | cazov_ is now known as cazov |
17:28:30 | Trustable | I have a problem: When I try to compile with app:gui and Windows XP 32bit I get this error: i686-w64-mingw32/bin/ld.exe: cannot find -lgdi32 i686-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32 |
17:38:20 | * | fizzbooze joined #nim |
17:39:10 | * | Strikecarl joined #nim |
17:39:27 | * | Strikecarl left #nim (#nim) |
17:46:43 | drewsrem | I'm struggling to come up with the analogous ast/macro-module code for introducing a new let-identifier/symbol/whatever which gets assigned to a existing symbol, i.e. analogous to "let new_thing = other_thing_in_the_scope", it's a statement-macro that should just insert this at the top, this is what I got so far (which doesn't work ofc) http://ix.io/h7V - may someone give me some basic pointer? |
17:51:05 | * | sampwing quit (Ping timeout: 252 seconds) |
17:52:12 | * | Trixar_za quit (Quit: ZNC - http://znc.in) |
17:53:27 | * | brson joined #nim |
18:02:01 | * | fizzbooze quit (Ping timeout: 256 seconds) |
18:18:53 | Araq | Trustable: yeah it's a known problem with the "minimal mingw" that we ship. unfortunately |
18:19:09 | Araq | you need to get some real mingw distribution and replace ours with it |
18:20:08 | Araq | drewsrem: what's the problem with this code? |
18:21:32 | drewsrem | Araq, I'm getting: SIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.) |
18:21:40 | drewsrem | When I comment those two lines out it works |
18:22:10 | Araq | drewsrem: try devel please |
18:22:18 | Araq | if it still doesn't work, report it |
18:22:31 | Araq | a compiler crash is a bug, one way or the other |
18:22:49 | drewsrem | Araq, sorry, devel? |
18:22:56 | drewsrem | ahhhh branch |
18:23:01 | drewsrem | will do |
18:51:06 | * | sampwing joined #nim |
18:53:53 | Araq | does anybody happen to know how portable pthread_cond_timedwait is in practice? |
18:55:49 | fowl | Trustable, you need real mingw32 or use msvc |
18:55:56 | * | dts is now known as dtscode |
18:57:27 | * | sampwing quit (Ping timeout: 252 seconds) |
18:58:28 | EXetoC | Araq: so, ENOSYS doesn't count? |
18:59:59 | Araq | EXetoC: I still cannot read your mind |
19:00:36 | * | pafmaf quit (Quit: Verlassend) |
19:04:12 | EXetoC | Araq: In practice meaning that "Function not implemented" does not count? ;) |
19:05:21 | Araq | EXetoC: well I'm about to use it. it's in posix |
19:05:40 | Araq | I can disable this code then for BSD and MacosX and Linux later |
19:07:51 | * | jasondotstar quit (Read error: Connection reset by peer) |
19:08:24 | * | jasondotstar joined #nim |
19:20:11 | Araq | "The problem here is that pthread_cond_timedwait takes absolute time, |
19:20:13 | Araq | but you passed relative timeout. |
19:20:14 | Araq | to make pthread_cond_timedwait waike up after you called it, you need |
19:20:16 | Araq | to get current time, and then add timeout you need. |
19:20:17 | Araq | In the sampe you provide your pthread_cond_timedwait waikes up before |
19:20:19 | Araq | it actually starts." |
19:20:20 | Araq | what? o.O |
19:20:35 | fowl | absolute time? wtf |
19:20:38 | Araq | who needs an absolute time here? |
19:20:56 | Araq | is everything in this "standard" braindead? |
19:23:12 | EXetoC | an expr can't be assigned an empty AST node? |
19:24:46 | Araq | aha, there is a reason for this: http://hacksoflife.blogspot.de/2006/11/surprise-pthreadcondtimedwait-takes.html |
19:24:48 | EXetoC | it would be useful |
19:29:16 | fowl | EXetoC, wot |
19:29:24 | fowl | context? |
19:30:16 | EXetoC | fowl: template t(e: expr) = e # possibly expanding to a statement list containing only an empty node |
19:31:26 | Araq | EXetoC: what do you pass to 't' for that to happen? |
19:32:18 | EXetoC | Araq: an nnkEmpty node |
19:32:40 | Araq | how do you write an nnkEmpty node in Nim code? |
19:33:00 | Araq | note: by that I mean not how to generate one with a macro |
19:33:09 | EXetoC | Araq: it's in a macro, and I'm doing getAst(t(args)) once again |
19:33:27 | EXetoC | ok well that's what I'm doing |
19:33:36 | fowl | and args is the emptynode? |
19:34:03 | * | banister joined #nim |
19:34:12 | EXetoC | fowl: it's just an example of what I'm doing, but I'll try to reduce it and see if it still doesn't work |
19:34:58 | fowl | EXetoC, even if you can pass an emptynode to a template theres no good use for it from the template |
19:43:39 | * | Varriount joined #nim |
19:44:11 | Araq | ugh await with timeout is such a PITA |
19:44:24 | Araq | wb Varriount |
19:45:39 | Varriount | Araq: Sorry about the recent lack of activity - I've had quite a large amount of classwork recently. |
19:46:09 | Varriount | Also, I'm going to have to take my builders down today for a bit - I have to do some hardware upgrading. |
19:47:48 | Varriount | Araq: On the bright side, I've reduced the amount of disk activity the builder causes by placing the build directories in a ramdisk, saved to the harddrive every 60 minutes. |
19:48:51 | fowl | smart |
19:48:53 | EXetoC | fowl: the purpose is to conditionally pass in basically nothing, and then I can just name that parameter varOrNothing rather than having the conditional logic inside the template. I think this improves the readability |
19:51:07 | Araq | Varriount: we need to regenerate our minimal mingw installers |
19:51:18 | Araq | --app:gui causes missing libs, of course |
19:51:37 | EXetoC | I'll just insert an arbitrary node for now |
19:54:16 | * | Varriount quit (Ping timeout: 246 seconds) |
19:57:33 | EXetoC | "if (system.not|system.not|system.not|system.not|system.not|system.not|...) :tmp.(itertest.empty|itertest.empty|...):" I get output like this when I print the AST. any idea if it has been reported? |
19:58:25 | Araq | well that's not a bug :P |
19:58:37 | Araq | but yes, can be quite annoying |
19:59:49 | EXetoC | why not? it's arbitrary so can't those duplicates by omitted? |
20:00:04 | fowl | Araq, do you know if this can work https://gist.github.com/fowlmouth/48f3340b797c12cb3043#file-n_tmpl-nim |
20:00:24 | Araq | EXetoC: it's not arbitrary |
20:00:29 | fowl | the macro version works |
20:02:25 | EXetoC | Araq: it just seemed that way since it was repeated 6 times |
20:02:58 | Araq | EXetoC: there are 6 system.not operators defined then |
20:03:21 | * | pafmaf joined #nim |
20:03:24 | Araq | and the dots indicate it's an "open" symlist ... |
20:03:44 | Araq | and not a closed one ... |
20:04:16 | EXetoC | I just wonder how often the exact number is necessary, but it's no big deal |
20:04:21 | Araq | fowl: dunno, but I dislike recursions for iteration |
20:05:14 | Araq | fowl: it'd simply create a forEach macro instead |
20:06:29 | EXetoC | I'm working on a foreach :p |
20:06:49 | EXetoC | but which relies on userland iterators so it's probably not relevant |
20:07:36 | fowl | Araq, this is to imitate a c++ variadic template |
20:07:46 | Araq | I noticed |
20:07:58 | Araq | C++ requires recursion though. we don't |
20:08:26 | fowl | a recursive template is clearer than a macro imo |
20:08:37 | * | dashed joined #nim |
20:10:17 | * | Varriount joined #nim |
20:10:26 | Araq | you only need this one macro: makeStmts(f, list) --> creates f(list[0]); f(list[1]) |
20:10:36 | Varriount | Araq: Why is there no 'pow' for integers? |
20:10:38 | Araq | as a stmt list |
20:10:55 | Araq | Varriount: I wrote one and put it in math |
20:11:09 | Araq | but I dunno if I really did that or dreamed it |
20:11:22 | def- | there is `^` |
20:16:39 | * | drewsrem quit (Quit: Leaving) |
20:18:43 | * | Demos joined #nim |
20:22:33 | Araq | hey Demos |
20:22:41 | Demos | yo |
20:22:47 | Araq | what's the state of VisualNimrod? |
20:23:09 | Demos | Not that good. Needs updating to suggest |
20:23:22 | Demos | and I kinda want to redo the build support |
20:23:37 | * | Matthias247 quit (Quit: Matthias247) |
20:23:39 | Demos | I have not had time to work on it due to school and my job |
20:27:19 | * | Sembei quit (Ping timeout: 245 seconds) |
20:29:38 | * | pafmaf quit (Quit: Verlassend) |
20:31:54 | Araq | bbl |
20:33:24 | * | sampwing joined #nim |
20:40:34 | Varriount | Demos: Same boat as me then. >_< |
21:05:03 | * | mpthrapp quit (Remote host closed the connection) |
21:08:44 | * | mpthrapp joined #nim |
21:12:45 | * | sampwing quit (Ping timeout: 252 seconds) |
21:12:53 | * | mpthrapp quit (Read error: Connection reset by peer) |
21:18:37 | * | Varriount quit (Ping timeout: 246 seconds) |
21:19:07 | * | fizzbooze joined #nim |
21:19:38 | * | pregressive quit () |
21:20:22 | * | banister is now known as banisterfiend |
21:20:36 | * | sampwing joined #nim |
21:42:19 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:43:39 | * | gsingh93 joined #nim |
21:49:03 | * | Trustable quit (Remote host closed the connection) |
21:56:58 | fowl | what is the point of the extensionless files in \.nimble\bin |
21:57:07 | fowl | ~\.nimble\bin (windows) |
22:00:42 | * | flaviu joined #nim |
22:01:28 | BlaXpirit | for some imaginary compatibility |
22:01:46 | BlaXpirit | maybe something can run shell files on windows |
22:02:16 | fowl | why isnt mklink used for windows NT systems |
22:02:44 | BlaXpirit | nobody uses this |
22:02:54 | fowl | nobody uses mklink? |
22:03:00 | BlaXpirit | yes |
22:03:19 | fowl | i use it all the time |
22:03:38 | BlaXpirit | well sure, on a personal basis maybe people do use it |
22:03:52 | BlaXpirit | but i've never seen it in any automated things like installers |
22:04:48 | fowl | well its only available in vista and later |
22:06:53 | flaviu | Windows XP shouldn't be used by anyone anyway |
22:07:57 | fowl | the last place i worked use stolen copies of windows xp.. someone hacked and encrypted their hard drives rofl |
22:08:24 | dom96 | fowl: for cygwin |
22:08:49 | EXetoC | fowl: :E |
22:13:16 | BlaXpirit | [:01:44] <BlaXpirit> maybe something can run shell files on windows |
22:13:23 | BlaXpirit | yay i guessed |
22:14:01 | * | banisterfiend quit (Remote host closed the connection) |
22:21:02 | * | reem joined #nim |
22:21:29 | * | fizzbooze quit (Ping timeout: 252 seconds) |
22:21:59 | EXetoC | how do I get the element type of a seq? the thing is, I have a typedesc, not a var |
22:22:46 | BlaXpirit | EXetoC, you gotta hope to not need it |
22:23:22 | BlaXpirit | i don't think there is an easy way to get element type of seq if you only have typedesc |
22:23:44 | BlaXpirit | i tried it once and decided to just also pass the type |
22:24:14 | BlaXpirit | pretty sure i asked Arаq back then and he didn't give any way to do this |
22:24:50 | EXetoC | yeah it's difficult, at least without traits |
22:25:06 | flaviu | IIRC it's possible |
22:25:15 | flaviu | Let me see if I have some code laying around |
22:26:49 | BlaXpirit | yeah, i just wrote bytesToWordsN[uint64, array[2, uint64]](seed) |
22:27:02 | * | banister joined #nim |
22:28:38 | fowl | something like |
22:31:28 | fowl | hmm i dunno ._. |
22:31:53 | fowl | i can do it with getType probably |
22:36:42 | flaviu | Looks like I might have imagined writing that code, I can't find anything. |
22:37:51 | fowl | i have a solution but it segfaults :p https://gist.github.com/fowlmouth/c538cb5a9a0a1140ef6d |
22:37:56 | EXetoC | And then there's this issue: "got typedesc[T] but expected one of: elemType(T: typedesc[seq])", but another approach came to mind |
22:39:41 | EXetoC | (userland iterator interface without traits) "proc map[T, U](x: T, op: proc(elem: elemType(T)): U): seq[U]" |
22:40:03 | fowl | EXetoC, try type(x[0]) there |
22:43:02 | * | reem quit (Remote host closed the connection) |
22:43:28 | EXetoC | fowl: nope, can't do that. there's type(T()[0]), but that does not work for sequences |
22:44:47 | * | reem joined #nim |
22:45:51 | * | fizzbooze joined #nim |
22:49:26 | * | reem quit (Remote host closed the connection) |
22:49:34 | BlaXpirit | well maybe it should work |
22:49:56 | EXetoC | but it looks for "[](T, int)" |
22:50:15 | BlaXpirit | the actual problem is that T() can't be created |
22:50:26 | BlaXpirit | for builtin types |
22:50:29 | BlaXpirit | etf |
22:51:07 | EXetoC | right |
22:51:14 | BlaXpirit | .eval import typetraits; type T = seq[int]; var t: T; echo type(t[0]).name |
22:51:16 | Mimbus | BlaXpirit: eval.nim(6, 15) Error: type mismatch: got (int) |
22:51:21 | BlaXpirit | wut it works for me |
22:51:40 | BlaXpirit | old devel? |
22:53:11 | * | a5i quit (Quit: Connection closed for inactivity) |
22:53:35 | * | sampwing quit (Ping timeout: 252 seconds) |
22:53:47 | BlaXpirit | well definitely not latest |
22:53:50 | BlaXpirit | srsly, try this out, EXetoC |
22:54:09 | BlaXpirit | sure, the huge downside is you do actually need to create a var |
22:54:52 | * | reem joined #nim |
22:57:21 | BlaXpirit | aha. Error: internal error: cannot generate VM code for type result[0] |
22:57:22 | * | sampwing joined #nim |
23:02:32 | * | Mimbus quit (Excess Flood) |
23:02:40 | * | Mimbus joined #nim |
23:07:59 | * | brson quit (Quit: Lost terminal) |
23:08:45 | * | brson joined #nim |
23:11:26 | * | filwit joined #nim |
23:12:33 | filwit | gokr: will get you the crown today at some point. Hope I didn't miss your talk. |
23:12:58 | gokr | Sorry, you missed it :) |
23:13:02 | gokr | It was yesterday |
23:13:35 | filwit | damn, sorry about that |
23:14:36 | filwit | i am interested to see your talk if it was recorded (and in english) |
23:15:40 | gokr | Sorry was skyping with Araq |
23:15:57 | gokr | No, its no problem :) But unfortunately it was not taped - and it was in swedish :) |
23:16:13 | gokr | Around 50 developers though |
23:16:21 | filwit | nice :) |
23:16:28 | filwit | did the talk go well? |
23:16:41 | gokr | Yeah! I think it did. |
23:16:41 | * | Demos quit (Ping timeout: 246 seconds) |
23:16:48 | gokr | I wrote a follow up article here: http://goran.krampe.se/2015/03/26/nim-visits-gtug/ |
23:17:02 | filwit | great! answered my next question :) |
23:17:11 | gokr | And the slides... are here: http://files.krampe.se/3dicc-nim-2015.odp |
23:17:38 | gokr | There is a pdf version there too - but then the movie on one of the slides is a picture instead |
23:18:03 | gokr | But those slides don't have all the code samples, so ... it looks kinda silly. But I showed a lot of code :) |
23:18:08 | gokr | In Aporia |
23:18:51 | gokr | So it was fun - don't know, perhaps someone who was there has sneaked in here? Anyone? :) |
23:19:11 | filwit | awesome |
23:19:46 | filwit | i'm installing libreOffice to open that |
23:19:57 | filwit | that's great to hear you used Aporia :) |
23:20:16 | fowl | someone here is swedish iirc |
23:20:50 | EXetoC | ä |
23:20:52 | fowl | EXetoC, im still trying to tackle your problem, i want something like this to work |
23:21:00 | gokr | Hehe |
23:21:12 | fowl | template typeOfMember(t:typedesc):expr = static: var x:t; type(x[0]) |
23:21:13 | gokr | And oh, do you know what I just stumbled over on twitter? |
23:21:31 | BlaXpirit | fowl, that's what i tried |
23:21:40 | filwit | gokr: you didn't happen to use one of my Aporia color themes did you? Your blog colors are on there. |
23:21:41 | BlaXpirit | cannot generate VM code |
23:21:55 | fowl | BlaXpirit, i get Error: value of type 'typedesc[int]' has to be discarded |
23:21:59 | EXetoC | fowl: would you need things like that had traits been working? |
23:22:13 | fowl | EXetoC, traits == type classes? |
23:22:17 | filwit | gokr: wait, what did you come across on tumblr? |
23:22:18 | gokr | John Carmack was looking at Nim |
23:22:20 | EXetoC | I tried it with static |
23:22:25 | filwit | gokr: twitter** |
23:22:30 | EXetoC | fowl: you mean, user-defined type classes? :p yep |
23:22:32 | BlaXpirit | fowl, bah, maybe static isn't an expression |
23:23:23 | BlaXpirit | fowl, it's not gonna work anyway |
23:23:32 | filwit | gokr: really? where? I was thinking I had seen that, but that was actually Notch, not Carmack |
23:23:52 | fowl | BlaXpirit, this should definitely work but it errors when you return the int sym from the type graph, can get around that but its not ideal: https://gist.github.com/fowlmouth/c538cb5a9a0a1140ef6d |
23:23:56 | filwit | well, nevermind... obviously it's carmacks twitter |
23:24:28 | Araq | fowl: can't you just fix compiler bugs instead of hacking around them? |
23:24:35 | gokr | https://twitter.com/libmn/status/578669744519274497 |
23:24:51 | Araq | most of this stuff doesn't require a PhD in type theory, you know |
23:25:06 | fowl | Araq, but what is the bug :/ |
23:25:40 | BlaXpirit | ok #nim is a horrible hashtag |
23:26:12 | gokr | filwit: Ha, oh... I used Ekini edit? |
23:26:31 | Araq | BlaXpirit: homework for you. say at least 1 nice thing about *anything* in #nim. Note: It doesn't have to be about Nim. |
23:27:00 | gokr | He picked Racket, hmm. |
23:27:07 | BlaXpirit | Araq, http://irclogs.nim-lang.org/25-03-2015.html |
23:27:31 | Araq | BlaXpirit: I mean. every day. :P |
23:28:02 | Araq | I'm a bit concerned about your health. :P |
23:28:34 | BlaXpirit | not sure what you mean |
23:29:25 | gokr | Nice: https://twitter.com/sepisoad/status/571225635168919553 |
23:29:26 | Araq | I think you have to go out and enjoy the sun |
23:29:32 | gokr | We should retweeet all these :) |
23:29:36 | filwit | gokr: Ekini edit? never heard of that one. |
23:30:25 | * | jefus quit (Ping timeout: 264 seconds) |
23:31:45 | * | jefus joined #nim |
23:34:23 | * | a5i joined #nim |
23:35:13 | flaviu | gokr: It's an old tweet, and the password manager it mentions has a major security flaw in it. |
23:35:29 | BlaXpirit | :| |
23:35:34 | gokr | ah, sorry |
23:35:41 | BlaXpirit | and not a popular guy |
23:35:48 | gokr | I am such a twitter noob |
23:36:32 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:47:30 | filwit | gokr: found a typo in your blog: "Sublime, Emacs and **Nim** all have fairly good support I think" |
23:47:56 | filwit | should be 'Vim' |
23:47:57 | gokr | I fixed that i thought |
23:48:07 | filwit | hmm.. let me refresh |
23:48:20 | filwit | still there |
23:49:33 | filwit | nice blog so far, you should post to /r/programming (noticed it was already on /r/nim) |
23:51:42 | gokr | Now its Vim. Had forgotten a step |
23:53:11 | * | nande joined #nim |
23:53:39 | gokr | I think I "lied" about static linking though - its not by default. |
23:54:22 | * | polkm quit (Ping timeout: 246 seconds) |
23:57:16 | * | TEttinger joined #nim |