00:01:14 | * | fastrom quit (Ping timeout: 265 seconds) |
00:15:49 | * | krux02 quit (Remote host closed the connection) |
00:17:23 | * | krux02 joined #nim |
00:19:22 | * | krux02 quit (Client Quit) |
00:30:05 | * | PMunch quit (Quit: leaving) |
00:31:22 | * | chemist69 quit (Ping timeout: 255 seconds) |
00:33:49 | * | fredrik92 quit (Quit: Leaving.) |
00:34:24 | * | chemist69 joined #nim |
00:36:01 | * | ftsf_ joined #nim |
00:45:25 | ftsf_ | hmm writing to SDL's audio buffer causes random crashes (seems like it's overwriting random bits of code) when --threads:on is not specified, adding it fixes it. |
00:47:17 | ftsf_ | any idea why that would happen? |
00:54:26 | mcc | In order to run with SDL audio, I have to run with --threads:on --tlsEmulation:off and I also have to run setupForeignThreadGc() on the SDL audio thread once. |
00:54:36 | ftsf_ | hmm interesting |
00:54:52 | mcc | I don't remember why this is, I came in here with-- I think actually it was a crash, when I first started using SDL, and that was what they told me to do in here |
00:55:16 | mcc | I assume that unless you turn on the threads stuff, Nim will not know to do the per-thread GCs properly |
00:55:27 | ftsf_ | *nods* kinda makes sense |
00:55:29 | mcc | and possibly something is happening like your main thread triggering a GC and it doing stuff to the audio thread's memory |
01:00:09 | ftsf_ | yeah that would explain it |
01:09:34 | * | brson quit (Ping timeout: 252 seconds) |
01:12:51 | * | chemist69 quit (Ping timeout: 265 seconds) |
01:25:53 | * | chemist69 joined #nim |
01:27:50 | * | bjz joined #nim |
01:38:15 | * | bungoman quit (Read error: Connection reset by peer) |
01:38:47 | * | bungoman joined #nim |
01:57:20 | * | kulelu88 quit (Quit: Leaving) |
02:12:37 | * | onionhammer quit (Quit: WeeChat 1.0.1) |
02:13:07 | * | girvo joined #nim |
02:15:56 | * | girvo waves |
02:15:58 | girvo | Hey everyone |
02:16:11 | ftsf_ | hey girvo |
02:20:35 | girvo | hows it going ftsf_ |
02:20:51 | ftsf_ | hmm very sleepy ~__~ accidentally was up till 4am writing a synth in nim |
02:27:43 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:28:44 | * | okami quit (Ping timeout: 265 seconds) |
02:35:12 | * | cryptotoad joined #nim |
02:35:24 | cryptotoad | o/ |
02:35:51 | cryptotoad | I was curious if there were any plans to add Union types to Nim? |
02:36:01 | ftsf_ | cryptotoad, there's already unions {.union.} |
02:36:06 | cryptotoad | Oh. |
02:36:14 | ftsf_ | not the prettiest though |
02:37:12 | cryptotoad | Well I didn't find that but now I know, thanks :) |
02:37:21 | cryptotoad | google still hates nim :( |
02:37:45 | ftsf_ | =( yeah |
02:38:46 | * | brson joined #nim |
02:41:49 | * | okami joined #nim |
02:58:11 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:13:53 | * | dddddd quit (Ping timeout: 250 seconds) |
03:14:17 | * | chemist69 quit (Ping timeout: 264 seconds) |
03:18:29 | * | chemist69 joined #nim |
03:57:52 | * | Sentreen quit (Ping timeout: 240 seconds) |
04:09:24 | * | Sentreen joined #nim |
04:14:16 | * | brechtm quit (Read error: Connection reset by peer) |
04:14:22 | * | brechtm_ joined #nim |
04:15:21 | * | kjrose joined #nim |
04:21:16 | * | bjz joined #nim |
04:22:21 | federico3 | ftsf_: best type of accidents. Was it an audio synth? |
04:40:43 | ftsf_ | federico3, yeah =) |
04:40:58 | ftsf_ | a couple of simple oscillators, filter, envelope, delay and distortion |
04:40:58 | federico3 | can we have samples? :D |
04:41:24 | ftsf_ | http://static.impbox.net/synth.mp4 a recording from last night |
04:43:33 | federico3 | oh, and with a UI as well! |
04:44:32 | ftsf_ | yeah =) |
04:44:37 | ftsf_ | easier to test that way |
04:45:57 | federico3 | very nice, two more VCOs, reverb, midi input and it would be usable for real music |
04:46:03 | ftsf_ | reusing the graphics code from a game i'm making |
04:46:21 | ftsf_ | yeah, i'm looking into adding JACK support for midi and better audio out |
04:46:39 | ftsf_ | but c2nim doesn't wrap it cleanly, so needs a bit of manual work |
04:47:45 | federico3 | it would be nice to be able to use it without a mouse; I found point and click ui to perform poorly on synths |
04:48:13 | ftsf_ | mmm, i'd like to make a tracker style sequencer for it |
04:48:35 | ftsf_ | controlling synth parameters in realtime without a mouse is a bit of pain though (unless you can map midi to it) |
04:48:42 | federico3 | that's a lot of work |
04:48:49 | ftsf_ | yep |
04:49:18 | ftsf_ | but got all that done last night, so it's going pretty quick |
04:49:24 | ftsf_ | working in nim is a breeze |
04:49:42 | federico3 | to record the parameters in real time maybe a trackpad would be ideal |
04:49:52 | federico3 | very nice work ftsf_ |
04:50:56 | ftsf_ | ideally i'd like a subtractive synth, FM synth and sampler and a sequencer for them to have a cute little music making studio |
04:51:32 | federico3 | (yet I usually find drawing bezier or linear curves to be better than recording midi controllers) |
04:51:45 | ftsf_ | oh currently it's only monophonic, so need to add support for multiple voices |
04:52:11 | ftsf_ | yeah that should be doable, i already have bezier code in my utility kit |
04:52:28 | federico3 | or just linear interpolation |
04:55:22 | ftsf_ | i hate having to reboot into windows to make music, so figured i should just make something to suit my needs on linux |
04:55:44 | ftsf_ | most of the linux audio software just doesn't seem to do what I want it to do |
05:02:49 | federico3 | most of it does very little |
05:13:08 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:20:11 | * | Bilbo joined #nim |
05:24:22 | * | Demon_Fox quit (Remote host closed the connection) |
05:26:02 | * | gokr1 quit (Ping timeout: 265 seconds) |
05:31:38 | * | Bilbo quit (Ping timeout: 264 seconds) |
05:31:50 | * | brson quit (Ping timeout: 250 seconds) |
06:13:44 | * | mcc quit (Quit: Connection closed for inactivity) |
06:23:24 | * | yglukhov joined #nim |
06:28:18 | ftsf_ | oh cool, https://github.com/Senketsu/nshout/ could use this to stream my synth's output directly to the internets :3 |
07:03:32 | * | Trustable joined #nim |
07:05:21 | * | gokr joined #nim |
07:12:45 | * | miere joined #nim |
07:12:58 | * | nairobi joined #nim |
07:13:48 | * | Arrrr joined #nim |
07:13:48 | * | Arrrr quit (Changing host) |
07:13:48 | * | Arrrr joined #nim |
07:13:59 | * | gokr quit (Quit: Leaving.) |
07:14:04 | * | gokr1 joined #nim |
07:20:13 | * | brechtm_ quit (Remote host closed the connection) |
07:20:25 | * | girvo quit (Ping timeout: 255 seconds) |
07:20:29 | * | brechtm joined #nim |
07:20:35 | ftsf_ | ahh can't compile for OSX because lack of threadlocal storage D: |
07:20:41 | ftsf_ | anyone managed to find a way around that? |
07:21:39 | ftsf_ | (can compile with --threads:off but that causes my app to crash due to the SDL audio issue) |
07:23:04 | * | Andris_zbx joined #nim |
07:29:46 | Arrrr | I thought the option was off by default |
07:30:02 | * | Polynomials joined #nim |
07:30:14 | Polynomials | How many architectures are supported by Nim compiler? |
07:30:20 | ftsf_ | Arrrr, it is, but if it's off then SDL audio crashes because it seems to garbage collect stuff in the audio thread |
07:30:40 | ftsf_ | Polynomials: C, C++, ObjectiveC, Javascript |
07:31:11 | Arrrr | Mmm, i use sfml for audio without touching anything related to thread |
07:31:14 | Arrrr | s |
07:31:34 | Polynomials | ftst_, I meant the computer architectures (x86, PowerPC, ARM etc...) |
07:31:35 | ftsf_ | SDL you have to set a callback which runs in another thread |
07:31:57 | ftsf_ | Polynomials, i know, but whatever is supported by the C(or other) compiler or Javascript interpreter |
07:32:11 | ftsf_ | nim doesn't compile to native code |
07:32:22 | ftsf_ | (directly) |
07:33:26 | Arrrr | It seems that sdml does the same, but it frees you from caring about that |
07:34:04 | Arrrr | *sfml |
07:34:09 | ftsf_ | Arrrr, so it works fine with --threads:off ? |
07:34:12 | Polynomials | But why in the Nim GitHub page, it says these hardware architectures and OSes are currently supported.... so is that means that Nm compiler is system and architecture dependent????? |
07:35:46 | ftsf_ | "The compiler currently supports the following platform and architecture combinations:" probably the architectures the compiler is tested on |
07:35:52 | ftsf_ | if that's what you're referring to |
07:36:03 | Arrrr | Right, you don't have to turn on threads |
07:36:20 | ftsf_ | you can compile for to a lot more than that (because C compilers can target a lot more than that) |
07:36:32 | ftsf_ | Arrrr, interesting |
07:36:35 | Polynomials | So is that means that I can run it on MIPS, ARM, MicroBlaze and other uncommon ISA? |
07:36:58 | ftsf_ | Polynomials, run what? the Nim compiler? or generate code to run on those architectures? |
07:38:29 | ftsf_ | You can definitely compile code to run on ARM (tested Android code), haven't tried anything more obscure, but if you C compiler supports it then probably |
07:42:35 | Polynomials | But what if a Nim features might not be supported by a computer architecture? |
07:43:08 | ftsf_ | then don't use that feature if you're targeting that architecture |
07:50:01 | * | bjz joined #nim |
08:05:02 | * | dddddd joined #nim |
08:08:55 | * | planhths joined #nim |
08:16:05 | hohlerde | proc showNumber(num: int | float) = echo(num) |
08:16:15 | hohlerde | is that a shortcut for generics? |
08:16:53 | hohlerde | one could also write: proc showNumber[T: int | float](num: T) = echo(num) |
08:17:20 | * | girvo joined #nim |
08:17:21 | hohlerde | oh, brackets are missing |
08:17:22 | ftsf_ | hohlerde, yes i believe so |
08:21:35 | * | ftsf_ quit (Quit: :q!) |
08:22:18 | * | girvo quit (Ping timeout: 276 seconds) |
08:28:53 | flyx | hohlerde: yes |
08:35:14 | * | Polynomials quit (Ping timeout: 264 seconds) |
08:35:16 | * | ThisIsZenified joined #nim |
08:39:31 | * | nicanaca0 joined #nim |
09:12:08 | ThisIsZenified | why is nim significantly falling down while Crystal is conquering the world |
09:12:54 | ThisIsZenified | https://www.techempower.com/benchmarks/#section=data-r12 |
09:12:59 | ThisIsZenified | I don't like this :( |
09:13:14 | ThisIsZenified | Python's performance is damn dead, C++ being the fastest |
09:14:05 | ThisIsZenified | I atleast did hope someone is alive here |
09:15:30 | Araq | you don't like that? then do something about it. |
09:15:38 | euantor | I believe the upcoming async stuff is significantly better isn't it? |
09:16:00 | euantor | Doesn't cheatfate (or somebody?) have a test project that's significantly faster at serving HTTP? |
09:16:01 | ThisIsZenified | I don't know much about Nim codebase |
09:16:11 | ThisIsZenified | I only know about C++ and C and Python |
09:16:13 | Arrrr | "significantly falling down" citation needed |
09:16:22 | ThisIsZenified | already given |
09:16:29 | Arrrr | I dont see anything |
09:16:32 | ThisIsZenified | Arrrr: read context |
09:16:53 | ThisIsZenified | and all major Nim web frameworks are already dead as I see |
09:16:53 | ThisIsZenified | https://www.techempower.com/benchmarks/#section=data-r12 |
09:17:00 | Arrrr | Yes, you dropped a link, but i dont see nim there. Where it is? |
09:17:17 | * | GangstaCat joined #nim |
09:17:25 | ThisIsZenified | http://forum.nim-lang.org/t/1152 |
09:17:28 | * | themagician joined #nim |
09:17:35 | ThisIsZenified | For hw=EC2, Nim only appears for type=JSON, with Jester scoring 13.6% of the top C++ framework's performance being 100%. (Other observations from that data set: Crystal's at 55.4%, ahead of most Go results, but just below LuaJIT and even Ruby inside Nginx. Some functional language frameworks show promise here: Haskell/Wai tops out at 98.3%, Ur/Web at 96.1%, and Scala at 95.2%.) |
09:17:52 | ThisIsZenified | but how did Go slow down and go down |
09:18:11 | ThisIsZenified | Crystal and Ruby (Ruby being dynamic and interpreted (!)) got ahead |
09:18:46 | euantor | The big list at the top has two Crystal entries, both of which say "Did not complete" - am I looking at the wrong thing? |
09:19:02 | cheatfate | euantor, upcoming is not significantly better, its better like 5-20% |
09:19:04 | ThisIsZenified | that forum post talked about Round 11 |
09:19:22 | cheatfate | euantor, wanted is significantly better but it needs more improvements to become framework |
09:19:26 | euantor | Ah, 5-20% is still an improvement cheatfate! |
09:19:27 | ThisIsZenified | for now, I'll keep writing C++ webapps xD |
09:19:30 | ThisIsZenified | and waste a lot of time |
09:20:15 | ThisIsZenified | but, C C++ and Java conquer the world |
09:20:47 | ThisIsZenified | but go-prefork and fasthttp also conquer the world |
09:20:54 | ThisIsZenified | Nim being such a awesome language, falls down |
09:21:10 | Arrrr | which c lib is there? |
09:21:33 | Araq | we have very good C++ interop though |
09:21:43 | Araq | write a wrapper and "conquer the world" |
09:22:26 | ThisIsZenified | Araq: would that even speed Nim? |
09:22:43 | ThisIsZenified | but PyPy is so fast |
09:23:00 | ThisIsZenified | Falcon CPython got ahead of Falcon PyPy |
09:23:03 | ThisIsZenified | this is weird |
09:23:23 | ThisIsZenified | in Falcon's tests, PyPy was 10x faster than CPython |
09:23:27 | ThisIsZenified | this is fishy |
09:26:08 | ThisIsZenified | well, I'll await while Nim gets faster and faster |
09:27:48 | ThisIsZenified | and jester didn't even complete in R11 |
09:28:57 | ThisIsZenified | the benchmarker is a noob lol |
09:28:57 | ThisIsZenified | http://tfb-logs.techempower.com/round-11/peak/linux/2015-09-11-final/latest/logs/jester/out.txt |
09:29:19 | ThisIsZenified | >Setup jester: INFO Jester is making jokes at http://localhost:9001 |
09:29:27 | ThisIsZenified | >Accessing URL http://10.0.3.2:8080/json |
09:29:27 | ThisIsZenified | Response: |
09:29:28 | ThisIsZenified | lol |
09:29:32 | ThisIsZenified | not worth it |
09:29:34 | euantor | Do they provide source code for their tests? |
09:29:49 | Arrrr | is rosencrantz included? https://github.com/andreaferretti/rosencrantz |
09:30:00 | euantor | ALso, that's an old version of Nim, version 0.11.2 |
09:30:07 | euantor | New versions usually improve |
09:30:17 | ThisIsZenified | wat is rosencrantz |
09:30:49 | ThisIsZenified | wow that explicitness and documentation |
09:30:56 | ThisIsZenified | jester had about 10 lines of docs |
09:32:03 | ThisIsZenified | it's cryptic |
09:35:53 | cheatfate | Arrrr, rozencratz dont give you any speed because it based on asynchttpserver. |
09:36:46 | * | kunev quit (Ping timeout: 255 seconds) |
09:37:27 | Arrrr | I suppose every nim lib for websites use the same tricks under the hood |
09:37:29 | ThisIsZenified | nawak scored 24% |
09:38:35 | * | xet7_ joined #nim |
09:38:38 | ThisIsZenified | https://www.techempower.com/benchmarks/previews/round13/#section=data-r13&hw=azu&test=json&l=8ucni7 |
09:38:48 | * | kunev joined #nim |
09:38:54 | ThisIsZenified | well, go is ahead by nim by significant advantage, while in R11, it was behind nim |
09:38:58 | ThisIsZenified | that improvement though |
09:39:12 | ThisIsZenified | wait |
09:39:15 | cheatfate | ThisIsZenified, and we already know that Nim's web frameworks not very fast |
09:39:17 | ThisIsZenified | nawak scored a lot |
09:39:23 | ThisIsZenified | https://www.techempower.com/benchmarks/previews/round13/#section=data-r13&hw=azu&test=query&l=8ucni7 |
09:39:31 | ThisIsZenified | nawak scored 98^ |
09:39:34 | ThisIsZenified | nawak scored 98%( |
09:39:34 | ThisIsZenified | nawak scored 98%* |
09:40:19 | ThisIsZenified | nawak is very fast |
09:40:20 | ThisIsZenified | it seems |
09:41:00 | * | planhths quit (Ping timeout: 244 seconds) |
09:41:16 | * | dddddd quit (Ping timeout: 264 seconds) |
09:41:46 | * | dddddd joined #nim |
09:41:58 | ThisIsZenified | rosencraftz is so cryptic that I can't even understand it |
09:42:25 | ThisIsZenified | are there ORMs for Nim? |
09:42:44 | euantor | None that I know of |
09:43:21 | euantor | I was thinking about writing a query builder (not exactly an ORM, but could lead to one), just haven't got around to it |
09:43:41 | ThisIsZenified | I want insert builder lol |
09:43:53 | ThisIsZenified | it's easy to write SQL |
09:43:54 | euantor | That's what the query builder would do |
09:44:26 | euantor | Easy to write SQL, but not always easy to translate it between DB engines (MySQL, Postgres, SQLite) |
09:44:59 | euantor | I was going to write it for my DB migration tool that I wrote for work rather than using raw SQL files |
09:45:19 | euantor | The idea was that the migrations could be written in NimScript |
09:46:05 | ThisIsZenified | yeah |
09:46:19 | ThisIsZenified | When I write, I usually target a single DB |
09:47:05 | euantor | Unfortunately we don't always have that luxury at work |
09:53:38 | ThisIsZenified | a DAL could be useful regardless |
09:57:28 | * | gokr1 quit (Ping timeout: 264 seconds) |
10:01:31 | * | nairobi quit (Remote host closed the connection) |
10:10:50 | ThisIsZenified | everything is overkill, I'll use asynchttpserver by-hand |
10:16:54 | * | nairobi joined #nim |
10:18:09 | * | girvo joined #nim |
10:22:29 | * | girvo quit (Ping timeout: 244 seconds) |
10:23:08 | * | planhths joined #nim |
10:23:37 | * | cryptotoad quit (Quit: Page closed) |
10:28:10 | * | arnetheduck joined #nim |
10:28:56 | Arrrr | from "nim is dying" to "i'll use asynchttpserver". Given enough time, you will love jester |
10:35:58 | * | miere quit (Read error: Connection reset by peer) |
10:37:49 | ThisIsZenified | I never said nim is dying |
10:37:52 | ThisIsZenified | I absolutely love nim |
10:38:03 | ThisIsZenified | and possibly the asynchttpserver is not for me |
10:38:20 | ThisIsZenified | I'll use the famous C HTTP server and FFI :DDDD |
10:40:06 | * | coffeepot joined #nim |
10:41:19 | Arrrr | Which one? |
10:44:06 | ThisIsZenified | lwan |
10:44:12 | ThisIsZenified | The fastest C webserver |
10:44:20 | ThisIsZenified | if I really needed speed, I'd use asm |
10:44:48 | ThisIsZenified | writing web servers isn't too hard if you want to be minimal |
10:45:56 | Arrrr | nim asm backend when? |
10:46:05 | coffeepot | hey guys, got a question: var s = r"helloxAthere"; echo s converts xA into 0A character? Is this an artifact of echo? |
10:46:39 | ThisIsZenified | xA ? |
10:46:47 | ThisIsZenified | I see |
10:46:52 | ThisIsZenified | but why would it do that |
10:47:01 | coffeepot | yeah the output is "hello" /r "there" :/ |
10:47:11 | coffeepot | i dun want no returns |
10:47:28 | ThisIsZenified | "hello" /r "there"? |
10:47:28 | ThisIsZenified | wat |
10:48:04 | coffeepot | xA seems to translate to a return in a string, even if you prefix with r for rawstring |
10:48:17 | coffeepot | "xa" is fine though! |
10:49:06 | ThisIsZenified | oh |
10:50:22 | coffeepot | it might just be echo, if you: for c in s: echo c, " ", ord(c), you get all the chars as expected |
10:50:41 | * | pafmaf joined #nim |
11:01:34 | * | BratwurstMitSenf joined #nim |
11:01:37 | * | BratwurstMitSenf quit (Client Quit) |
11:02:03 | * | Snircle joined #nim |
11:02:16 | * | BratwurstMitSenf joined #nim |
11:03:28 | * | BratwurstMitSenf left #nim (#nim) |
11:03:58 | * | gokr joined #nim |
11:06:49 | * | brechtm_ joined #nim |
11:10:15 | * | brechtm quit (Ping timeout: 265 seconds) |
11:20:58 | * | nairobi quit (Remote host closed the connection) |
11:21:13 | * | nairobi joined #nim |
11:24:15 | coffeepot | another question: With threads, what's the best way of relinquishing control for X milliseconds? |
11:24:50 | coffeepot | I usually use events, which seem to be equivilent to nim's Cond type? |
11:25:17 | coffeepot | there's a wait(lock, cond) but no timeout parameter |
11:26:01 | coffeepot | correction: wait(cond, lock) |
11:26:05 | * | okami left #nim ("1.5") |
11:26:20 | * | okami joined #nim |
11:26:49 | coffeepot | or do i have to use sleep? |
11:28:11 | ThisIsZenified | there's asyncio |
11:28:17 | ThisIsZenified | wait, I'm dead |
11:28:42 | * | Sentreen quit (Quit: WeeChat 1.4) |
11:29:12 | * | Sentreen joined #nim |
11:29:24 | coffeepot | you can't be dead if you're typing, unless there's irc in the afterlife. Will check out asyncio |
11:30:44 | * | okami quit (Quit: okami) |
11:30:58 | coffeepot | ah sleep works, it'll do lol |
11:31:37 | coffeepot | next question: Is there a simple way of sending a ping? |
11:31:49 | coffeepot | I'm using jester if there's anything in that but couldn't see anything |
11:33:35 | ThisIsZenified | I'm getting annoyed and EVEN MORE ANNOYED while using FFI for lwan |
11:34:26 | * | brechtm_ quit (Remote host closed the connection) |
11:34:39 | coffeepot | Iwan web server? |
11:34:45 | euantor | @coffeepot If you mean an ICMP echo request there's no way that I know of, and no libraries |
11:34:57 | * | miere joined #nim |
11:35:02 | * | brechtm joined #nim |
11:35:09 | Arrrr | use osprocs + ping |
11:35:12 | ThisIsZenified | yes |
11:35:32 | Arrrr | you can read the output of a command |
11:35:36 | ThisIsZenified | jester is retarded |
11:35:43 | coffeepot | @euantor: Yes, ICMP ping, and that makes me sad, but @Arrr you give me hope! |
11:36:46 | coffeepot | @ThisIsZenified I don't know a great deal about web servers, why is jester special needs? |
11:36:51 | * | aziz joined #nim |
11:37:30 | coffeepot | Arrr, it's a shame we don't have anything 'native', feels kinda dirty running the ping command |
11:39:25 | Arrrr | use ffi for this c lib http://stackoverflow.com/a/17827849 |
11:40:01 | coffeepot | hey at least Iwan is in C, I tried to use bullet once and just had no idea how to use ffi with C++ as it uses some fancy stuff and I'm but a noob |
11:40:41 | FromGitter | <endragor> coffeepot: apps running under non-root privileges are not allowed to send ICMP packets afaik. default `ping` utility has setuid-bit set to run with elevated privileges. |
11:41:02 | * | miere quit (Read error: Connection reset by peer) |
11:41:30 | coffeepot | @FromGitter hey that's handy info. So maybe not so dirty! |
11:41:31 | FromGitter | coffeepot, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
11:42:02 | Arrrr | *bleep bloop* lol |
11:42:16 | * | miere joined #nim |
11:42:20 | * | miere quit (Read error: Connection reset by peer) |
11:42:33 | coffeepot | Arrrr I think all bots are required to make that sound by law |
11:43:00 | ThisIsZenified | how to access those structs that were exported |
11:43:04 | ThisIsZenified | from Nim |
11:43:14 | ThisIsZenified | I men lwan |
11:43:46 | coffeepot | structs from nim to c? |
11:43:54 | ThisIsZenified | vice versa |
11:44:13 | coffeepot | if you've run c2nim on them it should do that for you, more or less |
11:44:19 | Arrrr | If they are pointers, simply use ptr object |
11:44:43 | ThisIsZenified | pointers aren't the problem atm |
11:45:20 | * | Sentreen quit (Quit: WeeChat 1.4) |
11:45:57 | * | aziz quit (Quit: Ex-Chat) |
11:46:17 | Arrrr | https://github.com/BlaXpirit/nim-chipmunk/blob/master/src/chipmunk.nim#L60 |
11:46:20 | Arrrr | https://chipmunk-physics.net/release/Chipmunk-5.x/Chipmunk-5.3.1-Docs/#cpVect |
11:47:54 | * | Sentreen joined #nim |
11:50:57 | ThisIsZenified | let me see |
11:51:01 | ThisIsZenified | there are problems with imports |
11:51:02 | yglukhov | to someone proficient with nims asyncio. are named pipes supported? |
11:52:09 | ThisIsZenified | so I have to predeclare the structs used by lwn? |
11:53:41 | Arrrr | You can also do what coffeepot said, using that c2nim tool |
11:54:00 | ThisIsZenified | well, let me see |
11:54:39 | ThisIsZenified | It's going to be alot of work, but I have faith it'd work |
11:56:07 | ThisIsZenified | for now, I'll malloc into some 4k pointers to blast my computer |
11:58:16 | * | Arrrr quit (Quit: WeeChat 1.5) |
11:59:51 | cheatfate | endragor: my archlinux ping dont have any setuid/setgid attributes |
12:01:15 | * | gokr1 joined #nim |
12:01:33 | * | gokr quit (Quit: Leaving.) |
12:01:59 | FromGitter | <endragor> cheatfate: on recent versions of Linux the file has CAP_NET_RAW capability that allows it to send ICMP packets |
12:02:56 | ThisIsZenified | 'k, I'm using c2nim |
12:02:58 | ThisIsZenified | but how do I use it |
12:03:14 | ThisIsZenified | ./c2nim --header /usr/local/include/lwan/lwan.h |
12:03:14 | ThisIsZenified | usr/local/include/lwan/lwan.h(23, 11) Error: identifier expected, but found 'C' |
12:05:28 | cheatfate | endragor: have you see my latest PR? |
12:07:18 | * | jeffc joined #nim |
12:07:18 | * | jeffc_ quit (Read error: Connection reset by peer) |
12:09:27 | ThisIsZenified | Ok, I just quit |
12:09:42 | ThisIsZenified | c2nim doesn't work lwan.h |
12:12:47 | ThisIsZenified | may nimrod is good for my sidekickers |
12:12:57 | ThisIsZenified | maybe* |
12:13:06 | coffeepot | sidekickers? |
12:13:30 | ThisIsZenified | yeah |
12:14:08 | ThisIsZenified | I have a hybrid webapp, which needs to run some schedule cleanups and schedule programs that process input from web |
12:14:23 | ThisIsZenified | and some other applications that run the actual applications, webapp is just the frontend |
12:14:55 | ThisIsZenified | I currently use Django and varnish |
12:14:59 | ThisIsZenified | it's pretty fast |
12:16:57 | ThisIsZenified | I think Nim is not yet featureful for me... |
12:16:57 | ThisIsZenified | gotta stick to Django -.- |
12:18:54 | * | girvo joined #nim |
12:19:07 | coffeepot | ah, thats a shame. If you could get a c2nim of the Iwan header working it would probably be fairly easy to use in nim. Also wouldnt hurt to have that accessible for the nim community |
12:20:15 | coffeepot | but i must say I can't help with that myself, only used the result of c2nim not actually generated a header with it |
12:20:47 | FromGitter | <endragor> cheatfate: looking at it. I think you need to borrow `==` for `AsyncEvent`. It broke my code that compares event variable with `nil`. |
12:23:38 | * | girvo quit (Ping timeout: 265 seconds) |
12:25:30 | FromGitter | <endragor> cheatfate: everything else if fine, my tests now pass with Nim’s `devel`. thank you. |
12:25:43 | ThisIsZenified | I see |
12:25:45 | ThisIsZenified | Nimrod is good enough for my sidekickers and the actual application that I use |
12:25:45 | ThisIsZenified | and go is OK for the web side |
12:25:45 | ThisIsZenified | and JS for client-side |
12:25:45 | ThisIsZenified | I hope it goes well :D |
12:26:27 | cheatfate | endragor: i will add `borrow` in next PR with new tasynciossl.nim |
12:26:33 | FromGitter | <vegansk> @Araq, @dom96! PLEASE do something with this PR! https://github.com/nim-lang/Nim/pull/4683. Am I the one who needs jester to handle post requests without crashes? |
12:27:12 | cheatfate | vegansk: i dont think it will be accepted until new type (pointer, size) will be introduced |
12:27:56 | FromGitter | <vegansk> There are two more PRs and I already think that it will take a month for that. How can I use it in production? |
12:28:23 | FromGitter | <vegansk> @cheatfate, https://github.com/nim-lang/Nim/pull/4683#issuecomment-244756751 |
12:30:15 | cheatfate | vegansk: some people just hate pair of (pointer, size)... |
12:34:14 | FromGitter | <vendethiel> it's pretty dangerous, so yes :) |
12:35:09 | * | nairobi quit (Ping timeout: 276 seconds) |
12:37:18 | * | nairobi joined #nim |
12:46:07 | FromGitter | <Araq> @vegansk I'm giving dom time until tonight and then I'll merge it, ok? |
12:46:31 | FromGitter | <Araq> and no, new type (pointer, size) is not required for this PR to be accepted |
12:47:16 | * | brechtm quit (Remote host closed the connection) |
12:47:56 | FromGitter | <vegansk> @Araq, thanks!\ |
12:48:39 | * | brechtm joined #nim |
12:51:59 | yglukhov | cheatfate: are named pipes supported by ayncdispatch? |
12:52:53 | cheatfate | yglukhov, https://github.com/cheatfate/wanted/blob/master/asyncpipes.nim |
12:54:55 | cheatfate | yglukhov, and you even don't need to give them names :) |
12:55:39 | yglukhov | cheatfate: awesome! are you gonna push it to nim? and i want to give them names. otherwise how can i open the same pipe from different processes? |
12:56:23 | cheatfate | yglukhov, but unix dont have named pipes, how you want to port it to posix systems? |
12:56:38 | yglukhov | with named sockets for example? |
12:56:54 | cheatfate | yglukhov, you mean unix domain sockets? |
12:57:07 | yglukhov | yep. or fifos |
12:57:55 | cheatfate | yglukhov, then i think i need to add it to asyncpipes i think and only then i will push it |
12:58:45 | yglukhov | cool. can't wait! ;) |
12:59:26 | coffeepot | +1 for asych pipes. I don't need it now, but can see it being very useful for servers |
13:00:16 | coffeepot | as in, server applications |
13:01:43 | yglukhov | sure, and not only servers. its a nice ipc abstraction in general, useful for lots of ipc things. |
13:03:42 | coffeepot | definitely. Just need a windows service wrapper and I think I have almost everything I need in Nim |
13:03:47 | euantor | Yeah, I was looking for FIFO support in the past |
13:14:52 | * | gokr1 quit (Ping timeout: 264 seconds) |
13:43:36 | * | planhths quit (Quit: Konversation terminated!) |
13:44:16 | coffeepot | new question! Running a thread, using databases (my own odbc lib). Long story short, compiler is saying I can't call a proc because "is not GC-safe as it performs an indirect call here [GcUnsafe2]". The offending part is calling a proc(msg: string). Why is that illegal for threaded gc? |
13:44:48 | coffeepot | wouldn't the proc(msg: string) that is stored there be called in the same thread context? |
13:46:21 | Araq | coffeepot: make the type proc(msg: string) {.gcsafe.} |
13:46:50 | coffeepot | wheee thanks Araq :) |
13:49:46 | * | nairobi quit (Read error: Connection reset by peer) |
13:52:08 | arnetheduck | Araq, want a patch that drops endb? read somewhere it's dead.. |
13:55:02 | * | libman joined #nim |
14:04:51 | Araq | arnetheduck: no, endb still has the best watchpoint feature |
14:05:14 | Araq | only usable by me apparently, but *shrug* |
14:08:49 | * | arnetheduck quit (Ping timeout: 244 seconds) |
14:14:08 | * | bungoman quit (Read error: Connection reset by peer) |
14:14:35 | * | bungoman joined #nim |
14:16:41 | * | arnetheduck joined #nim |
14:17:27 | * | xet7_ quit (Ping timeout: 250 seconds) |
14:17:29 | arnetheduck | ok, how's it different from the gdb one? |
14:19:00 | Araq | it computes hashes of the full datastructure being watched and pauses if the hash changes. |
14:19:30 | * | nairobi joined #nim |
14:19:30 | * | libman quit (Read error: Connection reset by peer) |
14:19:37 | Araq | gdb can only do it for memory addresses or stupid shit like that, it doesn't know what "full datastructure" means |
14:19:48 | * | girvo joined #nim |
14:22:28 | coffeepot | Sorry guys, another question. I have set up a thread and am accessing a global which i thought was wrapped with a lock, but compiler says differently. Mocked up roughly what I'm doing here: https://gist.github.com/coffeepots/c2f18ee3639e98699d1520648f775a35 |
14:22:33 | coffeepot | any ideas what I'm doing wrong? |
14:24:03 | * | girvo quit (Ping timeout: 240 seconds) |
14:24:30 | cheatfate | gitterers do you have dom96 there? |
14:28:21 | Araq | coffeepot: use a shared table |
14:28:33 | coffeepot | :-o |
14:28:49 | * | arnetheduck quit (Ping timeout: 265 seconds) |
14:29:02 | coffeepot | dont think they were about when i first wrote this, will investigate |
14:31:36 | * | Satyajit quit (Quit: https://fnordserver.eu) |
14:32:31 | * | arnetheduck joined #nim |
14:33:12 | arnetheduck | ah. guess gdb can be taught that trick with a py script since it can watch expressions, though it'd be some work |
14:33:21 | arnetheduck | just looking for opportunities to simplify compiler ;) easier to read one working solution than two partial ones ;) so what's broken with endb? does it use hardware watchpoints? |
14:33:43 | arnetheduck | oh, and one more q - looking at threads - how come mparallel/mspawn are transformed in c generator and not earlier, somewhere in sem? |
14:35:31 | FromGitter | <xxlabaza> In such cases I am using something like pgbouncer (it is from PostgreSQL world). It is man in the middle, like proxy. All my clients don’t connect to Postgres directly, but throught pgbouncer and this program handle connections pools for all users, it allows me to not implement thread pools in my Nim programs or scripts, in code it looks like I’m opening connection on all requests, but it not |
14:36:04 | Araq | the idea was that it is trivial to eval 'parallel + spawn' at compiletime when we don't touch it until codegen |
14:36:36 | Araq | since you can by definition just ignore parallel+spawn annotations and get the same semantics |
14:36:59 | * | libman joined #nim |
14:42:54 | * | krux02 joined #nim |
14:44:20 | arnetheduck | ok. I'll just replicate that in nlvm then |
14:49:15 | * | arnetheduck quit (Quit: Leaving) |
14:49:26 | * | arnetheduck joined #nim |
14:49:36 | * | libman quit (Read error: Connection reset by peer) |
14:54:53 | coffeepot | Araq, where are the shared tables? Can't see them in tables.nim, thought it might be a pragma but no luck there either |
14:56:11 | * | onionhammer joined #nim |
14:56:56 | * | arnetheduck quit (Ping timeout: 265 seconds) |
14:58:32 | * | themagician quit (Ping timeout: 240 seconds) |
15:00:54 | * | pregressive joined #nim |
15:01:05 | cheatfate | do we have SSL guru here? |
15:02:25 | Araq | import sharedtables |
15:02:38 | * | arnetheduck joined #nim |
15:03:17 | * | arnetheduck quit (Client Quit) |
15:03:30 | * | arnetheduck joined #nim |
15:04:10 | * | pregressive quit (Remote host closed the connection) |
15:04:10 | coffeepot | araq cheers again :) |
15:07:00 | * | pregressive joined #nim |
15:08:07 | * | libman joined #nim |
15:10:52 | * | mtj_ quit (Ping timeout: 265 seconds) |
15:10:54 | * | planhths joined #nim |
15:19:14 | * | libman left #nim (#nim) |
15:21:19 | * | pregressive quit (Read error: Connection reset by peer) |
15:21:22 | * | pregress_ joined #nim |
15:26:14 | * | Satyajit joined #nim |
15:28:42 | * | arnetheduck quit (Ping timeout: 276 seconds) |
15:32:03 | * | M-Quora quit (Read error: Connection reset by peer) |
15:32:04 | * | TheManiac quit (Read error: Connection reset by peer) |
15:32:04 | * | hohlerde quit (Remote host closed the connection) |
15:36:20 | * | literal quit (Quit: leaving) |
15:36:36 | * | literal joined #nim |
15:41:50 | * | brson joined #nim |
15:51:19 | * | hohlerde joined #nim |
15:51:43 | * | arnetheduck joined #nim |
15:53:53 | * | mtj_ joined #nim |
15:56:11 | * | PMunch joined #nim |
15:58:04 | * | arnetheduck quit (Ping timeout: 264 seconds) |
16:00:28 | * | pafmaf quit (Ping timeout: 264 seconds) |
16:11:32 | * | Andris_zbx quit (Remote host closed the connection) |
16:13:51 | * | nairobi quit (Ping timeout: 244 seconds) |
16:14:31 | * | gokr joined #nim |
16:16:50 | * | nairobi joined #nim |
16:19:07 | dom96 | @vegansk: I don't understand why this code is so critical. You can easily use your own Nim fork while we review it |
16:19:55 | cheatfate | dom96, i've got a trouble with SSL, server doesn't handle client connection drop |
16:20:06 | cheatfate | i mean asyncssl |
16:20:41 | * | girvo joined #nim |
16:21:18 | dom96 | cheatfate: I don't think I can help much there, SSL is a pain in the ass and I spent many days figuring out what the hell its problem was. |
16:21:46 | dom96 | but feel free to gist what you have and I can take a look |
16:21:55 | krux02 | BlaXpirit: why don't you contribute your random number module to the standard library? |
16:22:32 | cheatfate | dom96, https://gist.github.com/cheatfate/a704c520d48c0c56eb0c920e06b61b38 |
16:22:47 | cheatfate | i'm trying to make test which uses asyncdispatch, not old `asyncio` |
16:22:50 | federico3 | (please always prefer OS sprng over user-space ones if possible and warn the users about the risks) |
16:23:13 | cheatfate | and server could not handle client disconnection... |
16:23:29 | cheatfate | this https://gist.github.com/cheatfate/a704c520d48c0c56eb0c920e06b61b38#file-tasyncssl-nim-L43 never happens |
16:23:34 | dom96 | cheatfate: ahh, so you're trying to port the SSL asyncio test to async await? |
16:23:40 | cheatfate | yep |
16:23:57 | cheatfate | but i'm not porting i'm replacing :) |
16:24:23 | * | nairobi quit (Remote host closed the connection) |
16:24:28 | dom96 | have you tried connecting just one client to get a better idea of what's going on? |
16:24:36 | cheatfate | it doing good connect/read/write but looks like asyncnet could not handle disconnection |
16:24:40 | dom96 | oh, I see you do that |
16:25:00 | dom96 | is line 36 executed? |
16:25:36 | cheatfate | dom96, yep |
16:25:41 | cheatfate | i think problem is here |
16:25:42 | cheatfate | https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncnet.nim#L165 |
16:25:49 | cheatfate | somewhere around |
16:25:54 | * | girvo quit (Ping timeout: 276 seconds) |
16:26:05 | dom96 | hrm, https://gist.github.com/cheatfate/a704c520d48c0c56eb0c920e06b61b38#file-tasyncssl-nim-L65 |
16:26:09 | dom96 | I don't think that's necessary |
16:26:16 | dom96 | 'accept' should wrap the socket |
16:26:19 | dom96 | if the server is SSL |
16:26:44 | * | yglukhov quit (Ping timeout: 244 seconds) |
16:27:32 | cheatfate | dom96, asyncnet.accept dont anything with ssl :( |
16:27:56 | dom96 | IIRC net.accept does |
16:27:59 | dom96 | so asyncnet should too |
16:28:19 | dom96 | but yeah... I never needed an SSL server so this wasn't tested at all |
16:29:36 | cheatfate | also question, do we support windows iocp and sll? |
16:29:41 | cheatfate | ssl*? |
16:30:29 | dom96 | Not sure |
16:31:08 | cheatfate | then nevermind this was just a question |
16:31:22 | * | gokr quit (Ping timeout: 252 seconds) |
16:34:59 | BlaXpirit | krux02, in the past when the situation in standard library was dire, i had a strong position on the topic. some time after that I stopped using Nim. nobody reached out to me about including the library (though it was almost considered) and i don't insist. maybe it has too many small parts to be included. and in the end, i'm not even confident that the library is implemented correctly. |
16:36:38 | krux02 | BlaXpirit: Don't worry too much about being correct, at least you have put some thoughts into the API, the standard library is pretty bad in that respect |
16:37:09 | krux02 | I just opened an issue with it's problems: https://github.com/nim-lang/Nim/issues/4726#issuecomment-245004365 |
16:37:22 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:38:17 | BlaXpirit | krux02, this may be a fun read https://github.com/nim-lang/Nim/issues/1506 |
16:38:28 | BlaXpirit | that's the "situation in standard library was dire" part |
16:38:34 | * | brechtm_ joined #nim |
16:39:45 | * | Demos joined #nim |
16:40:52 | BlaXpirit | couldn't believe that was 2 years ago. damn i'm old :p |
16:42:19 | * | brechtm quit (Ping timeout: 260 seconds) |
16:42:50 | dom96 | "Anybody willing to volunteer their time to move @BlaXpirit's library into the stdlib?" -- Me desperately asking for help |
16:42:55 | dom96 | But help never came... |
16:44:24 | krux02 | At that time I did not know anything about Nim |
16:44:59 | BlaXpirit | oh, stdlib is still seeded based on time :( |
16:45:28 | * | jackv quit (Ping timeout: 264 seconds) |
16:45:31 | krux02 | yes it is |
16:46:10 | krux02 | closing the old issue was a mistake considering that it had some good information in it. |
16:46:23 | BlaXpirit | information is still there |
16:46:59 | krux02 | yes but it is not visible anymore, because it is tagged as resolved |
16:47:07 | krux02 | or closed |
16:47:33 | krux02 | I am volunteering to help with the random module |
16:47:52 | federico3 | what's the use case for this random module? |
16:48:38 | krux02 | federico3: witch random module stdlib or BlaXpirit? |
16:49:17 | BlaXpirit | licensing may also be a pain |
16:49:23 | * | GustavoLapasta joined #nim |
16:49:58 | * | jackv joined #nim |
16:49:58 | krux02 | generally, encryption and particle effects |
16:50:24 | federico3 | both. |
16:51:03 | krux02 | if you mean generally, random is used for encryption and particle effects. |
16:51:22 | krux02 | You wouldn't want your shotgun in games to always shoot the same pattern |
16:52:10 | krux02 | BlaXpirit: I think writing an e-mail can solve most problems |
16:54:13 | krux02 | "Dear Mr(s) X, we would like to ask you if it is ok to port part Y out of your library into our programming language and release it under license Z, are you okay with that? Sincerely the Nim community. |
16:54:22 | Demos | interestingly in many fps games (tf2 and cs) shotguns DO always shoot the same pattern |
16:54:30 | Demos | well for tf2 it's a setting |
16:54:33 | Demos | "competitive mode" |
16:55:02 | krux02 | competitive players don't like randomness |
16:55:13 | Demos | anyway, c++ has a pretty good random library (despite some c++ syntax strangeness), and I think c++17 has an "easy" version |
16:55:28 | BlaXpirit | the library is HUGE |
16:55:37 | Demos | <random> |
16:55:39 | Demos | ? |
16:55:54 | krux02 | horribly overdesigned and too hard to use in my opinion |
16:56:02 | federico3 | krux02: let's not confuse encryption and other use cases. Many user-space SPRNG are not fit for encryption |
16:56:07 | Demos | yeah, there's a "easy" version. |
16:56:17 | krux02 | it's not bad, but try to "just get a random integer" |
16:56:29 | Demos | but like I do want the ability to have a seperate PRNG per thread (and no lock) even for the easy rand() case |
16:56:31 | Demos | yeah |
16:57:00 | krux02 | I just wanted to give some very different examples for use cases |
16:58:08 | Demos | http://en.cppreference.com/w/cpp/experimental/lib_extensions_2 |
16:58:23 | Demos | below the erase_functions and the stupid observer_pointer stuff |
16:58:51 | Demos | but yeah, I use <random> in my c++ code but it is hella verbose |
17:01:19 | dom96 | So what exactly do you guys need out of the random module? |
17:01:28 | krux02 | I like the easy interface |
17:01:36 | dom96 | My experience so far has been "yeah, I need a random number, okay i'll just call this function" |
17:02:42 | dom96 | Then I thought "hrm, it would be nice to get as much entropy as possible for this card game I am making. Meh, i'll just use /dev/urandom manually or use the random.org API" |
17:03:44 | * | nairobi joined #nim |
17:03:44 | BlaXpirit | so how exactly did you use /dev/urandom |
17:03:53 | Demos | yeah, I think you need both an in depth random API and a simple function |
17:03:53 | * | nairobi quit (Read error: Connection reset by peer) |
17:04:03 | Demos | but that function should probably not just call c's rand() |
17:04:13 | * | elrood joined #nim |
17:04:18 | Demos | because the PRNG sucks and I'm pretty sure it involves acquiring a mutex |
17:04:29 | * | nairobi joined #nim |
17:05:01 | dom96 | BlaXpirit: just read from it |
17:05:04 | krux02 | lib_extension_2 api from c++ is pretty nice |
17:05:34 | BlaXpirit | dom96, well then your game doesnt work from windows, and you still haven't explained how you get random numbers by "reading from it" |
17:06:14 | BlaXpirit | random bytes - i get it, yes, but then? |
17:06:33 | krux02 | I would suggest that on linux the default RNG initializes from /dev/urandom and on Windows an the windows version from it (I am just guessiong there is one) |
17:07:20 | BlaXpirit | krux02, so like in my lib |
17:07:35 | krux02 | yes |
17:08:23 | dom96 | BlaXpirit: honestly cannot remember. |
17:08:38 | dom96 | Hrm, guess I removed it https://github.com/dom96/c4hbot/blob/master/cahbot.nim#L235 |
17:08:49 | * | StarBrilliant quit (Quit: ZNC - http://znc.in) |
17:09:17 | krux02 | BlaXpirit, how do you generate a uniform distributed number in the range 1..X when x is not a power of two? |
17:09:29 | krux02 | I mean 0..X |
17:09:31 | ThisIsZenified | just open dev urandom for BSD or Linux |
17:09:39 | ThisIsZenified | and in Windows use CryptGenRandom |
17:10:03 | krux02 | do you generate from 0 to the next power of two -1 and then trow away when above X? |
17:10:31 | BlaXpirit | krux02, well i discard numbers until it's within modulo ugh how to even explain that |
17:10:41 | krux02 | ok I got it |
17:10:52 | federico3 | discarding is ok, don't do modulo |
17:11:00 | BlaXpirit | say i have a random number 0..7, and i want random number 0..2, so i discard numbers until it's 0..5 |
17:11:05 | * | nsf quit (Quit: WeeChat 1.5) |
17:11:09 | krux02 | I know that method for random points within a circle |
17:12:06 | BlaXpirit | but that's the sketchiest part of my lib, i think i'm unnecessarily wasteful when it comes to big numbers |
17:12:59 | krux02 | what do you mean wasteful? |
17:13:11 | krux02 | don't you always go to the next power of two? |
17:13:29 | BlaXpirit | i mean some random numbers are discarded although they don't have to be |
17:14:19 | krux02 | Ok that I don't understand, where is the complexity in the `<` operator? |
17:15:22 | krux02 | I know, no matter how big the number are, when you have to throw a lot of bit's away, you can't simply say "who cares, I only generate the last X bits new" |
17:15:28 | krux02 | that would destroy randomness |
17:16:22 | Araq | I just do modulo :P |
17:16:48 | * | brechtm_ quit (Remote host closed the connection) |
17:17:06 | krux02 | ouch |
17:17:27 | * | brechtm joined #nim |
17:17:52 | krux02 | I mean for rolling dice, it doesn't matter, but I think I don't need to explain that it is wrong |
17:20:14 | Araq | I guess my random.nim should use |
17:20:17 | Araq | int x; |
17:20:17 | Araq | do { |
17:20:17 | Araq | x = rand(); |
17:20:19 | Araq | } while (x >= (RAND_MAX - RAND_MAX % n)); |
17:20:21 | Araq | x %= n; |
17:20:23 | Araq | instead |
17:20:49 | FromGitter | <vegansk> @dom96 , I have 3 applications used in productions and written in Nim, not counting developer tools and other internal services. All of them are in continuous development. For one project I need to fork Nim, apply this PR, then add asyncstreams, then fix asynchttpserver via asyncstreams, then fork and add streams to the jester API. Then I need to write package.json with my custom jester. I'm not the only one who writes in Nim in our |
17:20:49 | FromGitter | ... company. So I must deploy my fork and all stuff on developer machines and fix CI scripts. Sometimes we, like the others, find the bugs that are showstopper for us. So, we need to merge our fork with upsteram/devel. I would like to avoid it if possible |
17:23:28 | krux02 | Araq, that method is now to me I first need to understand it |
17:24:46 | BlaXpirit | i get the idea but the comparison is not right |
17:25:02 | * | Demon_Fox joined #nim |
17:25:27 | BlaXpirit | actually it might be right |
17:25:45 | ThisIsZenified | if you want true randomness, you should probably use random.org public API |
17:27:24 | krux02 | int x; |
17:27:24 | krux02 | do { |
17:27:24 | krux02 | x = rand() & nextPowerOfTwo(n)-1; |
17:27:24 | krux02 | } while (x < n); |
17:27:46 | krux02 | that's the only one I understand :-P |
17:27:58 | dom96 | @vegansk: I know, I'm sorry about the delay. I will merge it once I eat. It seems like you need other PRs merged as well though, and there will be further delays with those. |
17:28:35 | dom96 | @vegansk: I also don't think you need to keep reapplying your PR. Just keep a fork of Nim which contains all your patches and pull from upstream every once in a while. |
17:29:20 | krux02 | @vegansk: https://help.github.com/articles/syncing-a-fork/ |
17:29:50 | krux02 | I hope that was the issue |
17:29:56 | krux02 | I was just guessing |
17:30:37 | * | csoriano joined #nim |
17:31:05 | ThisIsZenified | dom96: any ideas why nawak is faster than Jester |
17:31:31 | dom96 | ThisIsZenified: nope, never had the time to investigate. |
17:32:09 | krux02 | ok I got it, it could be right |
17:33:48 | krux02 | I would not make the standard library depend on having internet |
17:34:47 | FromGitter | <vegansk> @dom96, thanks. What do you think if I merge asyncstreams module and asynchttpserver changes in one PR to speed up the process? |
17:35:58 | dom96 | @vegansk: I don't think that will have much of an effect on speeding up the process. Just keep it separate |
17:37:18 | * | krux02 quit (Quit: Verlassend) |
17:38:44 | euantor | Keeping it separate also makes the git history more obvious |
17:48:43 | kier | dom96: have you seen my reply to https://github.com/nim-lang/irc/pull/7 ? |
17:49:53 | * | xet7_ joined #nim |
17:51:16 | dom96 | kier: sorry, replied |
17:52:01 | kier | dom96: cool. thanks for clarifying, will get on it |
17:52:29 | dom96 | thanks |
17:59:17 | FromGitter | <vegansk> @dom96, ok. asyncstreams PR is ready to be publicated when you merge previous PR, asynchttpserver will be then publicated in 8-9 hours, it's 1am here :-) |
18:00:13 | dom96 | @vegansk: where are you from? :) |
18:00:59 | Demos | if I want to make a nimscript task to compile some tools for my project should I just setCommand "" and then exec "nim c ...." ? |
18:02:06 | FromGitter | <vegansk> @dom96, Novosibirsk, Western Siberia, Russia |
18:02:24 | * | kulelu88 joined #nim |
18:02:30 | dom96 | @vegansk: cool! |
18:04:53 | FromGitter | <vegansk> @dom96, yes, and I guess I'm not the only one here from Novosibirsk :-) |
18:10:29 | * | yglukhov joined #nim |
18:11:43 | dom96 | @vegansk: why did you remove this code? https://github.com/nim-lang/Nim/pull/4683/files#diff-e7d29941cb2ca6bf4e0f5c627239bc7bL787 |
18:16:23 | FromGitter | <vegansk> @dom96, buf]0https://github.com/nim-lang/Nim/pull/4683/files#diff-e7d29941cb2ca6bf4e0f5c627239bc7bR774 |
18:16:45 | FromGitter | <vegansk> Oops, buf[0] = '\0' is commented |
18:18:22 | dom96 | IIRC the winapi returns it sometimes, that might just be testing code |
18:18:24 | dom96 | I will restore it |
18:19:24 | kulelu88 | @vegansk: testing. do you see this on gitter? |
18:20:28 | dom96 | why wouldn't he? |
18:20:51 | kulelu88 | does it ping him? dom96 |
18:20:55 | BlaXpirit | yes |
18:21:00 | BlaXpirit | pro tip: on IRC you don't have to write out the '@' at the start of the message |
18:21:10 | kulelu88 | I know that BlaXpirit . |
18:21:26 | kulelu88 | just seeing how the gitter/irc gateway works |
18:21:31 | BlaXpirit | i mean also when addressing gitter users |
18:21:37 | * | girvo joined #nim |
18:21:50 | kulelu88 | where is the code for the bridge between gitter and irc? |
18:22:08 | FromGitter | <vegansk> @dom96, got it. |
18:22:22 | BlaXpirit | kulelu88, private message the bot to get a link |
18:22:40 | FromGitter | <vegansk> @kulelu88, yes |
18:25:07 | kulelu88 | nice. nice bot BlaXpirit |
18:25:23 | BlaXpirit | thx |
18:26:04 | * | girvo quit (Ping timeout: 240 seconds) |
18:31:33 | * | gunn joined #nim |
18:35:15 | * | gunn_ quit (Ping timeout: 276 seconds) |
18:36:36 | kulelu88 | BlaXpirit: should I ask questions about critter here or in #critterbot ? |
18:37:13 | dom96 | vegansk: merged |
18:39:34 | * | Demos quit (Ping timeout: 240 seconds) |
18:41:33 | FromGitter | <vegansk> @dom96, thanks. Please look at https://github.com/nim-lang/Nim/pull/4727 when you can. |
18:43:17 | * | nairobi quit (Read error: Connection reset by peer) |
18:46:13 | * | nairobi joined #nim |
18:47:43 | dom96 | vegansk: Why do you want this in the standard library? |
18:48:02 | dom96 | I would rather let it mature in a nimble package |
18:49:37 | FromGitter | <vegansk> @dom96, because asynchttpserver is in stdlib and I want to add request's body stream to Request object. The problem is that I can't receive big posts, the applications crashes due to the out of memory |
18:50:13 | * | Demos joined #nim |
18:50:16 | dom96 | I'm sure there is a simpler way |
18:50:32 | * | xet7_ quit (Ping timeout: 240 seconds) |
18:50:33 | dom96 | Can't you just fix asynchttpserver instead of making it use another module? |
18:50:43 | dom96 | hrm |
18:50:59 | dom96 | I think I see the problem. |
18:51:42 | FromGitter | <vegansk> Yep. body is string |
18:52:24 | FromGitter | <vegansk> So we need some sort of streaming. |
18:52:36 | FromGitter | <vegansk> Better async then sync |
18:53:03 | dom96 | okay, I think a better solution is to give access to the client socket in the request callback |
18:55:16 | FromGitter | <vegansk> And what if I send multipart message? Handle it manually? |
18:55:57 | euantor | Yeah, I'd rather have a scalable non-crashing solution in the stdlib |
18:56:21 | euantor | Otherwise everybody from any other language using the HTTP server will just think "WTF" when they try to use Nim's |
18:56:37 | dom96 | vegansk: you would need to anyway wouldn't you? |
18:56:49 | dom96 | I don't see how your asyncstream module helps with that |
18:57:08 | dom96 | it just offers an abstraction over what an AsyncSocket already provides |
18:57:14 | FromGitter | <vegansk> I want to suggest to read the body as a string, map of strings with form data parameters, stream, map of streams with form data parameters |
18:58:27 | * | gokr joined #nim |
18:59:13 | * | Ven_ joined #nim |
18:59:40 | FromGitter | <vegansk> Hm, yes, I can do it with AsyncSocket. |
19:01:29 | FromGitter | <vegansk> @dom96, but if we have streams in stdlib, why we can't have async version there? :-) |
19:01:57 | dom96 | vegansk: We can |
19:02:02 | dom96 | But maybe later |
19:02:15 | FromGitter | <vegansk> And, no, I can't do it with AsyncSocket. AsyncSocket doesn't know about the end of multipart portion, so I need to check it manually |
19:02:58 | dom96 | again, you would need to do the same with asyncstream |
19:03:39 | * | M-Quora joined #nim |
19:03:47 | * | TheManiac joined #nim |
19:05:10 | FromGitter | <vegansk> Yes, I'll write AsyncStream implementation for multipart, and will use AsyncSocketStream for entire body. |
19:05:41 | FromGitter | <vegansk> And both of them will have the same interface. |
19:05:56 | dom96 | write an implementation for asyncsocket instead? |
19:07:13 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:08:40 | Demos | lexbase: it has a js version that I'd like to use during compile time |
19:08:43 | Demos | any way to do this |
19:08:56 | Demos | I tried when nimvm but since one of the symbol types differs it does not work |
19:12:16 | * | brson quit (Quit: leaving) |
19:25:21 | * | dddddd quit (Ping timeout: 244 seconds) |
19:27:02 | * | GustavoLapasta quit (Quit: Leaving) |
19:30:13 | Demos | welp found a vm bug |
19:31:02 | * | nairobi quit (Remote host closed the connection) |
19:34:26 | * | xet7 joined #nim |
19:50:30 | * | nsf joined #nim |
20:03:52 | * | allan0 quit (Ping timeout: 240 seconds) |
20:04:12 | * | ryu0 joined #nim |
20:04:17 | * | ryu0 left #nim ("WeeChat 1.4") |
20:11:25 | * | allan0 joined #nim |
20:12:47 | * | bungoman quit (Ping timeout: 250 seconds) |
20:13:57 | * | brson joined #nim |
20:22:23 | * | girvo joined #nim |
20:26:46 | * | girvo quit (Ping timeout: 252 seconds) |
20:34:12 | * | _stowa joined #nim |
20:42:16 | * | _stowa quit (K-Lined) |
20:49:26 | * | fredrik92 joined #nim |
20:51:59 | * | nairobi joined #nim |
20:53:17 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
20:59:34 | * | elrood quit (Remote host closed the connection) |
21:05:58 | * | yglukhov quit (Remote host closed the connection) |
21:10:29 | * | Snircle joined #nim |
21:19:29 | * | Matthias247 joined #nim |
21:19:59 | * | fredrik92 quit (Quit: Leaving.) |
21:20:52 | * | fredrik92 joined #nim |
21:22:55 | * | xet7 quit (Remote host closed the connection) |
21:23:47 | * | xet7 joined #nim |
21:24:51 | * | antranigv joined #nim |
21:38:43 | * | planhths quit (Quit: Konversation terminated!) |
21:39:35 | * | fredrik92 quit (Quit: Leaving.) |
21:43:58 | * | chemist69 quit (Ping timeout: 255 seconds) |
21:46:13 | * | Jesin quit (Quit: Leaving) |
21:46:56 | * | chemist69 joined #nim |
21:57:59 | * | Trustable quit (Remote host closed the connection) |
21:59:25 | * | csoriano quit (Quit: csoriano) |
22:00:30 | * | lenstr quit (Ping timeout: 244 seconds) |
22:01:46 | * | LeNsTR joined #nim |
22:07:31 | * | nairobi quit (Read error: Connection reset by peer) |
22:08:28 | * | nairobi joined #nim |
22:12:00 | * | pregress_ quit (Remote host closed the connection) |
22:21:23 | * | Jesin joined #nim |
22:23:13 | * | girvo joined #nim |
22:27:57 | * | girvo quit (Ping timeout: 276 seconds) |
22:28:50 | * | nairobi quit (Remote host closed the connection) |
22:49:57 | * | gokr quit (Ping timeout: 244 seconds) |
22:52:04 | * | allplayersdd joined #nim |
22:52:12 | allplayersdd | i dont like the syntax of nim, julia is better imo |
22:58:20 | * | krux02 joined #nim |
23:01:27 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:17:51 | ldlework | allplayersdd: good to know |
23:21:38 | * | bjz joined #nim |
23:22:23 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:28:04 | antranigv | i don't like apples, tomatos are yummier imho |
23:28:28 | PMunch | antranigv: good to know |
23:28:38 | antranigv | I really like Nim, very Wirthian, also Pythonic |
23:28:57 | antranigv | can I read about the history? |
23:29:08 | antranigv | I was not able to navigate in the website |
23:29:29 | antranigv | I mean, maybe I missed it, that's why I'm asking here :) |
23:30:30 | PMunch | Hmm, not sure if there is that much written history of Nim |
23:31:00 | PMunch | en.wikipedia.org/wiki/Nim_(programming_language) |
23:31:07 | PMunch | There's one line of history there |
23:32:15 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:33:39 | antranigv | hell the export marker from oberon is the best thing ever |
23:33:51 | antranigv | why do people do all that private/public stuff?? hehe |
23:39:26 | antranigv | I wish there never was any need for the keyword object |
23:39:38 | antranigv | in Oberon-2 you can have OOP without OOP-ish words :)) |
23:45:02 | * | PMunch quit (Quit: leaving) |
23:51:11 | * | chemist69 quit (Ping timeout: 250 seconds) |
23:51:28 | allplayersdd | antranigv, please explain the export marker from oberon |
23:51:43 | allplayersdd | and OOP in oberon |
23:54:16 | * | chemist69 joined #nim |