00:00:21 | * | thotypous quit (Quit: WeeChat 1.1.1) |
00:02:28 | * | NimBot joined #nim |
00:12:26 | * | aboisvert joined #nim |
00:14:47 | * | xificurC_ joined #nim |
00:19:11 | * | xificurC quit (Ping timeout: 256 seconds) |
00:44:01 | * | vikaton joined #nim |
00:44:39 | * | xificurC joined #nim |
00:46:57 | * | xificurC_ quit (Ping timeout: 256 seconds) |
00:50:17 | * | aboisvert quit (Quit: aboisvert) |
00:50:53 | QWERTYPASSWORD | why does everyone wants a new constructor syntax i dont get it T_T, other than restricting instanciation outside of the source module i dont see whats wrong with the current system. |
00:50:54 | * | brson quit (Quit: leaving) |
00:54:08 | * | mahlon joined #nim |
01:16:39 | * | aboisvert joined #nim |
01:17:42 | filwit | dom96: you around? I curious to know how you came up with the Aporia gtksourceview.nim file. c2nim? I want to know how complete it is, but I'm having trouble finding both documentation online (for 2.0) for comparison. |
01:22:58 | filwit | dom96: err.. nevermind, i'll just look at the C header to compare |
01:35:59 | * | Sembei quit (Read error: Connection reset by peer) |
01:37:12 | * | Sembei joined #nim |
01:39:12 | * | darkf joined #nim |
01:44:10 | reactormonk | argh, too many dependencies inside the compiler |
01:44:22 | reactormonk | or rather, circular dependencies |
01:46:40 | reactormonk | ehh wait. |
01:52:24 | * | vikaton quit () |
01:52:35 | * | vikaton joined #nim |
01:58:21 | * | aboisvert quit (Quit: aboisvert) |
01:58:35 | * | darkf_ joined #nim |
02:00:28 | * | darkf quit (Ping timeout: 256 seconds) |
02:00:32 | * | darkf_ is now known as darkf |
02:08:06 | * | JinShil joined #nim |
02:11:52 | * | vendethiel joined #nim |
02:14:05 | * | Siecje left #nim (#nim) |
02:16:05 | * | rgv151 joined #nim |
02:19:25 | * | HakanD joined #nim |
02:24:08 | * | HakanD quit (Ping timeout: 272 seconds) |
02:31:16 | * | aboisvert joined #nim |
02:38:05 | * | dhasenan joined #nim |
02:40:15 | dhasenan | Is there a viewer for the ESTP profiling output? |
02:51:39 | * | ddl_smurf joined #nim |
03:02:34 | * | TEttinger joined #nim |
03:03:25 | * | ddl_smurf quit (Quit: ddl_smurf) |
03:07:56 | Xe | Is there a dockerfile for nim programs? |
03:19:32 | ldlework | Xe: no but its trivial to make one |
03:19:58 | ldlework | Xe: I'll help you with Docker if you help me with Alpine Linux ;) |
03:20:08 | * | aboisvert quit (Quit: aboisvert) |
03:21:17 | Xe | ldlework: seems like a fair trade |
03:21:29 | Xe | I'm really good with docker and alpine |
03:21:41 | Xe | was mainly wondering if I could be lazy :D |
03:21:46 | * | saml_ quit (Ping timeout: 272 seconds) |
03:22:48 | ldlework | Xe: I'm currently making an image for alpine-package development |
03:22:55 | ldlework | Because I need to upgrade the version of twisted there |
03:23:10 | ldlework | I made a curses based docker client using urwid and twisted |
03:23:18 | ldlework | and I want the docker image to be as small as possible |
03:23:34 | ldlework | Xe: are you a maintainer, etc? |
03:23:37 | Xe | nope |
03:23:43 | ldlework | Have you ever submitted anything against the packages? |
03:23:43 | Xe | but I did use it on hardware for over a year |
03:23:46 | Xe | yep |
03:23:50 | reactormonk | docker seems to hype... is it that good? I've heard you can get root on the host system from within a bottle |
03:23:50 | Xe | mainly tor and ii |
03:23:57 | ldlework | OK, I just want some help submitting my patch, etc |
03:24:03 | Xe | reactormonk: chroot + pid space tl;dr |
03:24:08 | Xe | ldlework: ah |
03:24:09 | ldlework | reactormonk: its not a security product anyway |
03:24:15 | reactormonk | ldlework, ok |
03:24:20 | ldlework | its not suppose to be any more secure than just running software on the host |
03:24:30 | ldlework | the value comes from 'incidental isolation' |
03:24:48 | ldlework | when you deploy various components of your service, you no longer have to deploy mysql, and apache or this and that |
03:24:50 | reactormonk | ldlework, even a bit less, because of the root part. |
03:24:51 | ldlework | you just deploy containers |
03:25:06 | ldlework | reactormonk: containers don't make it easier |
03:25:14 | Xe | ldlework: http://wiki.alpinelinux.org/wiki/Creating_patches#Only_the_last_commit_with_.27git_send-email.27 |
03:25:14 | ldlework | the linux kernel is insecure |
03:25:33 | reactormonk | ldlework, http://reventlov.com/advisories/using-the-docker-command-to-root-the-host |
03:25:43 | Xe | reactormonk: for me it is much easier to deploy a container for an app because with a container I can define the environment of the app and isolate the crazy |
03:25:51 | reactormonk | Xe, neat |
03:25:58 | Xe | also |
03:26:08 | Xe | I have stuff rigged so that i `git push` a repo to a server |
03:26:10 | ldlework | reactormonk: you have to read this and try to understand it |
03:26:19 | Xe | and it builds into a live app |
03:26:23 | Xe | usually within minutes ^_^ |
03:26:26 | ldlework | reactormonk: if you have access to the docker command line tool, of course you have 'root' |
03:26:40 | reactormonk | ldlework, ok, point taken |
03:27:14 | ldlework | that's different than how hard it is for unprivledged code inside of a container to own the machine |
03:27:28 | Xe | reactormonk: if you have permission to create virtual machines than you have 'root' |
03:27:29 | ldlework | docker doesn't make that any easier, than if you were locked down as a non-root user on the host |
03:27:30 | Xe | same idea |
03:27:34 | ldlework | Xe: yeah |
03:27:42 | ldlework | wow this article is poison |
03:28:00 | Xe | ldlework: ikr |
03:28:02 | ldlework | oh haha, I remember this |
03:28:08 | ldlework | when they contacted us |
03:28:20 | Xe | oh! |
03:28:23 | Xe | you're a docker contributor |
03:28:28 | Xe | that's why I recognized you lol |
03:28:32 | ldlework | Xe: I built the automated build system \o/ |
03:28:37 | ldlework | for better or worse |
03:28:57 | Xe | glad to see another gopher trying nim |
03:29:07 | ldlework | Oh I hate go. |
03:29:15 | ldlework | I'm a pythonista. |
03:29:18 | Xe | ah |
03:29:18 | ldlework | hsss |
03:29:21 | ldlework | :) |
03:29:28 | reactormonk | I can't phantom building software without generics |
03:29:39 | reactormonk | ... that's why I hate javascript so much ^^ |
03:29:49 | Xe | reactormonk: techincally in javascript |
03:29:57 | Xe | everything is a generic union that could be anything |
03:30:12 | ldlework | Yeah |
03:30:20 | reactormonk | kinda. |
03:30:29 | Xe | no it really is |
03:30:31 | Xe | lol |
03:30:33 | * | vendethiel quit (Ping timeout: 240 seconds) |
03:30:36 | Xe | it's not as bad as PHP tho |
03:30:37 | reactormonk | It's just the lack of an stdlib that makes it hard :-/ |
03:30:53 | ldlework | reactormonk: have you tried js.js |
03:30:53 | Xe | where everything is a generic union that could be turned into anything without warning |
03:31:02 | reactormonk | no dict/hash/tables |
03:31:10 | ldlework | reactormonk: you're trolling us right? |
03:31:21 | Xe | ldlework: anyways |
03:31:32 | Xe | in tar, how do I extract to a specified folder? |
03:31:38 | Xe | say the http://nim-lang.org/download/nim-0.11.2.tar.xz tarball |
03:31:53 | Xe | I'd like to extract it to..say.. /usr/local/nim |
03:31:59 | ldlework | Xe: you're asking how to use the tar command? |
03:32:24 | Xe | I remember there's a flag to arbitrarily forward the output of a folder even if you can't predict it |
03:33:04 | reactormonk | ldlework, well, no. You have the standard objects which you can use as hashes, but you can't put arbitrary objects in there. Gotta supply your custom hashing function every time. |
03:33:19 | ldlework | Xe: its not "tar -zxf nim-0.11.2.tar.xz /usr/local/nim" ? |
03:33:40 | reactormonk | ldlework, js.js sounds entertaing ^^ |
03:33:52 | ldlework | reactormonk: do you mean for keys? |
03:33:55 | reactormonk | in a twisted way. |
03:34:00 | reactormonk | ldlework, yup |
03:34:24 | ldlework | reactormonk: I understand you now |
03:36:03 | Xe | ldlework: trying that, let's see what happens at build |
03:36:52 | reactormonk | Xe, the CD drive will open up and lots of tiny shrapnel will kill a kitten. |
03:37:06 | Xe | reactormonk: I'm compiling nim, not C++ |
03:37:15 | ldlework | heh |
03:38:58 | Xe | ldlework: guess who was smart and deleted my devel base image? |
03:39:02 | Xe | \o/ |
03:39:22 | reactormonk | gotta free up that costly space |
03:40:02 | Xe | ldlework: alpine + nim + static compilation + single file containers seems like a killer app |
03:40:45 | * | kokozedman joined #nim |
03:41:44 | kokozedman | hey guys, I seems to have seen a tool for nim to convert a file to a nim string/buffer... does anyone recall where is it and its docs? |
03:42:44 | reactormonk | kokozedman, what do you want to do exactly? |
03:44:33 | kokozedman | reactormonk, instead of reading a file, I need to have it as a nim string... I don't want it to be available as file sticking around and having to maintain it |
03:45:12 | * | jholland quit (Quit: Connection closed for inactivity) |
03:47:54 | fowl | StaticRead? |
03:48:25 | fowl | Reads a file at compile time |
03:49:44 | kokozedman | fowl, yes, that is it! thanks man |
04:03:05 | QWERTYPASSWORD | its a PITA getting no error on undeclared identifiers in concepts :( |
04:03:34 | QWERTYPASSWORD | took me a crazy amount of time to find my bug |
04:04:19 | fowl | QWERTYPASSWORD, we could have a macro emit the code inside the concept for a type, forcing it to instantiate, you could see the error then |
04:04:26 | QWERTYPASSWORD | you can even segfault if you do something like "x is dsajkldsajkl + 22" inside a concept |
04:05:55 | QWERTYPASSWORD | at least im aware of it now, and will be more careful |
04:06:47 | * | BlaXpirit joined #nim |
04:08:34 | * | kokozedman quit (Quit: Leaving) |
04:10:48 | * | kokozedman joined #nim |
04:18:09 | * | endragor joined #nim |
04:18:43 | * | endragor quit (Remote host closed the connection) |
04:19:12 | * | endragor joined #nim |
04:38:32 | kokozedman | weird thing... using the staticRead() I'm getting a Error: cannot open |
04:38:38 | kokozedman | anyone knows why? |
04:44:47 | reactormonk | kokozedman, path doesn't work? |
04:50:13 | kokozedman | reactormonk, I'm specifying the full path to the file |
04:51:00 | reactormonk | kokozedman, try slurp |
04:51:24 | kokozedman | reactormonk, same exact thing |
04:52:03 | kokozedman | path is obviously correct |
04:53:55 | BlaXpirit | kokozedman, i don't think it can work with full paths |
04:54:09 | BlaXpirit | it has similar semantics to `import` |
04:54:14 | kokozedman | BlaXpirit, why not? |
04:54:16 | kokozedman | oh, I see |
04:54:20 | BlaXpirit | except you can do it for any type of file |
04:54:52 | BlaXpirit | i mean... i don't see any reason for it not to work with full paths |
04:54:54 | kokozedman | Ok, good to know |
04:54:58 | BlaXpirit | i just guessed that it was the case |
04:54:59 | Xe | this code doesn't seem to be compiling: https://gist.github.com/Xe/434cd76f71949b04406d |
04:55:14 | Xe | I'm probably missing something really obvious, what did I mess up? |
04:56:31 | Xe | vim is giving me "type mismatch: got (Args) but expected 'Args'" |
04:58:12 | * | gsingh93 joined #nim |
04:58:28 | fowl | Xe, Args* = array[int, string] |
04:58:33 | * | Jesin quit (Quit: Leaving) |
04:59:06 | Xe | what about it? |
04:59:12 | Xe | is the actual type "Args*"? |
04:59:21 | fowl | no that array is invalid |
04:59:30 | fowl | i think, let me run it |
04:59:50 | fowl | i think, let me run it |
04:59:51 | Xe | or do I want a set[string] |
04:59:52 | fowl | er |
05:00:03 | fowl | yea |
05:00:13 | fowl | making it array[10,string] works |
05:00:20 | Xe | oh |
05:00:57 | Xe | I see |
05:01:03 | Xe | thanks fowl |
05:05:06 | * | milosn quit (Quit: leaving) |
05:05:40 | Xe | fowl: does nim support array splicing like python? |
05:06:52 | BlaXpirit | kinda |
05:07:34 | Xe | how would I implement it? |
05:07:50 | Xe | I'm looking for something like "everything but the first character of a string" |
05:09:58 | fowl | >> var s = [1,2,3]; echo s[1 .. ^1] |
05:10:08 | fowl | .eval var s = [1,2,3]; echo s[1 .. ^1] |
05:10:15 | fowl | well its like that |
05:10:46 | ldlework | Xe: ! |
05:11:00 | ldlework | are you there? |
05:11:07 | Xe | ldlework: I am |
05:11:34 | Xe | fowl: seq[x .. ^x] ? |
05:11:43 | ldlework | Xe: when I do "abuild -r" I get a .tar.bz2 in /var/cache/distfiles. How do I build a thing that would let me take it to another alpine machine and install it? |
05:11:50 | ldlework | IE, an apk |
05:11:58 | fowl | Xe, arr[s.low .. s.high] will work when arr has a non-zero index |
05:12:04 | Xe | ldlework: apkbuild! |
05:12:09 | Xe | ah |
05:12:40 | Xe | fowl: is nim 0 or 1 based for sequence indexes? |
05:12:51 | fowl | er "Slicing for arrays with negative indices is unsupported." |
05:12:56 | fowl | sorry for the bad advice |
05:13:03 | fowl | seqs start at 0 |
05:13:05 | fowl | strings too |
05:13:16 | ldlework | Xe: what is that? google has no idea. |
05:13:42 | Xe | er |
05:13:43 | Xe | abuild* |
05:13:45 | Xe | http://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package |
05:14:10 | ldlework | Xe: That's what I'm saying. When I run "abuild -r" I just get a tarfile in /var/cache/distfiles |
05:14:21 | ldlework | Its just a tar of the twisted package |
05:14:31 | ldlework | How do I build an apk I can take to another machine and install it? |
05:14:52 | ldlework | nothing ever appears in /var/cache/apk |
05:15:55 | Xe | ldlework: I've followed that page and it's worked for me every time |
05:15:59 | Xe | as in completely |
05:16:46 | ldlework | Xe: and you had an apk? |
05:16:49 | Xe | yep |
05:16:50 | ldlework | as a result of the build? |
05:17:01 | ldlework | maybe its because I'm building a python package? |
05:17:24 | Xe | just start with a new container and follow that page completely, trust me |
05:17:38 | ldlework | I have :/ |
05:19:44 | dalarmmst | Does nim not care about case sensitivity? |
05:20:03 | dalarmmst | proc x(hello: int): int = result = hellO * hellO |
05:20:09 | dalarmmst | this compiles and runs |
05:20:25 | fowl | dalarmmst, only the first letter is case sensitive :) |
05:20:36 | fowl | h_e_l_l_o == hELLO too |
05:20:52 | ldlework | http://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |
05:21:14 | dalarmmst | Ah ok, thanks! |
05:21:54 | * | repax_ joined #nim |
05:23:48 | Xe | fowl: if `var splitline = input.split(' ')` `and args = splitline[2 .. ^2]`, assuming `input = ":foo bar baz"`, shouldn't `args == @["baz"]` ? |
05:25:11 | * | repax quit (Ping timeout: 256 seconds) |
05:25:49 | kokozedman | how do I get a varargs expanded into a C function call taking a '...'? |
05:26:02 | fowl | Xe, this is saying to get the last item .. the item before the last item, ie its an empty slice |
05:27:06 | Xe | derp |
05:27:07 | fowl | ^2 is transformed to s.len-2 |
05:27:30 | fowl | no derp, it made me think lol |
05:28:33 | * | adu joined #nim |
05:28:33 | fowl | slicing used to have a different behavior where 0 .. -1 would return the whole string, but that was inconsistent with ranges and the .. iterator |
05:31:59 | Xe | how do I append one sequence to another? |
05:32:09 | Xe | just +? |
05:32:38 | fowl | & or add |
05:33:26 | * | vikaton quit (Quit: Connection closed for inactivity) |
05:33:30 | * | dalarmmst quit (Ping timeout: 272 seconds) |
05:35:19 | Xe | ah |
05:37:24 | * | adu quit (Quit: Leaving) |
05:40:09 | * | gsingh93 quit (Ping timeout: 240 seconds) |
05:55:46 | Xe | fowl: is there unit testing for nim yet? |
05:56:01 | Xe | So far I have https://github.com/Xe/code/blob/master/irc/ircmess-nim/message.nim that pukes out tap, but it looks kinda terrifying |
06:04:00 | fowl | Unit testing module sucks, you could do better with simple templates |
06:04:05 | fowl | Let me look |
06:04:19 | Xe | at the least I'd like to be able to puke out TAP |
06:06:20 | fowl | Not sure what tap is, you need to write your own assert() type that outputs failures how you need |
06:06:33 | fowl | Assert type of template |
06:07:48 | Xe | hmm |
06:07:54 | Xe | tap is Test Anything Protocol |
06:08:00 | Xe | https://en.wikipedia.org/wiki/Test_Anything_Protocol |
06:08:16 | kokozedman | guys, anyone knows how to expand that varargs? like a function receiving a varargs, and then it in turns calls another function with item0, item1, item2, itemn, ... from the varargs? I can only see examples of iterating on the varargs, not expanding it inplace |
06:10:56 | * | gokr_ quit (Ping timeout: 240 seconds) |
06:13:05 | * | skyfex__ joined #nim |
06:15:30 | * | dtscode joined #nim |
06:15:39 | * | yglukhov___ joined #nim |
06:15:51 | kokozedman | Araq, could you help me on this one? |
06:17:19 | dtscode | What's the issue? |
06:17:51 | filwit | kokozedman: have you tried just passing the args? eg: proc foo(args:varargs[int]) = bar(args) |
06:18:02 | filwit | not sure that will work, can't remember |
06:18:45 | filwit | but basically varargs are special like that, for instance you should be able to do `let s = @[args]` to turn them into a seq |
06:19:42 | * | bjz joined #nim |
06:19:49 | * | yglukhov___ quit (Ping timeout: 245 seconds) |
06:20:07 | filwit | the args are somewhat magic IIRC, but they basically represent hand-written AST. So as long as the parameters of the proc you're trying to call with them match, it should work. |
06:21:22 | * | bjz quit (Client Quit) |
06:21:38 | * | gokr_ joined #nim |
06:21:42 | * | BlaXpirit is now known as Guest27885 |
06:21:42 | * | BlaXpirit_ joined #nim |
06:21:42 | * | Guest27885 quit (Killed (cameron.freenode.net (Nickname regained by services))) |
06:21:42 | * | BlaXpirit_ is now known as BlaXpirit |
06:21:56 | * | dalarmmst joined #nim |
06:22:32 | filwit | err.. the @[args] thing doesn't work actually, one sec |
06:23:02 | ldlework | Xe: hey |
06:23:19 | ldlework | I got it to work :) |
06:23:51 | Xe | yay |
06:24:49 | filwit | kokozedman: https://gist.github.com/PhilipWitte/3bb61b3b9fdb0a7cd9c9 |
06:24:52 | ldlework | Xe: docker pull -it -v /var/run/docker.sock:/var/run/docker.sock dlacewell/console |
06:25:07 | ldlework | oops |
06:25:09 | ldlework | docker run* |
06:26:51 | * | bjz joined #nim |
06:26:52 | Xe | ldlework: swanky |
06:28:42 | * | bjz quit (Client Quit) |
06:28:51 | * | BlaXpirit quit (Quit: Quit Konversation) |
06:29:00 | * | bjz joined #nim |
06:29:01 | filwit | kokozedman: you can also use 'strutils.toSeq()' to convert varargs to a seq, like this: let s = toSeq(args.items) |
06:29:16 | * | bjz quit (Client Quit) |
06:29:32 | kokozedman | filwit, I have already tried something like that, but when I looked at the generated C code that calls the C method, it does not expand |
06:30:02 | filwit | kokozedman: not sure what you mean, i just compiled an ran that gist code |
06:31:17 | kokozedman | filwit, I'm trying to use it on a C library with the signature pbc_pattern_new(struct pbc_env * , const char * message, const char *format, ...); ... the last '...' is a series of int that specifies offsets |
06:31:28 | kokozedman | it doesn't get expanded correctly in the generated C code |
06:31:44 | filwit | ah, i see.. you need to use the {.varargs.} pragma |
06:31:46 | kokozedman | I'm getting something like this: result = pbc_pattern_new(e_93037, msg->data, format->data, offsets); |
06:32:27 | filwit | kokozedman: http://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma |
06:32:31 | kokozedman | I think I'm already using varargs pragma |
06:32:33 | kokozedman | proc pbc_pattern_new*(a2: ptr pbc_env; message: cstring; format: cstring): ptr pbc_pattern {. |
06:32:33 | kokozedman | varargs, cdecl, importc: "pbc_pattern_new", header: "pbc.h".} |
06:32:40 | kokozedman | that was generated by c2nim |
06:33:12 | filwit | one sec |
06:33:13 | * | dalarmmst quit (Ping timeout: 264 seconds) |
06:33:19 | ldlework | Xe: I'll take that as a compliment :) |
06:33:38 | Xe | ldlework: it's basic at the moment, but it is a nice overview! |
06:34:57 | kokozedman | filwit, it's a C library for ProtocolBuffer from https://github.com/cloudwu/pbc |
06:34:59 | ldlework | Xe: what would you like it to do |
06:35:27 | Xe | ldlework: memory usage against its cap would be nice, as would CPU perc usage |
06:35:42 | ldlework | Xe: yeah metrics will be nice |
06:35:53 | fowl | @[args]? @args works |
06:35:54 | ldlework | Xe: the curses lib has timeseries graphs and shit |
06:36:01 | fowl | if args is varargs |
06:36:32 | fowl | filwit, ^ |
06:36:50 | fowl | @ is actually an operator on openarray |
06:36:52 | fowl | iirc |
06:37:00 | filwit | fowl: interesting, good to know. |
06:37:07 | * | nande quit (Remote host closed the connection) |
06:38:34 | * | gokr_ quit (Ping timeout: 245 seconds) |
06:38:55 | fowl | kokozedman, nims varargs wont work there |
06:39:02 | fowl | it would require assembly |
06:39:07 | ldlework | Xe: you should come to either #nim-offtopic or #python-offtopic |
06:41:36 | * | gokr_ joined #nim |
06:42:17 | kokozedman | fowl, I'm not following you... |
06:42:26 | Xe | in the except block of a try, how do I get stacktrace info? |
06:42:41 | Xe | oh derp |
06:44:46 | * | dalarmmst joined #nim |
06:45:12 | fowl | kokozedman, ok http://stackoverflow.com/questions/280940/calling-a-c-function-with-a-varargs-argument-dynamically says its possible if you can call the va_list version (its different than ...) |
06:45:48 | fowl | but on pbc.h i dont see any va_list functions, just one that accepts ... |
06:48:11 | * | endragor quit (Read error: Connection reset by peer) |
06:48:17 | * | endragor_ joined #nim |
06:49:28 | fowl | plus in nim, varargs[T] is one type, you can pass different types to it but you have to provide a function that they filter through, varargs[string, `$`] so if you have that, it wouldn't work in a c-style format string where the arguments would be packed together |
06:50:29 | dalarmmst | http://pastebin.com/BhFEn7uy , how do I create a stack allocated instance here of RegOperand? |
06:50:45 | dalarmmst | I get: Error: conversion from int to RegOperand is invalid |
06:51:27 | fowl | dalarmmst, object constructor syntax names the fields, RegOperand(regType: reg) would work here |
06:52:08 | filwit | kokozedman: well this is starting to work: https://gist.github.com/PhilipWitte/3bb61b3b9fdb0a7cd9c9 |
06:52:44 | filwit | github's Nim highlighting doesn't seem to like the 'emit' pragma |
06:54:28 | filwit | kokozedman: it prints the correct number of varargs, but the actual numbers are incorrect |
06:56:55 | dalarmmst | fowl: Thanks |
07:00:53 | kokozedman | filwit, I'm not accustomed to Nim's macro features, but shouldn't it be possible using the correct ast calls? |
07:01:40 | kokozedman | calling the C function manually with the right set of arguments should be fine... but the problem is the arguments are from varargs not statically typed-in |
07:02:58 | filwit | kokozedman: I don't think you need macros in this situation. The code example I posted is almost working correctly, but slightly off.. I've never done this before, so someone more informed might be able to help figure this out. |
07:04:27 | * | kokozedman_ joined #nim |
07:05:23 | fowl | filwit, maybe this will help you see whats going on |
07:05:36 | fowl | https://gist.github.com/fowlmouth/000cb78b33b1fe2a95fd |
07:06:24 | filwit | fowl: yeah i was just about to do that |
07:06:32 | * | endragor joined #nim |
07:07:52 | * | kokozedman quit (Ping timeout: 272 seconds) |
07:07:57 | kokozedman_ | filwit, your example exhibits the same problem that I face... the generated C code does not expand the nums into 3 distinct arguments: foobar(((int) 3), nums); |
07:08:30 | filwit | kokozedman_: I see, so you where already a step ahead. |
07:08:44 | fowl | kokozedman_, it cant.. varargs can come from a seq |
07:08:57 | fowl | should different functions be generated on the fly when a seq of a new size gets passed in? |
07:08:58 | filwit | kokozedman_: I still think this could probably be done without a macro, but that is always an option |
07:09:05 | kokozedman_ | fowl, filwit, so, I guess macro is the way to go for this |
07:09:20 | kokozedman_ | :) |
07:09:41 | kokozedman_ | would be great if there is a way... at this time, I have no single idea what it might be |
07:09:46 | filwit | kokozedman_: i would continue asking around. See what Araq has to say when he's wakes up. |
07:09:54 | Xe | fowl: do you have a better explanation about how array splicing in nim works? |
07:09:57 | fowl | i am trying to work on a nice unpacking mechanism for vararg[expr] from templates |
07:10:03 | kokozedman_ | filwit, fowl, you guys know how to craft a macro for this situation? |
07:10:19 | filwit | kokozedman_: yes, give me a sec |
07:10:24 | * | endragor_ quit (Ping timeout: 272 seconds) |
07:10:39 | fowl | kokozedman_, yes make it accept vararg[expr] and the vararg opts come in an array |
07:12:04 | fowl | Xe, RTFC ;) https://github.com/Araq/Nim/blob/devel/lib/system.nim#L2899 |
07:13:05 | * | bjz joined #nim |
07:13:21 | fowl | you'll have to check the docs for `^` |
07:13:39 | fowl | its some new magic |
07:16:34 | * | HakanD joined #nim |
07:17:27 | filwit | kokozedman_: works with the macro: https://gist.github.com/PhilipWitte/3bb61b3b9fdb0a7cd9c9 |
07:19:44 | * | endragor quit (Remote host closed the connection) |
07:20:29 | kokozedman_ | filwit, yes, that works great! What's this "quote do:" syntax? |
07:21:10 | kokozedman_ | I don't see that in the manual... kind of new to me |
07:21:30 | filwit | kokozedman_: it's basically 'parseStmt' but without passing a string. You can inject vars into it with ``, so it's a bit cleaner |
07:21:45 | filwit | kokozedman_: it's in the macros lib |
07:22:20 | kokozedman_ | ah, I see it... thanks filwit |
07:22:20 | filwit | kokozedman_: which i forgot to include the 'import macros' in that gist |
07:22:24 | filwit | np |
07:23:30 | * | phira left #nim ("aarrgh") |
07:30:55 | * | ingsoc joined #nim |
07:35:43 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:42:13 | * | yglukhov___ joined #nim |
07:55:26 | * | OnO joined #nim |
08:04:56 | kokozedman_ | filwit, do you know how to handle situations like: Error: value of type 'ptr pbc_pattern' has to be discarded. I replaced the foobar call to the C function, and I'm getting this now |
08:06:11 | filwit | kokozedman_: you need to use a 'discard' statement |
08:06:30 | kokozedman_ | filwit, but I need that returned pointer |
08:06:57 | * | gokr_ quit (Remote host closed the connection) |
08:07:26 | filwit | i'm not sure exactly what your code looks like, so I'm a bit confused |
08:08:18 | filwit | you only get a that error when you try to call a proc which returns something and you don't catch it |
08:08:58 | pigmej | reactormonk: I wish... |
08:09:04 | * | Trustable joined #nim |
08:09:22 | pigmej | reactormonk: generally the problem... I'm quite overloaded last time ;/ I even had no time to read nim news ;/ |
08:09:52 | kokozedman_ | filwit, https://gist.github.com/eliezedeck/926127cd46f89abd2f79 |
08:10:39 | filwit | which line is throwing the error? |
08:11:11 | filwit | err, wait, i think i see |
08:12:02 | filwit | the problem is you're trying to assign a 'stmt' to a 'PBCPattern'. A 'stmt' is raw Nim AST |
08:12:45 | filwit | try making it an 'expr' actually.. that might fix it if you need the return value from the C proc |
08:14:04 | filwit | depending on what 'PBCPattern', you may need to do some converting/casting as well.. though I'm still not exactly sure what is giving you the "needs to be discarded" message |
08:15:31 | kokozedman_ | filwit, well, the expr worked... but there is a strange thing here: the resulting C code is incomplete, not like your example: result = pbc_pattern_new(e_98095, msg->data, format->data); |
08:15:57 | kokozedman_ | after the format->data, there should be other parameters... it seems like the result[0].add(n) didn't have any effect |
08:17:17 | filwit | yeah, that's because the AST for a stmt and expr are different |
08:17:37 | filwit | you can inspect the AST with 'echo result.treeRepr' |
08:18:04 | filwit | basically, you want to add each 'n' as a child to the 'Call' node |
08:18:27 | * | MyMind joined #nim |
08:18:38 | kokozedman_ | filwit, isn't that what the code already does? |
08:18:38 | filwit | so you're probably looking at just doing "result.add n" instead of "result[0].add n" now |
08:18:51 | kokozedman_ | hmm... I see |
08:19:45 | filwit | basically, a 'stmt' will return a Statement node as the top level, while 'expr' will give you the Call node directly (ps, for future reference these are being changed to 'typed' and 'untyped' soon) |
08:20:18 | filwit | so when you return a statement, you need to add to one child down, thus the [0] |
08:20:35 | filwit | let me know if that works |
08:20:55 | kokozedman_ | filwit, well, the result.add(n) still doesn't work... |
08:20:56 | * | endragor joined #nim |
08:22:30 | filwit | put 'echo result.treerepr' at the end of the macro and look at the node structure. |
08:22:57 | kokozedman_ | filwit, I did, and it obviously is incomplete: |
08:22:59 | kokozedman_ | StmtList |
08:22:59 | kokozedman_ | Call |
08:22:59 | kokozedman_ | Sym "pbc_pattern_new" |
08:22:59 | kokozedman_ | Sym "e" |
08:22:59 | kokozedman_ | DotExpr |
08:23:00 | kokozedman_ | Sym "msg" |
08:23:02 | kokozedman_ | Sym "cstring" |
08:23:04 | kokozedman_ | DotExpr |
08:23:07 | kokozedman_ | Sym "format" |
08:23:07 | pigmej | kokozedman_: don't paste code on irc... |
08:23:09 | kokozedman_ | Sym "cstring" |
08:23:21 | kokozedman_ | sorry about that |
08:23:25 | filwit | no worries |
08:23:48 | pigmej | kokozedman_: it was not against you ;-) but generally good practice is to use some paste service ;) |
08:23:49 | * | rgv151_ joined #nim |
08:24:16 | filwit | as long as it's not super long and there's not a ton of conversations going on it's no big deal |
08:24:34 | kokozedman_ | pigmej, yes, I'm aware, but I thought it was short enough... |
08:24:36 | filwit | anyways, it looks like you're still returning a 'StmtList' as the top element... |
08:24:48 | kokozedman_ | yes, that's what I thought |
08:25:49 | filwit | are you sure your C function can take a 'PBCEnv' ? I'm not sure what this type is |
08:25:59 | kokozedman_ | filwit, I tried result[0], result[1] and even result[2] (???) and I'm getting the same thing |
08:26:25 | kokozedman_ | PBCEnv is a C `struct pbc_env *` |
08:26:36 | filwit | you sure this is the AST after when the macro is returning a 'expr' ? |
08:26:44 | kokozedman_ | the code actually compiles, just incomplete |
08:26:58 | filwit | oh.. duh, it's cause of the 'quote do' which always make a StmtList |
08:27:06 | filwit | you need to make the call node directly |
08:27:55 | kokozedman_ | but isn't result[0] accessing the `Call`? like you did before |
08:28:07 | filwit | kokozedman_: I can help, but you here's the functions you need to call: http://nim-lang.org/docs/macros.html#newCall,NimNode,varargs[NimNode] |
08:28:44 | kokozedman_ | filwit, first where should I have the treeRepr, at the end of the macro? (that's where I'm having it now) |
08:29:12 | filwit | yes at the end is good (cause it'll show the accumulated result) |
08:29:33 | kokozedman_ | ok, so, it really didn't add the extra arguments |
08:29:50 | filwit | you want to not have the StmtList there so you can get the return value from it (you want the macro call to appear like you hand-wrote a call to the C proc) |
08:30:06 | filwit | but yeah, I don't know why it's not adding the arguments... |
08:31:06 | filwit | look at the 'newCall()' proc though.. one takes a string name and a varargs list of params.. you may be able to just pass the varargs directly into that |
08:31:14 | filwit | let me to do a test real quick |
08:31:26 | kokozedman_ | filwit, may be I might need to manually add newLit() |
08:31:38 | filwit | hmm.. possibly |
08:32:01 | filwit | oh yeah, you're probably right |
08:33:25 | filwit | one sec. |
08:36:05 | * | rgv151_ quit (Remote host closed the connection) |
08:37:59 | filwit | kokozedman_: do this: https://gist.github.com/PhilipWitte/3f77d0876ca82d13c6bb |
08:38:07 | filwit | roughly speaking |
08:38:50 | * | Demon_Fox quit (Quit: Leaving) |
08:39:03 | filwit | hmm... let me just adapt the gist you wrote real quick |
08:40:52 | filwit | kokozedman_: this should work for you: https://gist.github.com/PhilipWitte/3f77d0876ca82d13c6bb |
08:41:03 | * | JinShil quit (Quit: Konversation terminated!) |
08:42:14 | filwit | although, it might be a good idea to pass 'msg' and 'format' as 'cstring' and do the conversion in the proc instead of the macro |
08:42:19 | kokozedman_ | filwit, man... I don't know why is the extra parameters not being added |
08:42:32 | filwit | eh? |
08:42:34 | kokozedman_ | yes, I've already changed to that |
08:42:49 | filwit | is something still wrong? |
08:43:29 | kokozedman_ | filwit, this time, it's still a bit like before... (warning... going to paste) |
08:43:35 | kokozedman_ | Call |
08:43:36 | kokozedman_ | Ident !"pbc_pattern_new" |
08:43:36 | kokozedman_ | Sym "e" |
08:43:36 | kokozedman_ | Conv |
08:43:36 | kokozedman_ | Sym "cstring" |
08:43:37 | kokozedman_ | Sym "msg" |
08:43:39 | kokozedman_ | Conv |
08:43:41 | kokozedman_ | Sym "cstring" |
08:43:43 | kokozedman_ | Sym "format" |
08:43:50 | kokozedman_ | there other 2 remaining are still not there |
08:44:06 | kokozedman_ | not the 2, but the other trailing parameters are still not there |
08:44:24 | filwit | yeah i see, that's why i said do the conversion in the proc instead. |
08:44:41 | filwit | well.. maybe that doesn't matter, nevermind |
08:45:23 | kokozedman_ | already: macro wrapped_pbc_pattern_new(e: PBCEnv, msg, format: cstring, offsets: varargs[int]): expr |
08:45:38 | * | endragor quit (Ping timeout: 256 seconds) |
08:45:45 | filwit | can you update your gist? |
08:46:17 | filwit | i want to see exactly what your code looks like |
08:46:35 | filwit | i just did a test and the params are adding for me |
08:46:43 | filwit | not sure why they wouldn't be adding for you |
08:46:46 | kokozedman_ | filwit, ok: https://gist.github.com/eliezedeck/926127cd46f89abd2f79 |
08:47:04 | kokozedman_ | I'm wondering what's wrong as well |
08:47:34 | filwit | ps, i don't think you need to explicitly convert a string -> cstring |
08:48:15 | filwit | you're using the latest compiler? |
08:48:47 | kokozedman_ | yes, 0.11.2 |
08:49:16 | kokozedman_ | you're right |
08:49:38 | kokozedman_ | now, the tree is: |
08:49:39 | kokozedman_ | Call |
08:49:39 | kokozedman_ | Ident !"pbc_pattern_new" |
08:49:39 | kokozedman_ | Sym "e" |
08:49:39 | kokozedman_ | Sym "msg" |
08:49:40 | kokozedman_ | Sym "format" |
08:50:23 | kokozedman_ | resulting C code is still: result = pbc_pattern_new(e_98091, msg->data, format->data); |
08:51:17 | filwit | yeah one sec, i'm testing your exact code, but need to fill in the gaps, one minute |
08:53:35 | kokozedman_ | for your ref: proc pbc_pattern_new*(a2: ptr pbc_env; message: cstring; format: cstring): ptr pbc_pattern {.varargs, cdecl, importc: "pbc_pattern_new", header: "pbc.h".} |
08:53:45 | filwit | kokozedman_: doesn't look like anything's being passed to the macro's varargs param for some reason (len == 0) |
08:55:18 | filwit | that's very odd.. i wonder if this is a bug.. let me pull on a few things |
08:56:29 | kokozedman_ | filwit, seems to begin to appear as a bug |
08:57:34 | filwit | it certainly looks like a bug, but I'm trying to isolate it.. i just removed all params exect the varargs and it still doesn't pass them.. which doesn't make sense since I just wrote basically that exact code and had it work |
08:58:16 | kokozedman_ | filwit, yeah, weird, I'm also having offsets.len == 0 |
08:59:15 | kokozedman_ | FWIW, I'm passing the offsets as: @[1, 2, 3, 4] |
08:59:32 | filwit | ah, i think i see what's going on.. it's cause the macro call is being executed at compile-time (at the call made to it) |
08:59:42 | filwit | so you need to make the proc a generic, one sec |
09:02:50 | filwit | kokozedman_: works: https://gist.github.com/PhilipWitte/3f77d0876ca82d13c6bb |
09:02:54 | filwit | also, not a bug |
09:02:58 | filwit | which is good |
09:05:49 | filwit | kokozedman_: the reason it needs to be a template is because macros will be invoked when they're first seen (cause they're compile-time entities).. so the macro was triggering when the proc was defined. By using a template instead, we're just delaying that compile-time execution until the call-site of the template. |
09:05:54 | filwit | if that makes any sense |
09:07:52 | kokozedman_ | filwit, yes, that makes some sense... like I said, I'm really still trying to grasp the macro thing (actually just got my hands dirty in this thing just today) |
09:07:56 | kokozedman_ | let me try it... |
09:09:00 | filwit | yeah they can be tricky.. I've been doing macro/template stuff for a good year now and obviously I still had problems seeing the issues here as well. Kinda tired though, so I'll run with that excuse :P |
09:12:15 | kokozedman_ | filwit, huge thanks man! it worked! |
09:12:32 | filwit | great! |
09:38:37 | * | BlaXpirit joined #nim |
09:53:05 | * | gokr_ joined #nim |
10:01:29 | * | gokr_ quit (Ping timeout: 245 seconds) |
10:02:37 | * | gokr_ joined #nim |
10:04:15 | * | rgv151_ joined #nim |
10:06:43 | * | EulersBackup joined #nim |
10:08:30 | * | cryzed quit (Quit: ZNC - http://znc.in) |
10:12:14 | * | buup joined #nim |
10:24:54 | * | rgv151_ quit (Remote host closed the connection) |
10:29:11 | * | cryzed joined #nim |
10:35:20 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
10:39:57 | * | rgv151_ joined #nim |
10:44:59 | * | rgv151_ quit (Quit: Leaving...) |
10:45:38 | * | repax_ is now known as repax |
10:49:26 | * | vendethiel joined #nim |
10:54:28 | * | kashyap_ joined #nim |
10:56:32 | kashyap_ | Hi ... this link is broken - http://nim-lang.org/docs/c2nim.html |
10:57:13 | BlaXpirit | kashyap_, i'd rather call it discontinued |
10:57:21 | BlaXpirit | because c2nim is now a separate thing |
10:57:29 | BlaXpirit | i think |
10:57:33 | BlaXpirit | not part of core nim |
10:57:44 | kashyap_ | I see |
10:58:14 | kashyap_ | https://github.com/nim-lang/c2nim looks like the right project though |
10:58:52 | BlaXpirit | kashyap_, or maybe it is a problem |
10:58:56 | BlaXpirit | because http://nim-lang.org/0.11.0/c2nim.html exists |
10:59:02 | BlaXpirit | only 0.11.2 is missing |
10:59:21 | kashyap_ | ok |
10:59:50 | Varriount | Anyone have an idea of what the python code on this page is supposed to do? http://forum.nim-lang.org/t/1203 |
11:05:24 | * | elbow_json joined #nim |
11:05:49 | * | elbow_jason quit (Read error: No route to host) |
11:14:11 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:16:04 | * | ingsoc quit (Quit: Leaving.) |
11:20:57 | * | thotypous joined #nim |
11:22:28 | * | kashyap_ quit (Ping timeout: 246 seconds) |
11:24:25 | * | rgv151 quit (Quit: Leaving...) |
11:24:34 | * | vendethiel quit (Ping timeout: 255 seconds) |
11:36:35 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:37:37 | * | johnsoft quit (Ping timeout: 255 seconds) |
11:38:12 | * | johnsoft joined #nim |
11:42:38 | * | vendethiel joined #nim |
11:43:10 | * | dddddd joined #nim |
11:45:06 | buup | mighn't be the best channel for this but! what's the most idiomatic way to asynchronously run something say, every hour? |
11:45:27 | buup | using a while true: loop and sleepAsync right now but it feels a bit dirty. |
11:45:47 | def- | I'd just use a cronjob |
11:46:50 | buup | this is in the code, to update a var |
11:46:52 | buup | :o |
11:50:24 | def- | I guess then sleepAsync or just sleep work |
11:50:43 | buup | hm, alright! |
11:58:19 | * | banister joined #nim |
12:05:42 | * | HakanD quit (Quit: Be back later ...) |
12:06:44 | kokozedman_ | def-, talking about async... do you know how stable is these guys now? in the libs, asyncdispatch and company are still mentioned as highly experimental |
12:07:40 | Varriount | kokozedman_: It's still under development. I don't foresee any drastic changes though. |
12:08:21 | kokozedman_ | I see |
12:08:32 | def- | kokozedman_: I guess the best way would be to try them out and report back how well they work |
12:08:47 | buup | there's a weird GC crash in asyncdispatch somewhere |
12:09:53 | def- | I'm only running 1 thing with async*: http://hookrace.net/blog/what-is-special-about-nim/#compile-to-javascript Hasn't made any problems in the last 5 months |
12:10:11 | def- | 4 months* |
12:11:11 | buup | maybe it's something recent |
12:18:44 | * | endragor joined #nim |
12:19:21 | * | HakanD joined #nim |
12:23:40 | Araq | Varriount: can you update devel to 0.11.3 please? |
12:26:48 | buup | was nim inspired at all by DM? |
12:27:02 | buup | i don't see why it would be but the keywords and some bits of syntax are so similar.. |
12:27:19 | Araq | what's DM? |
12:27:27 | buup | nevermind then! |
12:27:41 | buup | really obscure old language that calls procs procs and vars vars |
12:27:59 | TEttinger | doesn't pascal do that? |
12:28:02 | Araq | I took 'proc' from TCL :P |
12:28:09 | TEttinger | ah |
12:28:13 | Araq | not really though |
12:28:27 | buup | and spawn and "result", it just felt a bit similar >~> |
12:28:37 | buup | probably for the best it's not inspired by DM though |
12:30:22 | * | EulersNoodle joined #nim |
12:31:26 | Araq | TEttinger: pascal uses "function" and "procedure" where "function" means "procedure with return value" |
12:32:19 | Araq | this doesn't make too much sense and so wasn't copied for most later languages |
12:32:24 | * | EulersBackup quit (Ping timeout: 244 seconds) |
12:34:10 | Araq | later on Wirth only used PROCEDURE in all caps cause he couldn't imagine syntax highlighting |
12:36:00 | * | endragor quit (Remote host closed the connection) |
12:38:41 | * | endragor joined #nim |
12:43:15 | * | EulersNoodle quit (Ping timeout: 244 seconds) |
12:48:24 | * | saml_ joined #nim |
12:49:03 | * | ddl_smurf joined #nim |
13:04:40 | * | Jehan_ joined #nim |
13:06:01 | * | endragor quit (Remote host closed the connection) |
13:10:10 | * | endragor joined #nim |
13:10:58 | * | endragor quit (Remote host closed the connection) |
13:12:19 | Jehan_ | Why do we now have a submodule in the Nim repo and a git dependency in build.sh?? |
13:13:31 | * | banister quit (Read error: Connection reset by peer) |
13:20:09 | Jehan_ | Not to mention with a relative url that will break whenever the remote is not on github? |
13:22:46 | * | saml_ quit (Remote host closed the connection) |
13:30:17 | * | banister joined #nim |
13:31:46 | * | ingsoc joined #nim |
13:37:07 | * | d3m1gd joined #nim |
13:37:50 | Araq | Jehan_: OnO thought it was a good idea and I don't care. what's wrong with it? |
13:38:06 | Jehan_ | Araq: See my issue. It's broken. |
13:38:52 | Araq | I don't understand your issue |
13:39:27 | Jehan_ | Example: You run build.sh with an empty csources, it pulls csources and everything works. |
13:39:48 | Araq | that's the desired feature |
13:40:06 | Jehan_ | A few weeks later, you do it again. csources is outdated, but because build.sh sees csources/.git, it doesn't pull the new csources revision. |
13:40:15 | Jehan_ | ANd tries to build with the outdated version. |
13:40:52 | Jehan_ | If the check were correct, it still wouldn't work, because there's already a shallow checkout in there. |
13:40:54 | reactormonk | so it should just pull? |
13:41:10 | Jehan_ | reactormonk: --depth 1 and submodules don't really mix. |
13:41:23 | Jehan_ | The other issue is that the URL is relative. |
13:41:32 | Jehan_ | This means that it only works if the remote is the github one. |
13:41:37 | fowl | --depth 1 is a must have. The repos are huge |
13:41:48 | Jehan_ | fowl: Yeah. That's the problem. |
13:42:40 | Araq | well I guess we could stop misung github as a download provider |
13:42:43 | Jehan_ | If I have a local clone of the repo, the build script will simply break. |
13:42:47 | Jehan_ | + '[' '!' -e csources/.git ']' |
13:42:47 | Jehan_ | + git submodule update --init --depth 1 |
13:42:47 | Jehan_ | Submodule 'csources' (/tmp/nim-lang/csources.git) registered for path 'csources' |
13:42:47 | Jehan_ | fatal: repository '/tmp/nim-lang/csources.git' does not exist |
13:42:47 | Jehan_ | Clone of '/tmp/nim-lang/csources.git' into submodule path 'csources' failed |
13:43:45 | fowl | Since you have to clone csources that probably breaks PKGBUILDs and everything else that relies on the bootstrapping process? |
13:46:04 | Araq | I don't know why we have the toplevel build.sh script to begin with |
13:46:20 | Araq | it does all sorts of bullshit |
13:47:29 | Jehan_ | Well, even manually, the git submodule commands don't work with the --depth 1 part properly. |
13:50:36 | Araq | uh oh our install.txt instructions say to run this thing ... wtf |
13:51:03 | Araq | Then run the following command:: |
13:51:04 | Araq | sh build.sh |
13:51:06 | Araq | Unlike other software, Nim does not distribute its files over the whole file |
13:51:07 | Araq | hierarchy. |
13:51:11 | Araq | er ... but it does |
13:51:24 | Araq | no wonder people have all sorts of problems |
13:51:52 | Araq | I'll revert all of this, I'm tired of people knowing better than me when they don't |
13:54:24 | * | HakanD_ joined #nim |
13:55:19 | * | HakanD quit (Ping timeout: 255 seconds) |
13:57:46 | Araq | hrm build.sh in the .zip is the real build script |
13:58:03 | Araq | and build.sh in the github repo is something else. yay |
13:59:16 | * | johnsoft quit (Ping timeout: 240 seconds) |
14:00:05 | * | johnsoft joined #nim |
14:04:52 | * | JinShil joined #nim |
14:06:08 | reactormonk | Araq, need a Makefile? ^^ |
14:07:00 | Araq | as much as I need the 8.3 filenames |
14:07:11 | Araq | or floppy disks |
14:11:12 | * | Matthias247 joined #nim |
14:12:22 | * | vikaton joined #nim |
14:12:44 | * | TEttinger quit (Ping timeout: 245 seconds) |
14:16:38 | * | buup is now known as buupisaway |
14:18:56 | * | gokr_ quit (Ping timeout: 240 seconds) |
14:19:29 | * | gokr_ joined #nim |
14:21:21 | * | jholland joined #nim |
14:24:39 | * | saml quit (Remote host closed the connection) |
14:29:19 | reactormonk | Araq, how difficult would it be to simply ask the compiler via nimsuggest which indentation it expects next? |
14:29:46 | reactormonk | nim-mode identation is bugged and I'm considering my options. |
14:31:21 | * | endragor joined #nim |
14:36:59 | * | Strikecarl joined #nim |
14:37:37 | * | kokozedman_ quit (Quit: Leaving) |
14:38:26 | * | gsingh93 joined #nim |
14:39:58 | * | darkf quit (Quit: Leaving) |
14:40:08 | Araq | reactormonk: I don't know. |
14:42:33 | reactormonk | kk |
14:43:40 | * | saml joined #nim |
14:45:39 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:50:21 | * | endragor quit (Remote host closed the connection) |
14:51:45 | * | arnetheduck quit (Ping timeout: 240 seconds) |
14:52:01 | * | JinShil quit (Quit: Konversation terminated!) |
14:56:21 | reactormonk | what's con in nimsuggest for exactly? |
14:56:58 | * | aboisvert joined #nim |
14:57:30 | Araq | http://nim-lang.org/docs/nimsuggest.html#nimsuggest-invocation-invocation-context |
14:58:11 | * | Strikecarl joined #nim |
14:59:09 | reactormonk | thanks |
14:59:34 | Strikecarl | Guys, i made a program that decodes Base64 stuff, pretty basic, but meh, but if i try to decode a non Base64 hash lets say i try to decode "Penis" it crashes, how can i prevent that? Like make an exception that just says "nope" instead of it crashing? |
14:59:55 | reactormonk | Strikecarl, you raise a ValueError? |
15:00:16 | Strikecarl | base64.nim(106) decode |
15:00:16 | Strikecarl | system.nim(2960) failedAssertImpl |
15:00:16 | Strikecarl | system.nim(2164) raiseAssert |
15:00:16 | Strikecarl | Error: unhandled exception: i == s.len [AssertionError] |
15:00:19 | Strikecarl | This error ^ |
15:00:47 | Strikecarl | what do i use for the Except thing? |
15:00:51 | Strikecarl | raiseAssert? |
15:00:57 | Strikecarl | or failedAssertImpl? |
15:05:00 | reactormonk | http://nim-lang.org/docs/manual.html#exception-handling-raise-statement |
15:05:42 | Strikecarl | what to raise? |
15:05:46 | Strikecarl | Assert? |
15:05:59 | fowl | Strikecarl, you ask for an exception but thers already an exception being raised |
15:06:09 | Strikecarl | Oh |
15:06:35 | fowl | http://nim-lang.org/docs/manual.html#exception-handling-except-clauses |
15:06:54 | Jehan_ | Well, careful, since assert will be disabled in -d:release mode. |
15:07:17 | Jehan_ | decode has a precondition that the string is in base64 format. |
15:07:55 | Strikecarl | I was thinking of just doing an if statement but i realized that base64 didn't have a type, or atleast not one i could find. |
15:07:56 | Jehan_ | This is arguably a problem, since it's not easy to verify this condition without ... well, decoding the string. |
15:08:45 | Araq | yup, you need to patch the module |
15:09:12 | Strikecarl | Well, it isn't a big problem, for me atleast. |
15:11:10 | * | elbow_json quit (Read error: Connection reset by peer) |
15:17:37 | * | bjz joined #nim |
15:18:59 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:20:43 | Araq | what format to generate for code coverage stuff? |
15:23:38 | * | xificurC quit (Read error: Connection reset by peer) |
15:24:14 | * | xificurC joined #nim |
15:26:12 | * | brson joined #nim |
15:32:33 | dom96 | Araq: XML? JSON? |
15:33:11 | Araq | dom96: yeah but I like some standard so that I get a nice htmlgen for free |
15:34:00 | dom96 | dunno |
15:34:06 | dom96 | search and see what format other tools use |
15:34:22 | Araq | yeah ... cannot find much |
15:34:32 | Araq | seems like everybody has their own format |
15:35:33 | BlaXpirit | what is code coverage stuff? |
15:38:59 | reactormonk | BlaXpirit, how much code is actually run by tests |
15:39:50 | BlaXpirit | it finally dawned on me what that means |
15:40:01 | BlaXpirit | like, how it is actually checked |
15:41:02 | * | Strikecarl joined #nim |
15:41:16 | Strikecarl | How come Nim can't touch ÆØÅ? :'( |
15:41:19 | Strikecarl | Discrimination... |
15:42:00 | Strikecarl | http://i.imgur.com/knMYJUm.png |
15:42:18 | BlaXpirit | you mean windoze |
15:42:30 | BlaXpirit | or did u turn that string around |
15:42:42 | Strikecarl | i just did echo "æøå ÆØÅ" |
15:42:46 | Strikecarl | and that happened. |
15:42:57 | dom96 | cmd.exe doesn't support unicode |
15:42:59 | dom96 | try powershell |
15:43:28 | Strikecarl | Yes it does? http://i.imgur.com/Nc8aTP6.png |
15:43:50 | yglukhov___ | Strikecarl: make sure your shell works in utf8 encoding |
15:44:04 | dom96 | Strikecarl: Run this: cmd /K chcp 65001 |
15:44:08 | yglukhov___ | not in your native one;) |
15:44:09 | * | drewsrem joined #nim |
15:44:13 | dom96 | er |
15:44:17 | dom96 | just chcp 65001 |
15:44:19 | dom96 | bad paste |
15:44:50 | Strikecarl | and that does? |
15:45:56 | dom96 | http://stackoverflow.com/questions/14109024/how-to-make-unicode-charset-in-cmd-exe-by-default |
15:46:07 | Strikecarl | I already had that. |
15:46:14 | Strikecarl | But the nim .exe still just types out |
15:46:26 | Strikecarl | http://i.imgur.com/q5R8Yqi.png |
15:47:30 | BlaXpirit | you may have also saved the file in your local codepage |
15:47:45 | Strikecarl | huh? |
15:48:33 | * | HakanD_ quit (Quit: Be back later ...) |
15:49:51 | Araq | Strikecarl: maybe you need to reopen your terminal |
15:50:45 | Strikecarl | Araq Nope Still |
15:50:49 | ddl_smurf | Strikecarl: you also need to make sure you have the lucida console font |
15:51:46 | * | csick joined #nim |
15:51:53 | BlaXpirit | man, windows is a lot of fun :s |
15:51:59 | ddl_smurf | (its in the properties when click the icon in the top left of the window of the terminal) |
15:52:01 | Strikecarl | :s |
15:52:10 | BlaXpirit | I think Python can detect codepage and try to output stuff in it |
15:52:31 | BlaXpirit | so that's why I didn't feel the whole extent of the problem |
15:52:36 | Strikecarl | ddl_smurf just tried |
15:52:42 | Strikecarl | I have that on |
15:52:45 | Strikecarl | still fucked up |
15:56:25 | ddl_smurf | try piping the output to a file and inspecting that to see if its correct unicode |
15:58:06 | Strikecarl | Welp, even windows doesn't like Denmark, that's a good sign :c |
15:59:02 | Araq | Something is rotten in the state of Denmark. |
15:59:46 | * | HakanD_ joined #nim |
16:00:18 | Strikecarl | Araq confirmed racist |
16:01:13 | ddl_smurf | to be fair http://en.wikipedia.org/wiki/Surstr%C3%B6mming |
16:01:36 | Strikecarl | Not danish, thankfully. |
16:01:37 | * | def- quit (Ping timeout: 264 seconds) |
16:02:33 | * | jfchevrette joined #nim |
16:03:29 | * | d3m1gd quit (Ping timeout: 250 seconds) |
16:03:46 | Araq | http://www.shakespeare-online.com/quickquotes/quickquotehamletdenmark.html |
16:04:17 | gokr_ | Classic quote |
16:05:52 | * | Matthias247 quit (Read error: Connection reset by peer) |
16:10:10 | * | vikaton quit () |
16:10:19 | * | yglukhov___ quit (Ping timeout: 255 seconds) |
16:10:22 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:12:13 | reactormonk | how "done" is the concept implementation? Gotta do a lot of concepts in stdlib |
16:23:02 | ldlework | Anyone want to write a package manager with me? :) |
16:25:57 | * | OnO joined #nim |
16:26:56 | * | HakanD__ joined #nim |
16:29:57 | * | brson quit (Quit: leaving) |
16:30:14 | * | brson joined #nim |
16:30:24 | * | HakanD_ quit (Ping timeout: 272 seconds) |
16:35:55 | * | def- joined #nim |
16:38:46 | * | xet7 quit (Quit: Leaving) |
16:40:38 | * | d3m1gd joined #nim |
16:41:48 | * | jfchevrette quit (Ping timeout: 272 seconds) |
16:49:14 | * | aboisvert_ joined #nim |
16:51:03 | dom96 | ldlework: package manager? what for? |
16:51:37 | ldlework | dom96: A docker based package manager. IE, software never touches your host but you get executable stubs in your bin directory to start containers. |
16:51:48 | ldlework | I think I want to use Nim |
16:51:53 | * | aboisvert quit (Ping timeout: 276 seconds) |
16:51:54 | * | aboisvert_ is now known as aboisvert |
16:54:17 | * | ingsoc1 joined #nim |
16:55:28 | dom96 | ldlework: cool |
16:56:52 | * | ingsoc quit (Ping timeout: 272 seconds) |
17:02:35 | * | aboisvert_ joined #nim |
17:02:45 | * | aboisvert quit (Ping timeout: 256 seconds) |
17:02:59 | * | aboisvert_ is now known as aboisvert |
17:10:20 | * | buupisaway is now known as buup |
17:31:53 | * | dddddd quit (Ping timeout: 250 seconds) |
17:47:42 | * | HakanD__ quit (Quit: Be back later ...) |
18:00:28 | * | buup is now known as buupisaway |
18:02:40 | * | yglukhov___ joined #nim |
18:31:46 | someplace | is there a hmac lib in the stdlib or on nimble somewhere? |
18:31:52 | * | MyMind quit (Ping timeout: 272 seconds) |
18:31:56 | * | loz1 joined #nim |
18:45:00 | * | OnO quit (Quit: Textual IRC Client: www.textualapp.com) |
18:50:51 | * | fizzbooze joined #nim |
19:00:38 | * | Strikecarl joined #nim |
19:00:44 | Strikecarl | What is LPVOID? |
19:00:47 | Strikecarl | in ReadProcessMemory |
19:04:02 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:05:25 | BlaXpirit | http://google.com/#q=LPVOID |
19:14:19 | * | Jesin joined #nim |
19:15:37 | * | banister joined #nim |
19:16:56 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
19:26:21 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:29:52 | dalarmmst | http://nim-lang.org/docs/typeinfo.html#getEnumField,TAny , do I need to include something to use this? |
19:30:24 | dalarmmst | import* |
19:31:21 | * | aboisvert quit (Ping timeout: 240 seconds) |
19:32:05 | * | aboisvert joined #nim |
19:38:39 | * | dddddd joined #nim |
19:42:28 | renesac | dalarmmst: only importing that typeinfo module don't works? |
19:42:29 | * | banister joined #nim |
19:42:32 | * | filcuc joined #nim |
19:46:14 | gokr_ | surströmming is swedish btw |
19:52:15 | * | fizzbooze quit (Ping timeout: 265 seconds) |
20:01:06 | * | Matthias247 joined #nim |
20:04:23 | * | dtscode left #nim ("Leaving") |
20:11:11 | dalarmmst | renesac: Sorry, I missed that is was part of typeinfo. Thanks! |
20:18:37 | * | gyeates joined #nim |
20:19:17 | * | Jehan_ quit (Quit: Leaving) |
20:22:55 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:46:54 | * | gokr_ quit (Ping timeout: 245 seconds) |
20:51:30 | * | buupisaway is now known as buup |
20:56:17 | * | d3m1gd quit (Ping timeout: 246 seconds) |
20:57:15 | * | Demon_Fox joined #nim |
21:06:16 | * | loz1 quit (Ping timeout: 256 seconds) |
21:06:41 | * | banister joined #nim |
21:08:14 | * | loz1 joined #nim |
21:45:43 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:47:14 | * | Matthias247 joined #nim |
21:49:36 | * | gyeates quit (Ping timeout: 272 seconds) |
21:53:25 | * | gyeates joined #nim |
21:58:27 | * | grncdr joined #nim |
22:08:27 | * | aboisvert_ joined #nim |
22:10:27 | * | aboisvert quit (Ping timeout: 256 seconds) |
22:10:27 | * | aboisvert_ is now known as aboisvert |
22:10:58 | * | grncdr1 joined #nim |
22:11:41 | * | grncdr quit (Ping timeout: 276 seconds) |
22:12:24 | * | saml quit (Quit: Leaving) |
22:20:13 | * | ingsoc1 quit (Quit: Leaving.) |
22:24:10 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:31:50 | * | Kingsquee joined #nim |
22:35:23 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:35:31 | * | csick quit (Ping timeout: 246 seconds) |
22:36:28 | * | buup is now known as buupisaway |
22:42:13 | * | filcuc quit (Ping timeout: 264 seconds) |
22:45:35 | * | Mat4 joined #nim |
22:48:29 | * | QWERTYPASSWORD quit (Quit: Page closed) |
22:54:21 | * | brson quit (Quit: leaving) |
22:58:15 | * | flaviu joined #nim |
22:59:02 | flaviu | someplace: https://github.com/ekarlso/nim-jwt/blob/master/src/private/hmac.nim |
22:59:15 | flaviu | It uses openssl. |
22:59:42 | filwit | isn't cdecl implied by importc? |
23:00:34 | * | jjjjjggggg joined #nim |
23:02:40 | * | banister joined #nim |
23:04:07 | * | gyeates quit (Ping timeout: 265 seconds) |
23:06:54 | flaviu | What was the story with github and changing the language name? |
23:06:55 | flaviu | https://github.com/trending?l=nimrod |
23:09:29 | flaviu | https://github.com/github/linguist/issues/2381 |
23:13:59 | * | Trustable quit (Remote host closed the connection) |
23:15:48 | * | grncdr1 quit (Quit: Leaving.) |
23:16:36 | * | dtscode joined #nim |
23:17:19 | * | aboisvert quit (Ping timeout: 245 seconds) |
23:17:33 | * | aboisvert joined #nim |
23:24:57 | * | yglukhov___ quit (Quit: Be back later ...) |
23:44:52 | * | Sembei quit (Read error: Connection reset by peer) |
23:46:50 | * | Sembei joined #nim |
23:48:38 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:49:30 | * | Mat4 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
23:49:50 | * | Matthias247 joined #nim |