<< 18-09-2014 >>

00:02:45*BitPuffin joined #nimrod
00:02:53*Varriount-Mobile quit (Read error: No route to host)
00:20:58*ehaliewicz quit (Remote host closed the connection)
00:24:31*Sht0 quit (Ping timeout: 272 seconds)
00:38:25*q66 quit (Quit: Leaving)
00:48:49*dapz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:53:40Onionhammerdom96 no my blog
00:56:28*fowl joined #nimrod
01:01:11*fowl quit (Ping timeout: 272 seconds)
01:14:58*bjz quit (Ping timeout: 258 seconds)
01:20:30*dapz joined #nimrod
01:29:05*cone is now known as clone1018
01:51:14NimBotVarriount/NimLime master cc0318e AllNamedRTaken [+0 ±3 -0]: NimLime didnt work on Win 8.1 machines... 2 more lines
01:51:14NimBotVarriount/NimLime master a54685f onionhammer [+0 ±3 -0]: Merge pull request #9 from AllNamesRTaken/master... 2 more lines
01:52:10*boydgreenfield joined #nimrod
01:59:43Triplefoxjonathan blow gonna talk about language design http://www.twitch.tv/naysayer88
02:00:20Triplefoxi'm probably gonna disagree with everything
02:27:16*adrusi quit (Quit: adrusi)
02:30:11*adrusi joined #nimrod
02:39:37*dapz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:52:57*adrusi quit (Quit: adrusi)
02:53:23*kshlm joined #nimrod
02:53:34*wkbrg joined #nimrod
02:56:27*wkoch quit (Ping timeout: 272 seconds)
02:57:09*adrusi joined #nimrod
03:05:11*flaviu1 joined #nimrod
03:14:56*wkochbrg joined #nimrod
03:18:09*wkbrg quit (Ping timeout: 246 seconds)
03:18:19*wkbrg joined #nimrod
03:22:17*wkochbrg quit (Ping timeout: 260 seconds)
03:34:54*brson quit (Quit: leaving)
03:52:47*wkochbrg joined #nimrod
03:55:12*wkbrg quit (Ping timeout: 258 seconds)
03:56:49*flaviu1 quit (Ping timeout: 260 seconds)
04:09:43*fowl joined #nimrod
04:25:55*NimBot joined #nimrod
04:26:22*wkochbrg quit (Ping timeout: 240 seconds)
04:31:16*fowlmouth joined #nimrod
04:31:52*fowl quit (Ping timeout: 245 seconds)
04:34:52*kshlm quit (Ping timeout: 245 seconds)
04:53:51*fowlmouth quit (Ping timeout: 272 seconds)
04:59:53*dapz joined #nimrod
05:02:06*kokozedman joined #nimrod
05:04:00kokozedmanhi, wondering, is there an event loop already established in Nimrod that uses poll(3) on Linux?
05:09:56*kshlm joined #nimrod
05:16:37*wkochbrg joined #nimrod
05:18:32*wkbrg quit (Ping timeout: 245 seconds)
06:03:49*Ven joined #nimrod
06:08:16*BlaXpirit joined #nimrod
06:16:00*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:16:19*boydgreenfield quit (Quit: boydgreenfield)
06:38:56Araqkokozedman: our async stuff uses epoll already
06:42:03kokozedmanAraq: thanks for the info... does that mean, there is no poll(3) but directly to epoll? I mean, epoll is a bit overkill for my usecase, I'm just handling about 10 connections
06:43:52kokozedmanare you talking about the asyncio? or the asyncdispatch?
06:48:39Araqthe async* modules all work together, but there are also legacy modules
06:49:10kokozedmanlegacy modules, which ones?
06:50:30Araqor maybe deprecated apis in these modules ... dom96 knows these things much better than I do
06:50:53Araqhowever asynchttpserver seems to be what you want?
06:51:22Araqit's not a problem if that's much more efficient than you need it to be, right? :-)
06:51:39kokozedmanI'm a bit unsure of thestate "still largely experimental" of these libraries
06:53:10Araqwell 0.9.6 is around the corner and the api is stable now
06:53:18kokozedmanasyncio module is indeed still using select() right? (according to the doc that is)
06:53:51kokozedmanoh, that's nice to hear :D ... devel branch is close to that 0.9.6?
06:54:27kokozedmanis there a targeted release date for 0.9.6?
06:54:36Araqend of this month
06:55:07Araqdevel branch is close, but "bigbreak" is much closer
06:55:35kokozedmanalright :) ... I think i'm really interested to check that
07:01:39Araqlooking at it, I think asnycio should be deprecated
07:01:45Araq*asyncio
07:01:58Araqasynchttpserver doesn't use it
07:03:01kokozedmanis there a kind of "cook book" or wiki that contains common ways to interact directly to C world? I mean, apart from digging a lot of the standard library?
07:03:33kokozedmanthere are lots of jargons and keywords that newcomers like me find really difficult to grasp in the standard lib
07:05:06kokozedmanI really like Nimrod with the speed of dev that it provides, it would be a tremendous boost to that same productivity to have that kind of wiki cookbook in most of Nimrod, in this case, C interoperability
07:05:58*Trustable joined #nimrod
07:13:18Araqkokozedman: "learn nimrod by example"?
07:13:43Araqhttp://nimrod-by-example.github.io/
07:13:49kokozedmanhmm... that would be a tutorial, but I'm talking about corner cases
07:14:07kokozedmanoh, I didn't know about that... thanks for showing to me
07:14:27*Sht0 joined #nimrod
07:16:28Araqbut yeah, this doesn't cover the FFI
07:17:23kokozedmanyes, FFI really is what I want to learn at this persent time
07:17:55kokozedmanthere is this project that I have been working on, and it's in C ... I don't want to convert it to Nimrod but I want to just use it straight away
07:18:45kokozedmanit's very confusing for the beginners to see how to work this out, especially that the stdlib is filled with advanced keywords that I constantly say, man, what does this mean now?
07:19:41kokozedmanyou know this feeling that you're completely unsure of what the right way to do that one thing, which keyword, is the context right for the keyword, etc...
07:21:22Araqmaybe c2nim's docs can help you?
07:21:34Araqthere are essentially 2 ways to do FFI
07:21:49Araqplus you can combine them however you please
07:22:06Araqwhich might be the source of your confusion
07:22:50Araqbut go ahead, just ask here please
07:24:10kokozedmanI guess that is one... but in the context of .importc. that is also introduces something unclear to me as to how variables are behaving in terms of GC for example
07:24:20kokozedmansame goes for dynlib
07:30:54Araqimportc essentially disables name mangling
07:31:10Araqthen you can either use .header or .dynlib with it
07:31:30Araq.header causes more problems IMO
07:32:14kokozedmanhmm... this is the first time I see .header
07:33:15Araqthere is also .nodecl for when you know it's in some #include file that really is already in the scope in the generated C code
07:33:49Araqbut that's mostly a legacy
07:34:29kokozedmanand there is a dynlib module, and there is a .dynlib. keyword... and the correct uses of all these keywords are really confusing to me 'cause I never get confident which to use in which kind of context
07:40:32Araqkokozedman: you usually don't need the dynlib module at all
07:41:06Araqand it's quite obvious that .dnylib is for interfacing DLL / Lib*.so, right?
07:41:46Araqif you build your C code as a DLL, you interface with it via .dynlib
07:41:51kokozedmanyes, so what's the corner usecase for the dynlib module?
07:41:55*io2 joined #nimrod
07:42:10Araqelse via .header and then you link your .o files to your Nim code
07:43:02kokozedmanAraq: like I said before, this is the first time I have heard of the .header, the manual doesn't contain that... so, where can I find more info about it?
07:43:16kokozedmanbecause I think my existing app is in .o file
07:43:57Araqkokozedman: Python requires DLL lookup of *variables*, which .dynlib didn't support so the dynlib module was created
07:44:56kokozedmanso, you're saying, that is no longer the case today? and the dynlib module is kind of deprecated?
07:48:55Araqwhen you truely want dynamic loading, the dynlib module is still useful
07:49:15Araqdynamic as in "load the DLL only when this proc is called"
07:50:23kokozedmanok, I see... can you point me to the .header documentation? or docs that explains more about it and other related?
07:51:08Araqhttp://nimrod-lang.org/nimrodc.html#header-pragma
07:51:21kokozedmanthanks
07:58:46AraqI gotta go, see you later
07:58:56kokozedmanthanks Araq
08:07:47*wkbrg joined #nimrod
08:08:19*BlaXpirit quit (Quit: Quit Konversation)
08:09:12*wkochbrg quit (Ping timeout: 260 seconds)
08:18:37*Skrylar quit (Ping timeout: 245 seconds)
08:38:02*bjz joined #nimrod
08:44:47*Trustable quit (Ping timeout: 272 seconds)
08:45:23*Trustable joined #nimrod
09:01:32*wkochbrg joined #nimrod
09:05:06*wkoch joined #nimrod
09:05:17*wkbrg quit (Ping timeout: 260 seconds)
09:05:17*edayo joined #nimrod
09:07:32*wkochbrg quit (Ping timeout: 260 seconds)
09:16:04*dapz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:34:16*wkbrg joined #nimrod
09:37:52*wkoch quit (Ping timeout: 260 seconds)
09:41:30dom96kokozedman: Araq: Yes, asyncio is deprecated. Asyncnet should be used for async sockets together with the asyncdispatch module which contains the event loop.
09:46:44*Jesin quit (Ping timeout: 260 seconds)
10:05:49*wkochbrg joined #nimrod
10:09:53*wkbrg quit (Ping timeout: 272 seconds)
10:10:11*wkbrg joined #nimrod
10:14:19*wkochbrg quit (Ping timeout: 272 seconds)
10:49:10*wkochbrg joined #nimrod
10:51:41*wkbrg quit (Ping timeout: 260 seconds)
11:04:10*wkbrg joined #nimrod
11:06:39*wkochbrg quit (Ping timeout: 272 seconds)
11:08:12*kuzy000 joined #nimrod
11:08:42*tdc joined #nimrod
11:15:29*tdc quit (Quit: Leaving)
11:25:43*edayo quit (Read error: Connection reset by peer)
11:26:12*edayo joined #nimrod
11:28:21*tdc joined #nimrod
11:29:55*BlaXpirit joined #nimrod
11:31:17*BlaXpirit quit (Client Quit)
11:32:33*BlaXpirit joined #nimrod
11:34:21*wkochbrg joined #nimrod
11:37:29*wkbrg quit (Ping timeout: 255 seconds)
11:51:42*BitPuffin quit (Ping timeout: 272 seconds)
11:52:03*wkbrg joined #nimrod
11:55:39*wkochbrg quit (Ping timeout: 272 seconds)
11:57:19*bjz quit (Ping timeout: 272 seconds)
12:13:28*BitPuffin joined #nimrod
12:17:46*wkochbrg joined #nimrod
12:21:28*wkbrg quit (Ping timeout: 272 seconds)
12:34:29*bjz joined #nimrod
12:42:45*BitPuffin quit (Ping timeout: 260 seconds)
12:45:37*wkochbrg quit (Quit: Saindo)
12:55:35*untitaker quit (Ping timeout: 272 seconds)
13:00:56kokozedmandom96: thanks for your confirmation; could there be a some docs on an example on this?
13:01:11kokozedmanI mean, the asyncdispatch, not the asyncnet
13:01:44kokozedmanI'm currently trying to create a Raw socket: newAsyncRawSocket(AF_PACKET, SOCK_RAW, htons(cast[int16](ETH_P_ALL))) .. failing miserably
13:01:54*untitaker joined #nimrod
13:02:20*francisl quit (Quit: francisl)
13:05:32*edayo quit (Ping timeout: 260 seconds)
13:06:13*BlaXpirit quit (Quit: Quit Konversation)
13:06:52*francisl joined #nimrod
13:07:52*BlaXpirit joined #nimrod
13:09:30*edayo joined #nimrod
13:11:40*AMorpork joined #nimrod
13:16:39*kshlm quit (Ping timeout: 246 seconds)
13:35:06*BitPuffin joined #nimrod
13:40:27*bjz quit (Ping timeout: 246 seconds)
13:42:15*Ven joined #nimrod
13:43:12*bjz joined #nimrod
13:44:27*Ven quit (Client Quit)
13:45:16kokozedmanhmm... I'm getting a crash on the compiler, probably something wrong with what I'm doing, but can anyone help point what's wrong? http://pastebin.com/RKKDjyj7
13:45:18*Ven joined #nimrod
13:46:53kokozedmanthe error is: Error: internal error: GetUniqueType
13:48:24*vendethiel joined #nimrod
13:49:33dom96kokozedman: You need to pass a var to cast() not a type
13:49:55dom96var x: ETH_P_ALL
13:50:01dom96cast[int16](x)
13:50:16kokozedmanoh, I see, thanks
13:50:27dom96or alternatively: cast[int16](ETH_P_ALL(123))
13:50:40dom96but that's a bit pointless anyway :P
13:51:31kokozedmanyeah, the ETH_P_ALL is a value from the C header file... how can I have it imported as value?
13:51:33demilichsdAre the C sources generated by the Nimrod compiler portable to Linux-based libcs besides glibc? Such as musl, uClibc and dietlibc.
13:52:09kokozedmandemilichsd: I'm targetting OpenWrt which uses uClibc ... so yes
13:52:57dom96kokozedman: Declare it as a variable
13:53:01demilichsdThat's good to know. I would assume the sources generated do not assume any particular semantics, but wanted to make sure.
13:53:06dom96or better yet a 'let'
13:53:32dom96const may also work
13:53:41dom96and if so then use it
13:54:03kokozedmandemilichsd: you need to add your toolchain (GCC compiler matching your libc) to the nimrod.cfg
13:54:17demilichsdthat would be obvious, yes
13:54:48kokozedmanso far, everything I did worked, so no particularities
13:54:59kokozedman(I guess)
13:56:48*darkf quit (Quit: Leaving)
13:57:56kokozedmandom96: so there is no way to get a "value" that is imported from C header files?
13:58:08kokozedmanyou have to always get it manually?
13:58:36dom96it should work I think
13:58:49*bjz quit (Read error: Connection reset by peer)
13:58:51dom96if the header file specifies it
13:59:07*bjz joined #nimrod
13:59:11kokozedmanyes, the header does speicify it
13:59:23kokozedmanbut then how do I get that into Nim?
13:59:57*francisl quit (Quit: francisl)
14:00:10kokozedmanas an example, I have this in the header: #define ETH_P_ALL0x0003
14:00:19kokozedmanas an example, I have this in the header: #define ETH_P_ALL 0x0003
14:01:36*rg4 joined #nimrod
14:03:20*AMorpork quit (Quit: WeeChat 1.0)
14:03:32*AMorpork joined #nimrod
14:04:19*AMorpork quit (Client Quit)
14:09:25kokozedman:) got it
14:24:07*edayo quit (Quit: Leaving)
14:25:53*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:37:53*Ven joined #nimrod
14:42:44*kshlm joined #nimrod
14:57:44*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:09:52*BlaXpirit quit (Quit: Quit Konversation)
15:11:24*BlaXpirit joined #nimrod
15:12:56*adrusi quit (Quit: adrusi)
15:22:07*francisl joined #nimrod
15:24:52demilichsdDoes Nimrod provide an interface to the syscall(2) function, like Ruby does?
15:25:05demilichsdOr, should I write plain C in such cases?
15:30:24BitPuffindemilichsd: even if it doesn't you wouldn't have to write plain C. You can just call the C function
15:31:23demilichsdah, BitPuffin
15:31:42demilichsdusing a generic pragma to point to the C header effectively creates a wrapper?
15:31:53dom96yeah, just wrap it. proc syscall(...) {.importc, header: "<sys/syscall.h>".}
15:32:07demilichsdthanks, this will be very useful
15:33:44kokozedmanI'm trying to use async with a raw socket that's not defined in the rawsocket/sockets (AF_PACKET for capturing traffic). I managed to get a TSocketHandle from posix.socket(), but then how do I work with the async modules?
15:35:55dom96kokozedman: I would suggest adding AF_PACKET to rawsockets and then using the asyncnet module.
15:36:36dom96But perhaps it's a posix-only thing?
15:36:58dom96Ahh, but that shouldn't be a problem.
15:37:03dom96I can add it for you if you want.
15:37:28kokozedmandom96: I already thought of that, but I thought, that's not a very clean way to do things. Yes, it's posix only. No alternative that's cleaner?
15:38:13dom96Why do you consider this unclean? Is it because you have to edit the stdlib modules?
15:38:20kokozedmanyes
15:39:12*vegai left #nimrod (#nimrod)
15:39:58dom96The other way isn't ideal.
15:40:23dom96It's a lot more work. The fact that rawsockets doesn't specify this constant is a bug.
15:42:24dom96kokozedman: Can you tell me the value of AF_PACKET?
15:43:47*adrusi joined #nimrod
15:44:06kokozedmandom96: it resolves to 17 after resolving from PF_PACKET
15:44:35kokozedmanand I also use the ETH_P_ALL == 0x0003 for the protocol
15:45:49*Demos joined #nimrod
15:47:42kokozedmandom96: something intriges me, what happens for different identifiers with the same value? for example there is ETH_P_ALL == 0x0002 and there is also IPPROTO_IGMP == 2 ... all these values are all ultimately == 2, yet, they are all protocols; in the C context, it is just converted to a short int, but what about Nimrod context? since these values are all protocol, how to you cram them all in and not create a
15:47:44kokozedmanvalue conflict?
15:48:25dom96hrm
15:48:43dom96Perhaps it would make sense to allow arbitrary ints to be passed in.
15:49:19kokozedmanand there are a whole bunch of other defines in netinet/in.h header + linux/if_ether.h
15:50:07kokozedmanindeed, that's what I thought too... because I found out the hard way that Nim types are hard to substitutes to other types
15:52:33kokozedmanand who's making the decision for this kind of change? I'm just curious; i'm guessing if it is changed, hell will break lose
15:53:09dom96I can simply introduce an overload and that we get the best of both worlds :)
15:53:14dom96*that way
15:54:22kokozedmanhmm... can't wait to see your changes about that, 'cause I'm curious how can I solve this problem right now... can't seem to be able to advance anywhere around this problem
16:00:25dom96kokozedman: are you on the bigbreak branch? if not then you will need to switch to it.
16:01:11*dapz joined #nimrod
16:01:41kokozedmandom96: on devel... doesn't have it?
16:02:13dom96there is a lot of async improvements in the bigbreak branch
16:02:31kokozedmancool... switching
16:03:01*Jehan_ joined #nimrod
16:03:28NimBotAraq/Nimrod bigbreak 867dfbf Dominik Picheta [+0 ±4 -0]: Adds socket creation for arbitrary domain, type and protocol.
16:03:31dom96There you go.
16:03:53dom96Haven't tested it but it should work heh
16:04:54*brson joined #nimrod
16:05:21Jehan_Very reassuring. :)
16:09:10kokozedmandom96: no need to recompile my whole Nim right?
16:09:27dom96kokozedman: there is
16:09:34dom96likely need to grab c sources again
16:10:24kokozedmanohhh... for c sources, there is no need of branch thingy right?
16:10:34kokozedmanjust pull
16:10:35Jehan_If you want to use the bigbreak branch, here's how it goes: https://gist.github.com/rbehrends/0e3f58a229ba31396253
16:10:50*Ven joined #nimrod
16:10:54Jehan_Basically, you need the matching branch in csources.
16:11:10kokozedmanok, I see, thanks
16:12:13Jehan_Okay, so the Boehm GC bug I ran into last night has disappeared and I don't know why ...
16:13:44Jehan_Ah, nevermind, needed --threads:on
16:25:20*Jesin joined #nimrod
16:36:42*francisl quit (Quit: francisl)
16:48:01*BitPuffin quit (Ping timeout: 272 seconds)
16:48:27*adrusi quit (Ping timeout: 255 seconds)
16:49:22*askatasuna joined #nimrod
16:49:40kokozedmandom96: running the asyncnet example, I get: lib/pure/asyncdispatch.nim(1067, 7) Error: 'cb' is not GC-safe
16:49:53*francisl joined #nimrod
16:49:55kokozedmanexample at http://nimrod-lang.org/asyncnet.html
16:51:37*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:53:41*Ven joined #nimrod
16:53:55*adrusi joined #nimrod
16:59:59*dapz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
17:04:16NimBotAraq/Nimrod bigbreak 83e26cc Dominik Picheta [+0 ±1 -0]: Fixes asyncnet example.
17:04:49dom96kokozedman: This should work: https://gist.github.com/dom96/8b82fca017092b89c1ce
17:09:55kokozedmanthanks... that worked; now, there seems to be some changes that I'm not aware of, so where do we get the documentation for the next up-coming 0.9.6? for example, I don't seem to know about asyncCheck
17:12:00dom96unfortunately doc gen is broken for bigbreak currently. But you should be able to generate docs yourself by executing nim doc2 lib/pure/asyncdispatch.nim
17:12:24*q66 joined #nimrod
17:13:18NimBotAraq/Nimrod devel 67525d7 PavelVozenilek [+0 ±1 -0]: more precise word
17:13:18NimBotAraq/Nimrod devel a179dde Dominik Picheta [+0 ±1 -0]: Merge pull request #1532 from PavelVozenilek/devel... 2 more lines
17:20:15*dapz joined #nimrod
17:23:22*betawaffle quit (Ping timeout: 240 seconds)
17:33:55*Matthias247 joined #nimrod
17:38:23*adrusi quit (Quit: adrusi)
17:40:08*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:42:59*BitPuffin joined #nimrod
17:47:51*Ven joined #nimrod
18:17:04Onionhammerdom96 doh on the epoll thing ;)
18:17:12Onionhammerdom96 i never actually got it to compile because of that error yesterday
18:21:53*shodan45 quit (Quit: Konversation terminated!)
18:25:40*BlaXpirit quit (Quit: Quit Konversation)
18:27:19*BlaXpirit joined #nimrod
18:32:32*JasonJAyalaP joined #nimrod
18:33:53JasonJAyalaPI've written the (most) of the (first) rough draft for a learnxinyminutes.com nimrod tutorial. I uploaded it as a gist so that I can get some initial impressions. I'll have it in a repo soon.
18:33:55JasonJAyalaPhttps://gist.github.com/JasonJAyalaP/62597df6dd1fde37d7fb
18:34:28*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:34:33JasonJAyalaPNote: Since they say that learnxiny is aim at experienced programmers, I went the stereotypical "variables -> types -> data structures -> functions" route
18:41:08*dapz joined #nimrod
18:41:21AraqJasonJAyalaP: 'const' explanation could be better
18:41:42Araqs/bound/computed/
18:42:11Araqalso the language is renamed to Nim
18:42:27Araqthe TPrefixes are deprecated for types
18:43:33Araqthe indentation for the 'case' - while valid - doesn't make much sense IMHO
18:44:05Araqreason: 'elif' is not indented either
18:49:02JasonJAyalaPah. I indented `case` in two different ways. `of` should be same column?
18:49:26Araqyeah but I guess it's better to show both ways are allowed
18:49:43Araqon the same column is the preferred style though
18:49:57*tdc quit (Ping timeout: 255 seconds)
18:51:32JasonJAyalaPI'll fix it. It's usually better to show "most common, memorize this way" for a quick tutorial. Later on they can run into all the variations and edge cases :)
18:51:32dom96JasonJAyalaP: Remove the spaces before the : in var declarations
18:51:57Araqoh yeah I hate these with a passion :P
18:52:19JasonJAyalaPWe need a nimfmt then!
18:52:34Araqthe colon is not important enough to emphasize it with hard to maintain alignments
18:52:38JasonJAyalaPOr at least a regex i can put into a vim %s to fix that...
18:53:02JasonJAyalaPAraq: You say that now, but wait until your 60
18:53:30JasonJAyalaPfixing the TTypes now..
18:53:45AraqJasonJAyalaP: with some luck I'll never become that old :-)
18:54:37JasonJAyalaPAraq: technological singularity, or ascension into heaven?
18:56:03AraqI don't really care as long as the pain of using computers ends
18:56:22*demilichsd quit (Ping timeout: 240 seconds)
18:56:28JasonJAyalaPAraq: type name = string creates conflict with var name ? Compiler tells me redefinition
18:56:49JasonJAyalaPAraq: Get thee to a monastary!
18:57:03AraqJasonJAyalaP: use Name for the type and --cs:partial
18:57:03JasonJAyalaP*type Name I should say
18:58:13JasonJAyalaPWill built-in types be renamed with Capitals?
18:58:48Araqno
18:59:04Araqsome are renamed, int etc. will stay lowercase
18:59:11Araqit's too annoying to be consistent
19:02:15JasonJAyalaPAraq: What about `const` would you clarify?
19:02:41Araqat the very least replace "bound" with "computed"
19:02:47*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:02:49JasonJAyalaPFixed
19:03:16JasonJAyalaPI updated the gist. Fixed those problems you mentioned (except the : ... still working on the regex)
19:05:38*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:09:04*tdc joined #nimrod
19:09:12Araqdom96: ugh should we even bother to update all this SDL stuff?
19:09:26Araqeverybody wants to use SDL 2.0 now, right?
19:10:22*tdc quit (Max SendQ exceeded)
19:11:00*tdc joined #nimrod
19:11:23*demilichsd joined #nimrod
19:12:16Araqoh well, nimfix already did most of the work for me
19:12:28AraqI might as well finish it
19:12:34*Joe_knock joined #nimrod
19:12:50*tdc_ joined #nimrod
19:13:04*Joe_knock quit (Max SendQ exceeded)
19:13:37*Joe_knock joined #nimrod
19:14:38*Joe_knock quit (Max SendQ exceeded)
19:15:10*Joe_knock joined #nimrod
19:15:17*Joe_knock quit (Changing host)
19:15:18*Joe_knock joined #nimrod
19:15:48*Jesin quit (Quit: Leaving)
19:15:58*tdc quit (Ping timeout: 244 seconds)
19:16:09*Joe_knock quit (Max SendQ exceeded)
19:16:42*Joe_knock joined #nimrod
19:17:37*Joe_knock quit (Max SendQ exceeded)
19:18:10*Joe_knock joined #nimrod
19:18:12*Ven joined #nimrod
19:18:21JasonJAyalaPAhh, there we go: %s/\s\+:/:/
19:19:03*Joe_knock quit (Max SendQ exceeded)
19:19:05Jehan_JasonJAyalaP: Immutable variables are not just a functional programming thing.
19:19:33JasonJAyalaPJehan_: Immutable variables are for all to enjoy!
19:19:36*Joe_knock joined #nimrod
19:19:51Jehan_I'd try not to make an argument, but simply explain that let creates immutable name assignments.
19:19:57Jehan_It's a bit of a tricky concept.
19:20:27*Jesin joined #nimrod
19:20:29*Joe_knock quit (Max SendQ exceeded)
19:20:31Jehan_You can have both of a let and a var name referencing the same object and can still modify the referenced object through the var version.
19:21:01*Joe_knock joined #nimrod
19:21:05AraqJehan_: actually I wouldn't count on this feature to stay in the language
19:21:14AraqJoe_knock: please fix your connection
19:21:29Joe_knockAraq: In progress.
19:21:33Jehan_But it's helpful in that you know that (1) using a let reference will not be involved in any mutation and (2) you can make the object immutable by not having aliasing.
19:21:39Jehan_Araq: Oh, interesting?
19:21:58*Joe_knock quit (Max SendQ exceeded)
19:22:15Jehan_Are you planning on performing a copy when you use let with a var alias?
19:22:54JasonJAyalaPLink updated with fixed formatting: https://gist.github.com/JasonJAyalaP/62597df6dd1fde37d7fb
19:23:09JasonJAyalaPAny major complaints about the structure or proposed TODOs ?
19:23:33Jehan_consts aren't just about performance; most importantly, they can be involved in compile time expressions.
19:23:50Jehan_For example, you can use a const for the size of an array, but not a let variable.
19:24:07Jehan_JasonJAyalaP: Just reading over it, giving you feedback as I go. :)
19:24:30dom96Araq: We're moving it to babel anyway.
19:24:53Araqdom96: yeah but I'm fixing it anyway
19:25:02Araqit needs fixing for Babel too
19:25:31Jehan_I think using discard for multi-line comments needs some more explanation.
19:25:34JasonJAyalaPJehan_: Np
19:25:40AraqJehan_: no additional copy, but some best effort to forbid aliasing to 'let' variables
19:25:42Jehan_It's really a way to comment out code that isn't working.
19:26:05Jehan_If you want a normal comment that runs over multiple lines, better to use a column of #'s.
19:26:34Jehan_discard """…""" tends to signal code that does not work or is only used for debugging or some such thing.
19:27:12Araqnot really
19:27:17Araqwe have 'when false' for that
19:27:32AraqI use discard """ """ for multi line comments, sometimes
19:27:43Jehan_Araq: Hmm, that's pretty ugly, I have to say.
19:28:08Jehan_But "when false" is probably a good thing to use for the examples of erroneous code.
19:28:08TriplefoxTriple quoted comments were okay in python
19:28:28JasonJAyalaPIt will look bad to have to go into details about indenting, compile time issues, etc while still on the "Here's a comment" section
19:28:41TriplefoxThey just seem out of place with the additional rule
19:28:48Jehan_JasonJAyalaP: I know.
19:28:52dom96We really need a better multi-line comment syntax IMO
19:28:57JasonJAyalaPdiscard """ brings up the compiler, unfortunately, but i dunno
19:28:58Jehan_Plus, you'd also have to explain discard.
19:29:15Jehan_I'd suggest moving discard """….""" towards the end.
19:29:23Jehan_As an advanced feature.
19:29:25dom96Many people will simply stop reading when they see such an ugly multi-line comment syntax.
19:29:27Araqwhy? it's perfectly clean. It was code you used but now you don't anymore. hence the 'when false', Jehan_
19:29:46Jehan_Araq: No, the when false is fine, I meant using discard ""…"" for multiline comments.
19:30:01JasonJAyalaPdiscard """ looks nice to comment out the code that won't compile... But I can simply replace all discard """ with a bunch of #s
19:30:21Jehan_JasonJAyalaP: You can use "when false" for code that won't compile.
19:30:22AraqJasonJAyalaP: but you should use 'when false' :P
19:30:25Jehan_Unless it won't even parse.
19:30:34Araqyeah
19:30:38Jehan_In which case, discard """…""" is still useful.
19:30:52Jehan_But as I said, that's an advanced feature that should come at the end.
19:31:01Araqyeah I agree
19:31:25dom96Since this is 'bigbreak' why don't we finally introduce a new multi-line comment syntax?
19:31:29Araqit's not even a feature. it's an interaction of language features that was discovered
19:31:46Jehan_dom96: Is there a need for multi-line comments?
19:32:04dom96Jehan_: Yes there is: for doc comments.
19:32:06JasonJAyalaPI only use discard """ to comment out errors (I think). I could just replace them with #s
19:32:10Jehan_I mean, even in C, multi-line comments usually get a column of asterisks in front.
19:32:29Jehan_dom96: Yeah, but why not just prefix multiple lines with #?
19:32:47dom96Jehan_: Too much hassle.
19:33:05Jehan_JasonJAyalaP: In the example, you can use "when false:" instead to comment out errors.
19:33:26Jehan_This will also keep syntax highlighting for the erroneous code intact.
19:33:36TriplefoxThe biggest use cases i see for multiline are the intro and then api docs
19:33:47Araqdom96: and update all the syntax highlighters out there?
19:33:49JasonJAyalaPJehan_: But then I have to explain `when` as a compile time `if`, and `when false` as a sort of trick for bad code...
19:33:59*dapz joined #nimrod
19:34:05dom96Araq: That's really a non-issue.
19:34:16Araqhow can you say that?
19:34:17dom96Pygments is already full of bugs.
19:34:20dom96And needs an update.
19:34:26Araqit took *years* to get it into github
19:34:33dom96It really didn't.
19:34:41Jehan_JasonJAyalaP: I think when as Nim's way of doing #if should be straightforward and the #if 0 <-> when false equivalence also.
19:34:47*Joe_knock joined #nimrod
19:34:56JasonJAyalaPWhile we're here, I'll just add that a Literate Nimrod would be great! ...I'll get my coat.
19:35:24*Demos_ joined #nimrod
19:35:26*Joe_knock quit (Max SendQ exceeded)
19:35:42dom96JasonJAyalaP: We have filters for that: http://build.nimrod-lang.org/docs/filters.html
19:35:45Araqreally? I consider Literale programming quite absurd...
19:35:53dom96JasonJAyalaP: (I think, I never used any literate * stuff)
19:35:57Araq*Literate
19:36:23TriplefoxI tried it once, it's okay
19:36:28JasonJAyalaPdom96: Oh. neat.
19:36:39TriplefoxBut not a natural way to write new code
19:36:46dom96The syntax in filters can use a lot of improvements too IMO.
19:37:15*Joe_knock joined #nimrod
19:37:18dom96But it supports custom prefixes, they were broken last time I used them but that's a whole different issue.
19:37:24Jehan_addSugar doesn't really need a void result type.
19:37:47dom96Araq: It's really not the end of the world if the multi-line comment syntax will be broken for a while on github.
19:37:48*Joe_knock quit (Max SendQ exceeded)
19:37:51*flaviu1 joined #nimrod
19:37:54Araqdom96: did you report that?
19:37:58Jehan_What's missing is an explanation of the implicit "result" variable.
19:38:06Araqflaviu1: your nim by example needs an FFI section
19:38:06dom96Araq: Can't remember, it was a really long time ago.
19:38:28JasonJAyalaPis lowerCamelCase the best way to name variables and procs?
19:38:30AraqI plan to use the new VM for crazier source code filters ...
19:38:31JasonJAyalaPJehan_: Agreed
19:38:35*Demos quit (Ping timeout: 258 seconds)
19:38:54AraqJasonJAyalaP: it is the standard according to our precious guidelines
19:39:13Jehan_The loop/continue example seems a bit complicated.
19:39:26dom9680 users. New record!
19:40:07dom96Araq: Please please please, can we have a new multi-line comment syntax?
19:40:20Jehan_dom96: What kind of syntax would you want?
19:40:59dom96I don't mind, as long as it's shorter than discard """ ... """
19:41:27Jehan_Here's the thing, look at the introductory multi-line comments in: https://github.com/apache/httpd/blob/trunk/server/config.c
19:41:31Jehan_Just as an example.
19:41:39flaviu1Araq: Ok, I'll work on that soon
19:41:48Jehan_They may be multi-line, but every single line is still prefixed with a '*'
19:41:54Araqflaviu1: yay. thanks!
19:42:13AraqJehan_: yeah and I consider it barbaric
19:42:22Araqit's like ASCII art
19:42:22Jehan_Araq: That's my point.
19:42:50dom96I wouldn't do that though.
19:42:52AraqHu?
19:42:55Jehan_If you do this, there's no difference to just using a single line comment style for each line.
19:43:23AraqJehan_: yeah but other people use multi line comments for having multi line comments :-)
19:43:33Jehan_dom96: Generally, you should be able to see if a line is a comment without syntax highlighting.
19:43:46Araqnah
19:43:51Jehan_Araq: Like =begin/=end in Ruby that nobody uses? :)
19:44:10Araqif you don't have syntax highlighting, you shouldn't even look at the code
19:44:22JasonJAyalaPbtw, are they called "Type Alias" or "Type Synonym"?
19:44:41Jehan_Sometimes not an option if you're ssh-ing into a server and view code with "less".
19:44:50Araqpffff
19:45:12Araqwelcome in the current century
19:45:33JasonJAyalaPAnd that plan9 editor which uses 3 mouse buttons is very anti-highlighting
19:46:10AraqJasonJAyalaP: "type alias"
19:46:55Jehan_Araq: Well, the current century is awash in cloud services.
19:47:50dom96Araq: I know that you like to avoid it but the current century still enjoys ssh from time to time :P
19:50:05*Sht0 quit (Ping timeout: 258 seconds)
19:50:28*Sht0 joined #nimrod
19:50:35dom96That said, even ssh supports syntax highlighting.
19:50:53Araqwell I don't mind multi line comments too much
19:51:05Araqbut I also do not see a real value
19:51:39Araqdom96: if you want them, open some forum thread so people can discuss minor syntactic details endlessly
19:52:55*Joe_knock joined #nimrod
19:53:43dom96Araq: That's not productive.
19:54:26Araqdom96: people appreciate to have some mild form of democracy though
19:54:33dom96You simply have to agree with me :P
19:56:31dom96As far as I can see the only problem that an introduction of a new syntax will bring will be that we break syntax highlighters.
19:57:08dom96But imagine the horror people feel when they see that they must write 'discard """' for multi line comments.
19:58:12dom96The fact that """ is highlighted as a string doesn't help.
19:58:35Joe_knockAraq: it was a "who" issue.
19:59:39dom96Joe_knock: interesting. Your client was sending that command too much?
20:01:25flaviu1how about
20:01:25flaviu1multiline-comment := '{' inner-multiline-comment '}'
20:01:25flaviu1inner-multiline-comment := '#' text* '#'
20:01:34Joe_knockdom96: auto-joining 11 channels and so I think it was sending it to like every user in every channel
20:02:01flaviu1Since I love to bikeshed so much
20:02:14Araqflaviu1: is that what Haskell uses?
20:02:27flaviu1I just made it up right now, no idea
20:02:40*JasonJAyalaP quit (Ping timeout: 246 seconds)
20:02:59Jehan_dom96: Whatever syntax you choose will probably break somebody using it for an operator. :)
20:03:05*Varriount|Mobile joined #nimrod
20:03:08Araqflaviu1: if it's not copied from Haskell, it cannot be correct
20:03:52Jehan_My suggestion would be simply to have a "comment procedure" that does nothing (i.e., the same thing that discard does).
20:04:01Jehan_This way you can write: comment """ …. """
20:04:39Araqthat's not shorter
20:04:51Jehan_No, but it doesn't confuse people about its meaning.
20:05:13Jehan_Which I think is what the issue with discard was.
20:05:33dom96Jehan_: not necessarily.
20:05:59dom96No, the primary issue is the length.
20:06:14dom96Araq: Haskell uses {- -} IIRC
20:06:25AraqJehan_: we can use #[] and break very little code and in particular no operators
20:06:26dom96We could use ### ... ###
20:06:48Jehan_Both could break existing comments.
20:06:56Araqdom96: that would be very consistent but is that a doc comment or not?
20:07:22dom96Araq: We could use #### for doc comments.
20:07:36Araqdom96: ugh
20:07:56Jehan_For inspiration: http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comment_comparison
20:08:01Araqbtw doc comments are part of the grammar, but ordinary comments are not anymore
20:08:42dom96Not as nice a comparison but more languages here: http://rosettacode.org/wiki/Comments
20:08:57Jehan_An alternative would also be to simply allow """…""" without discard.
20:09:25AraqJehan_: I don't think this works well with the expr/stmt unification
20:09:39dom96Yeah. That wouldn't be a good idea.
20:09:49Jehan_Oh, right, I forgot that. I was thinking primarily about doc comments.
20:10:14Araq#[] and ##[] is pretty clear
20:10:22Araqclearer than ### vs ####
20:11:06Araqand now I remember why I'm against them. it's just a tad too complex
20:11:27Araqand then you have to answer if #[] can be nested
20:11:40Jehan_#[]/##[] have problems when there are brackets in the comment, though.
20:12:05Jehan_End of comment can't really be a normal token.
20:12:33Araq#[ and ]# then. *shrug*
20:13:12Jehan_Sure, just wanted to mention it. :)
20:13:52Jehan_Anyhow, I've got stuff to do still. See you around. :)
20:13:53*Jehan_ quit (Quit: Leaving)
20:14:33dom96sure
20:14:42dom96It's not super sexy
20:14:47dom96but it's better than what we have now...
20:19:20NimBotAraq/Nimrod devel b114935 Reimer Behrends [+0 ±1 -0]: Various fixes to how the Boehm GC's interface.... 5 more lines
20:19:20NimBotAraq/Nimrod devel 2fde559 Andreas Rumpf [+0 ±1 -0]: Merge pull request #1533 from rbehrends/fix-boehmgc-interface... 2 more lines
20:23:26*endou____ quit (Ping timeout: 258 seconds)
20:25:23*endou_____ joined #nimrod
20:29:07*brson quit (Quit: Lost terminal)
20:29:16*brson joined #nimrod
20:29:49*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:30:27*vendethiel quit (Quit: q+)
20:45:57*tdc_ is now known as tdc
20:54:52*Varriount|Mobile quit (Read error: Connection reset by peer)
20:58:19*Mat3 joined #nimrod
20:58:23Mat3hello
20:59:04Araqservus
20:59:09Araqfyi my connection is very bad
20:59:19AraqMat3: what's the status of your C compiler?
21:00:00Discolodaa new c compiler?
21:00:37AraqDiscoloda: we try to embed that into Nim :-)
21:00:57Araqadvantage: even .emit works for compile time evaluation
21:01:06Araqwell we'll see
21:01:24*Jesin quit (Quit: Leaving)
21:01:46Mat3Araq: start porting the sources to Nim(rod)
21:01:48Discolodaah, i see
21:02:08*adrusi joined #nimrod
21:02:08Discolodayou have a tinyc directory, whats that for
21:02:23AraqtinyC used to work with the compiler
21:02:46Araqbut since it's not maintained anymore we don't support it anymore
21:03:18Discolodamight as well delete it, it is in git history
21:03:44dom96Mat3: on github yet?
21:04:38AraqDiscoloda: yes for this case. but in general pretending people should constantly look into git history to see failed attempts is misguided
21:04:58Mat3may I remark that TinyC is a compiler with a really long history ?
21:05:16AraqMat3: I know about its history
21:05:57Mat3dom96: nope, I'm currently create a new Github repro for it
21:08:32*kuzy000 quit (Ping timeout: 260 seconds)
21:11:27Mat3dom96: ok, I try to upload my sources
21:11:35Discolodai guess it depends on whats more important, presenting what is used and maintained or showing failed attempts
21:14:19Mat3if I remember correcly I need a new SSH hash for the new created repro ?
21:14:36*mko joined #nimrod
21:14:48*tdc quit (Ping timeout: 244 seconds)
21:15:04dom96Mat3: Just for your github account.
21:17:43Mat3thanks
21:17:59dom96thanks for putting it on github :)
21:18:39wanYou could delete tinyC from the git history right after tagging the last time it is present. So it would be reachable, and cleaned up.
21:23:52*BlaXpirit quit (Quit: Quit Konversation)
21:24:02Araqwan: sounds to me like it's not for me
21:24:33dom96it's not that big is it?
21:24:38dom96We should simply remove it in a commit.
21:25:14*Mat3 wonders about git
21:27:16kokozedmanin the last few days, I have been using 0.9.4 for my OpenWrtproject ... today I switched to bigbreak, and sure enough... it is no longer working; there is a dependency to several header files that are non-existant in uClibc/OpenWrt world, such as aio.h, fenv.h and probably others. Could there be some ways to disable dependencies to those? are they critically important?
21:27:37*nande joined #nimrod
21:28:13*Roin quit (Ping timeout: 245 seconds)
21:28:36Araqkokozedman: try to compile with --deadCodeElim:on please
21:29:24*Roin joined #nimrod
21:29:35kokozedmanAraq: I've already tried that, no luck
21:30:33dom96It seems that osproc changes introduced aio.h
21:30:59dom96There is a hasAioH const in posix.nim
21:31:19dom96which is set to 'defined(linux)'
21:31:38dom96Is there a way to detect the libc?
21:31:58kokozedmandom96: I've already tried to disable that, and there are more headers being requested and do not exist: fmtmsg.h (not sure which part requires it, but I stopped checking because it seems that I'm really fighting against it
21:33:37dom96Unfortunately I think it's a case of fixing it one by one.
21:34:27Araqit's also a case of accepting the fact that the people who come here and pretend to know better than we do really don't
21:36:11kokozedmanfair enough, I'm a noob in terms of Nim mastery... but improvements over libraries and languages are always intriguing
21:36:15dom96I think it's a good idea not to make our contributors feel bad.
21:36:42Araqkokozedman: oh no, I'm not talking about you
21:36:57AraqI'm talking about our general happiness to apply PRs
21:37:16kokozedmanAraq: I really thought you did
21:37:20EXetoCa new C compiler? interesting
21:39:05EXetoCMat3: what's your motivation?
21:39:12Mat3I'm start switching (and porting over my sources) only if the new version seem to be stable
21:39:18dom96The problem is that sometimes we have to trust others.
21:39:20kokozedmandom96: I'm really not sure how much changes will be required to make it work on OpenWrt again... I'll try for a while and I'll see where it leads
21:39:28dom96We are not experts on everything.
21:39:38dom96But this also highlights our need for a better testing infrastructure.
21:40:10Araqnot really. OpenWrt is not officially supported, heck I don't even know what that is
21:40:22Mat3EXetoC: Integrate my vm environment with Nim(rod)
21:40:24kokozedmanyeah, I agree on the testing
21:40:38dom96True. We don't officially support other libc's.
21:41:05Araqno, we need people like kokozedman that tell us that's *used*
21:41:21Araqotherwise it's simply some target that the builder tells us now fails
21:41:31Araqand nobody can be bothered to fix it for months
21:41:37dom96Yes. And he told us :)
21:41:40dom96Anyway.
21:42:04dom96Is there a way to check whether something is defined in a .h file?
21:42:09Mat3It would be nice to see some kind of documentation which summarizes the changes to the current stable version
21:42:11Araqyeah and we're willing to support it now :-)
21:42:31*adrusi quit (Quit: adrusi)
21:42:50AraqMat3: we're working on it, but it's really
21:42:55Araqa) the name changed to Nim
21:42:59dom96Because then we can add a const usesGLibC = defined(__GLIBC__). 'Defined' won't work here though.
21:43:02Araqb) --cs:partial is now the default
21:43:42dom96or better yet figure out a way to detect the libc kokozedman is using
21:43:50dom96I guess it defines some symbol too.
21:44:37Araqdom96: you have to use staticExec for some tiny generated C program to test for this
21:44:44dom96This is a good start but we need to add to it: https://github.com/Araq/Nimrod/blob/bigbreak/web/news.txt#L9
21:44:59dom96Araq: bah really?
21:45:04kokozedmanAraq: I understand. I'll tinker around and see what can be done. But still, I believe it's a really good thing if Nim could rise-up to be everyone's favorite language for developing OpenWrt apps. At this point, either you have to code in Lua (darn slow in such a slow CPU environment), or you have to use C/C++ (both of these I'd like to be away from if I can). So far, Nim has proven to be amazingly productive
21:45:05kokozedmanand the performance is also great
21:45:14dom96Araq: What about emitting some C code to do it?
21:45:49Araqdom96: you can't .emit at compile time
21:45:49*Sht0 quit ()
21:46:29dom96ok, this is something we should add then.
21:46:34*Sht0 joined #nimrod
21:46:50Araqkokozedman: we'll do anything to make it work again
21:46:51dom96But perhaps it's not so easy.
21:47:00Mat3Araq: because I'm currently compiling with --cs:partial this would mean that my sources compile without changes ?
21:47:22AraqMat3: yes
21:47:26Mat3nice :)
21:47:48Araqplus we also have a 'nimfix' tool that is almost there
21:47:50*will joined #nimrod
21:48:24Araqthat ports code from Nimrod to Nim automatically
21:49:15kokozedmanAraq: it's really nice to hear that. Thank you guys
21:50:21dom96Something like this but if Nim actually put the echo inside the ifdef https://gist.github.com/dom96/b8e310791b05c053a096
21:50:26AraqMat3: the async libs also have been overdone completely, but I think you don't use them :-)
21:50:45dom96Mat3: Some wrappers and modules have also been moved to babel.
21:50:57dom96Some wrappers still need to be moved.
21:51:03Araqdom96, kokozedman I think the non-hacky solution is to introduce linux_embedded as a new OS
21:51:19Araqmaybe under a better name
21:52:05dom96Araq: Maybe. But generalising this may be a bad idea.
21:52:44Araqdom96: tried your gist?
21:52:52dom96Araq: yes
21:53:06Araqit should work when in a proc
21:53:06willcouldnt you have something similar to ./configure step that detects c library?
21:53:25*Matthias247_ joined #nimrod
21:53:54dom96Araq: ahh, just a case of making it work for proc/type defs :P
21:54:25Araqwill: we have that too, but it's posix shell based and only works with the OS/CPU target system
21:54:36kokozedmanAraq: I agree, but linux_embedded sounds like something a bit different... anyway, it's more about OpenWrt (open source router platforms based on linux & uClibc in general)
21:54:56*JasonJAyalaP joined #nimrod
21:55:01dom96Perhaps a better temporary solution would be to introduce a new constant called libcName into system.nim
21:55:23Araqsounds to me like --os:OpenWrt
21:55:28JasonJAyalaPblarg. Internet went down. You'd think overpriced 1Mbit down DSL would be more stable
21:55:40JasonJAyalaPAraq: Did you get my "when false: do" message?
21:55:56dom96Araq: Operating systems can use different libc's
21:56:12*Matthias247 quit (Ping timeout: 258 seconds)
21:56:12AraqJasonJAyalaP: nope
21:56:14dom96I mean: the same OS can use different ones.
21:56:26JasonJAyalaPUhm. I think this is wrong... `when false: blahblahblah` works but `when false: blahblahblah do` fails to compile. The "do" is getting parsed.
21:57:25dom96'do' is a keyword
21:57:26dom96http://build.nimrod-lang.org/docs/manual.html#do-notation
21:57:49dom96(Which i'm not the biggest fan of)
21:58:12Araqdom96: yeah but than we have OS+Libc+CPU+CC combinations
21:59:33dom96Yes, but that does sound right.
22:00:21JasonJAyalaPdom96: So then "when false" isn't good for broken code...
22:00:22Mat3well, that's common for C based, embedded development
22:00:40Araqok fine
22:00:51Araqwhat's the name of the constant? system.libc?
22:01:22dom96sure
22:01:39kokozedmanwhat about a more flexible approach? --libc:uClibc or --libc:eglibc or --libc:musl ... OpenWrt is really linux, so I think that doesn't change. One thing is for sure, there is a default OpenWrt configuration that's very very common in most routers: uClibc is always the default libc. If it's different, that's been compiled to be a custom system, and that means the user knows what he's doing.
22:02:30Araqkokozedman: that doesn't gain you much over -d:uClibc
22:02:42dom96JasonJAyalaP: Yep. That's why you should vote yes for new multi-line comment syntax :)
22:02:43Araqand then 'when defined(uClibc)'
22:02:43JasonJAyalaPdom96: If you use `when false:` you can have meaningless symbols (when false: blarg my blarg := 1000) but you keywords better be properly indented!
22:03:05AraqJasonJAyalaP: commented out *code* is still *code*
22:03:12Araqotherwise use a comment
22:04:17kokozedmanAraq: -d:uClibc is fine by me
22:05:03Araqvery well then, that doesn't require yet another magic builtin
22:06:33*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
22:07:44kokozedmanI'm trying to do: when not defined(uClibc) or not defined(haiku) and not defined(OpenBSD)
22:07:52kokozedmancode is still evaluated, what's wrong?
22:12:34Mat3ciao
22:12:52*Mat3 quit (Quit: Verlassend)
22:13:31*Trustable quit (Remote host closed the connection)
22:13:46Araqkokozedman: 'and' instead of 'or'
22:15:38kokozedmanoh sorry about that
22:15:52*wkoch joined #nimrod
22:16:04kokozedmanmy head ain't right no more, it's really late here... anyway
22:16:09kokozedmanthere's this: Tfenv* {.importc: "fenv_t", header: "<fenv.h>", final, pure.}
22:16:20kokozedmanI don't seem to be able to get around that
22:16:55kokozedman(around line #105) seems to be hard-coded required
22:17:03dom96can't you put it inside a when not defined(uClibc)?
22:17:41Araqhe needs to break up the 'type' sections for that to work
22:17:49kokozedmanheheh... let's try that, let's hope it will not break major stuffs
22:24:27*wkoch quit (Quit: Saindo)
22:24:47dom96Let's implement this for Nim: http://talks.golang.org/2014/playground.slide
22:26:07*askatasuna quit (Ping timeout: 245 seconds)
22:26:33kokozedmanah, finally got it to compile... obviously, asynchronous sockets doesn't work; traditional socket ops works
22:28:51dom96why not?
22:32:54*lewislevinmbr joined #nimrod
22:34:43*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:34:57kokozedmandom96: correction: IT WORKS, async works on uClibc/OpenWrt... I accidentally disabled the echo that tells me it does... ffphheww
22:35:35Araqhi lewislevinmbr welcome
22:36:01lewislevinmbris this the primary channel for nim (formerly known as nimrod)
22:36:13Araqyes
22:36:33kokozedmanwelcome lewislevinmbr
22:36:36lewislevinmbrwhat’s the best url for scanning through old transcripts
22:36:55*dapz joined #nimrod
22:38:22lewislevinmbrjust getting started. finding all the sources.
22:38:35lewislevinmbranyone interested in a nim wrapper to eigen?
22:38:48dom96kokozedman: hehe awesome
22:38:58Araqnot sure what you mean "scanning through old transcripts"
22:39:17dom96lewislevinmbr: You mean IRC logs? http://build.nimrod-lang.org/irclogs/
22:39:31Araqlewislevinmbr: sure thing, eigen is sweet
22:39:32lewislevinmbraraq: seems not everything interesting is in the forum posts. never mind, dom96 answered
22:41:17lewislevinmbraraq: probably beyond my ability but eigen seems like one of the 2 best linear algebra libraries. with a decent nim api to it we’d have much of, not all of, what numpy provides
22:41:32kokozedmanis it possible to have a buffer reuse like in the regular recv(..., pointer, ...) in the asyncdispatch?
22:43:08lewislevinmbroff for now. i’ll see what I can learn about eigen and how it could be wrapped to be called from nim code.
22:43:20Araqlewislevinmbr: feel free
22:43:25Araqto post your questions here
22:43:31lewislevinmbralso, I’m glad about the name change
22:43:46Araq75% support the name change :-)
22:43:47kokozedmanI can see a readInto() in asyncnet, but it is not exported
22:44:06*lewislevinmbr left #nimrod (#nimrod)
22:44:06kokozedmanAraq: +1 for name change
22:47:15*adrusi joined #nimrod
22:48:25kokozedmanAraq: dom96: is it possible to have a buffer reuse like in the regular recv(..., pointer, ...) in the asyncdispatch?
22:49:32dom96kokozedman: No.
22:49:54Araqdom96: but perhaps it should be?
22:50:06kokozedmanit really should
22:51:27dom96It would be a bit strange.
22:51:49kokozedmanwhy?
22:52:04dom96Because the future wouldn't hold the value.
22:53:14dom96You can easily implement it yourself on Linux though.
22:53:54kokozedmanI'm not claiming to know how things work, but as a vague idea, user should be able to give a pointer+size to the function that returns the future... and all the user do when the future returns is simply check for error and read his buffer
22:54:18*francisl quit (Ping timeout: 255 seconds)
22:54:43kokozedmancan you give me some pointers for me to get started?
22:55:41dom96Sure, just take a look at the current recv implementation: https://github.com/Araq/Nimrod/blob/bigbreak/lib/pure/asyncdispatch.nim#L948
22:56:27dom96addRead adds a callback to the dispatcher which will be called when the fd is ready to be read.
22:57:10dom96all you need to do is replace readBuffer with your pointer
22:57:22dom96and return a Future[void]
23:00:37Araqkokozedman: how does that help though? you need to allocate a buffer for every Future that can be pending
23:00:38Araqyou'd need to alloc/dealloc these
23:00:56Araqand at this point you can just as well use what async already provides
23:01:20Araqyou cannot reuse the buffer easily when your asyncronous
23:01:40dom96he might be able to in an async proc
23:01:44dom96no?
23:01:57kokozedmanAraq: I'm not using the async's buffer because I can't wait for the buffer to be filled before doing anything; it's a raw socket, message based
23:02:09kokozedmanI need the message to be processed as soon as it is received
23:02:17Araqdom96: dunno, it's too late, ask me again tomorrow
23:03:37dom96kokozedman: recv will give you data as soon as it's received
23:03:47dom96it will not wait until it gets all the data you requested
23:04:11kokozedmanand it's very easy to have like thousdans of messages in 1 sec, having to alloc/dealloc at that rate is going to be slow as hell
23:04:27kokozedmandom96: well, not according to what I have experienced
23:04:46kokozedmanI set the read size to 4096, I don't get anything until 4096 is full
23:07:20dom96kokozedman: Posix recv is doing that then.
23:08:11kokozedmanyes, that's right... the async one waits
23:09:28Araqkokozedman: the compiler allocates ~6 million objects in 2 seconds, but ok, this is on decent hardware. and you're right it can be a bottleneck for async code
23:11:08kokozedmanAraq: especially in such a tiny device, it is a major bottleneck... 60% CPU usage for just around 10 mbps speed... looking at around 80 mbps tops
23:12:39kokozedmanit's really late here, I think I'm also going to have to do. see you guys tomorrow, and thanks for the insights
23:12:49*kokozedman left #nimrod ("WeeChat 0.3.7")
23:13:59JasonJAyalaPOk. I forked, pulled, branched, initially committed, and pushed.... https://github.com/JasonJAyalaP/learnxinyminutes-docs/blob/nim/nim.html.markdown
23:14:38JasonJAyalaPI'm in need of some small examples of common operations on the data structures, as well as for/iteration
23:14:49JasonJAyalaP(look for TODO)
23:15:47JasonJAyalaPIf you just have comments, or want me to copy/paste examples (to save you time), open an issue
23:15:54AraqJasonJAyalaP: steal the examples from somewhere? ;-)
23:16:07Araqrosetta code, tutorials etc.
23:18:15JasonJAyalaPAraq: I tried. nimrod-by-example doesn't have (m)any (!) and the standard library documentation isn't full of them either. I started to flip through source code of 3rd party libs. I'll keep looking.
23:18:55JasonJAyalaPAraq: Ah. I'll look at rosetta
23:19:54Araqwell Table, CountTable, seq are common
23:20:11Araqarray, set, string
23:20:28Araqthat's about it really, I think
23:20:42Araqwe have crit bit trees, lists etc etc
23:21:00Araqbut there is usually not much love for them
23:21:36JasonJAyalaPAraq: Any reason why table isn't in the core/system/whatever?
23:22:10JasonJAyalaPAraq: Yeah i noticed queues and other abstract data types. It will be fun playing with them.
23:22:18Araqit requires == and 'hash' to work
23:22:45Araqa builtin Table makes no sense for Nim
23:23:21Araqunless you mean we should simply put it into system.nim
23:23:32*darkf joined #nimrod
23:23:36Araqbut system.nim is already bloated
23:23:54Araqyou can do include prelude to get the standard stuff
23:24:12Araqbut that's a well kept secret
23:24:19*Matthias247_ quit (Read error: Connection reset by peer)
23:24:20AraqI wonder if anybody uses it
23:24:21dom96JasonJAyalaP: You should add an async await example :D
23:24:38JasonJAyalaPAraq: I see. Having to import it makes it look like it's a second class citizen. But I guess that's naive.. Oh. I didn't even know there was a prelude
23:25:08JasonJAyalaPdom96: I was thinking of adding some FFI since that's one of the selling points of nim (at least for me)
23:25:17dom96sure
23:26:37Araqdom96: where is there both BIO_write and bioWrite?
23:27:13dom96openssl wrapper?
23:27:19Araqyes
23:30:50Araqmeh never mind
23:32:57VarriountJasonJAyalaP: ping
23:33:43dom96Araq: What's the problem?
23:34:07Araqdom96: that breaks nimfix, but I added a when not defined(nimfix)
23:34:57VarriountAraq: How would one go about creating a tool to auto-format nimrod code, keeping comments?
23:35:32JasonJAyalaPVarriount: pong
23:35:58VarriountJasonJAyalaP: https://github.com/Araq/Nimrod/wiki/NEP-1-:-Style-Guide-for-Nimrod-Code
23:36:42AraqVarriount: you have 2 options: do it like nimfix which is full semcheck->AST ->LineInfo -> go back to file buffer and fix it
23:36:58Araqor you base it on the lexer only
23:37:05JasonJAyalaPVarriount: neat. thanks.
23:37:10Araqwith perhaps some heuristics
23:39:38JasonJAyalaPAraq: Varriount: Should enum values have a prefix?
23:40:10Araqor maybe take the parser, give it some heuristical symbol table and use that
23:40:11VarriountJasonJAyalaP: Yes.
23:40:43AraqJasonJAyalaP: you can also use a .pure enum. that requires full qualification
23:40:56Araqthese should not have prefixes then
23:45:28JasonJAyalaPdo tupples have "fields", "labels" or "members"?
23:45:31JasonJAyalaPtuples
23:46:19Araq"fields"
23:47:25*Joe_knock quit (Quit: Leaving)
23:48:06AraqVarriount: can you please run nimfix over various babel packages?
23:52:19dom96he must finish kickstart!
23:55:24NimBotAraq/Nimrod bigbreak 45accd6 Araq [+0 ±1 -0]: 'nim i' should work again
23:55:24NimBotAraq/Nimrod bigbreak 03744be Araq [+0 ±2 -0]: updated xml modules
23:55:24NimBotAraq/Nimrod bigbreak e7140f2 Araq [+0 ±8 -0]: updated SDL wrapper
23:55:24NimBotAraq/Nimrod bigbreak 4367fb2 Araq [+0 ±2 -0]: updated graphics.nim
23:55:24NimBot7 more commits.
23:57:37*Fran__ joined #nimrod
23:57:45*flaviu1 quit (Ping timeout: 255 seconds)