00:04:45 | * | Sentreen joined #nim |
00:11:07 | FromGitter | <nortiero> Hi! I am playing with Nim types... Given `type RefInt = ref int` it is possible to allocate *and* initialize a new RefInt ... something like var v = RefInt(42) ? |
00:14:46 | FromGitter | <Varriount> nortiero: I don't believe it can be done with a direct reference to a basic type like int |
00:15:23 | FromGitter | <Varriount> If you had a reference to an object, you could do `var m = RefFoo(memberOne: 1)` |
00:15:50 | FromGitter | <nortiero> yes, that's what i've been doing, but here .. the field is anonymous |
00:16:16 | FromGitter | <nortiero> i have to call new and then set with x[] = 42 |
00:16:28 | FromGitter | <Varriount> You could create a procedure. |
00:16:50 | FromGitter | <Varriount> It will likely be inlined by the compiler. Or you could add {.inline.} |
00:17:28 | FromGitter | <nortiero> of course! I was just playing with types. This kind of ref type reminds me of things seen in Rust, and I was just curious... Thank you! |
00:18:43 | FromGitter | <Varriount> Although, creating a reference to an integer isn't common. A sequence of integers or a reference to an array is much more common. |
00:19:21 | FromGitter | <nortiero> It has little use and a lot of overhead |
00:43:19 | * | krux02 joined #nim |
00:53:55 | FromGitter | <hcorion> Hi all. I'm using a rather large codegenDecl pragma multiple times in my code, would it be possible to declare a custom pragma, that basically functions as that pragma? |
00:56:09 | FromGitter | <Varriount> @hcorion Say hello to the somewhat odd "pragma pragma": https://nim-lang.org/docs/manual.html#pragmas-pragma-pragma |
00:56:52 | FromGitter | <hcorion> Awesome thanks! |
00:58:36 | zachcarter | man… |
00:58:50 | zachcarter | running my program as a service has to be easier than what I’m doing right now |
00:58:50 | FromGitter | <Varriount> zachcarter: ? |
00:58:59 | zachcarter | on digital ocean |
00:59:46 | zachcarter | I’m trying to do what’s suggested here : https://github.com/nim-lang/Nim/wiki/Tutorial:-Creating-a-(micro)-service |
01:00:10 | FromGitter | <hcorion> @Varriount Do you know how I can set the "pragma pragma" as public? |
01:00:13 | zachcarter | but the service just keeps crashing I’m guessing because I don’t have permissions correct |
01:00:44 | FromGitter | <Varriount> @hcorion You'll need to use a macro for that, I think. |
01:01:11 | FromGitter | <Varriount> hcorion: Do you want the quick and dirty solution, or something elegant? |
01:01:42 | FromGitter | <hcorion> elegant would be nice |
01:02:54 | FromGitter | <Varriount> Zion: If this is for procedures only, have a macro that is used as a pragma (https://nim-lang.org/docs/manual.html#macros-macros-as-pragmas). Have the macro modify the procedure's AST so that the desired pragmas are injected. |
01:03:34 | FromGitter | <Varriount> If this is a statement macro, I think you have to use a template to produce the entire pragma. |
01:04:16 | FromGitter | <hcorion> Yeah, it's variables, not procs |
01:05:23 | FromGitter | <Varriount> Zion: Then just create a template with a body that produces the macro |
01:05:59 | FromGitter | <Varriount> I don't know if you can use macros in statement pragma lists |
01:06:14 | FromGitter | <Varriount> Zion: Could I get an example? |
01:06:55 | FromGitter | <hcorion> https://gist.github.com/hcorion/be452250aeb46e02b1dd4ad5ae519d8d |
01:24:44 | FromGitter | <Varriount> @hcorion https://glot.io/snippets/ep952xc9xx |
01:26:04 | FromGitter | <Varriount> @hcorion The alternative is to create a single module with that pragma, and use `include` wherever you want the pragma declared. |
01:26:36 | FromGitter | <Varriount> You might want to see if a bug/feature request has been lodged for macros to work in statement/variable pragma lists |
01:32:04 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:32:32 | * | chemist69 quit (Disconnected by services) |
01:32:37 | * | chemist69_ joined #nim |
01:34:18 | * | htnjns joined #nim |
01:42:19 | * | ludocode quit (Ping timeout: 255 seconds) |
01:50:10 | * | vlad1777d quit (Quit: Leaving) |
01:53:05 | * | ludocode joined #nim |
01:56:06 | * | mwbrown quit (Quit: Exiting) |
02:35:19 | * | bjz joined #nim |
02:44:28 | * | sz0 quit (Quit: Connection closed for inactivity) |
02:46:57 | * | mwbrown joined #nim |
02:47:07 | * | brson quit (Quit: leaving) |
02:55:42 | * | krux02 quit (Remote host closed the connection) |
02:56:25 | * | yglukhov joined #nim |
03:00:32 | * | yglukhov quit (Ping timeout: 240 seconds) |
03:02:23 | * | mwbrown quit (Quit: Exiting) |
03:15:15 | * | mwbrown joined #nim |
03:16:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:25:52 | * | bjz joined #nim |
03:32:13 | * | zachcarter quit (Quit: zachcarter) |
03:46:19 | * | mwbrown quit (Quit: Exiting) |
03:57:30 | * | mwbrown joined #nim |
04:02:29 | * | mwbrown quit (Ping timeout: 260 seconds) |
04:06:28 | shashlick | how do you pass an array by reference? |
04:08:00 | * | mwbrown joined #nim |
04:18:36 | * | mwbrown quit (Ping timeout: 260 seconds) |
04:33:00 | * | mwbrown joined #nim |
04:37:51 | * | mwbrown quit (Ping timeout: 260 seconds) |
04:41:29 | * | mwbrown joined #nim |
04:50:05 | * | BennyElg quit (Remote host closed the connection) |
04:54:48 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:00:48 | * | bjz joined #nim |
05:16:35 | * | gokr joined #nim |
05:44:01 | FromGitter | <Varriount> shashlick: Why? |
05:44:47 | FromGitter | <Varriount> If you're concerned about optimization, Nim already automatically passes data types above a certain size by pointer. |
05:54:51 | * | rokups joined #nim |
05:55:32 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:26:12 | * | Vladar joined #nim |
06:44:42 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:47:36 | * | bjz joined #nim |
06:50:53 | * | nsf joined #nim |
06:59:33 | * | yglukhov joined #nim |
07:00:53 | * | Arrrr joined #nim |
07:00:53 | * | Arrrr quit (Changing host) |
07:00:53 | * | Arrrr joined #nim |
07:08:05 | * | sz0 joined #nim |
07:19:04 | * | BennyElg joined #nim |
07:23:25 | * | BennyElg quit (Ping timeout: 255 seconds) |
07:28:16 | * | BennyElg joined #nim |
07:30:32 | * | Sembei quit (Ping timeout: 240 seconds) |
07:37:36 | * | Sembei joined #nim |
07:38:07 | * | vendethiel- joined #nim |
07:39:34 | * | chemist69_ quit (Quit: WeeChat 1.7) |
07:40:48 | * | antranig1 joined #nim |
07:41:11 | * | chemist69 joined #nim |
07:41:32 | * | libman quit (Quit: Connection closed for inactivity) |
07:41:32 | * | antranigv quit (Remote host closed the connection) |
07:42:31 | * | Sembei quit (Ping timeout: 240 seconds) |
07:44:13 | chemist69 | shashlick: you can pass the array as var parameter: `proc myproc(myarr: var MyArray) = ...` |
07:44:31 | chemist69 | then it is modifiable by the called function |
07:46:16 | * | vendethiel quit (Ping timeout: 260 seconds) |
08:01:44 | * | Jesin quit (Ping timeout: 258 seconds) |
08:02:02 | * | antranig1 is now known as antranigv |
08:18:21 | * | nightmared quit (Ping timeout: 260 seconds) |
08:19:59 | * | couven92 joined #nim |
08:44:57 | Arrrr | Why is not possible to index arrays using ordinals? I guess this is a bug, an old one https://glot.io/snippets/ep9h79x3b1 |
08:45:32 | Arrrr | Same result with let |
08:48:28 | Araq | try to annotate your const with an explicit array type |
08:50:31 | Arrrr | Yeah it works https://glot.io/snippets/ep9hczlxyd but it is more work than simple `NUMS[ord(dir)]` |
08:55:52 | FromGitter | <stisa> Arrrr doesn't ``echo NUMS[ord UP]`` work? Or am I misunderstanding what you want to do? |
08:57:59 | * | Vladar quit (Quit: Leaving) |
09:00:49 | Arrrr | Yes, but it should work without ord. From the snippet, nim should implicit understand the const is of type array[enum, int], not array[int, int]. I don't have any problems with adding ord, but it looks unnecessary to me. |
09:07:53 | Araq | Arrrr: yeah, the type inference is wrong here |
09:11:36 | * | Vladar joined #nim |
09:13:23 | * | McSoFake joined #nim |
09:23:48 | * | zachcarter joined #nim |
09:25:06 | zachcarter | ugh up way too early |
09:25:47 | couven92 | zachcarter, really? it's already 11:25 at my end! :P |
09:25:58 | zachcarter | oh man! |
09:26:02 | zachcarter | only 5:25 am here! |
09:26:23 | couven92 | That IS early! My condolences! |
09:26:46 | zachcarter | I blame the dogs! |
09:26:58 | zachcarter | but thank you |
09:27:18 | zachcarter | I guess now I have more time to work on this service / digital ocean crap I’ve been struggling to figure out |
09:27:37 | zachcarter | dom96: I found out last night jsonp doesn’t support POST requests so it’s a nogo |
09:27:57 | Araq | what is 'jsonp'? |
09:28:17 | couven92 | well I am successfully putting of my upcoming battle with JavaScript... Ugh! :P |
09:28:27 | flyx | JSON which is fetched as body of a <script src=""> tag |
09:28:48 | flyx | one of the ugliest things web devs have ever done |
09:29:03 | zachcarter | avoids x domain requests though |
09:29:09 | zachcarter | which is why I guess dom was suggesting it |
09:29:12 | flyx | yes |
09:29:22 | * | Tiberium joined #nim |
09:29:27 | couven92 | flyx, how does that work? Do you assign an id to the tag and then through JavaScript set it's contents? |
09:29:28 | zachcarter | I’ll have to just fight with CORS |
09:29:41 | zachcarter | you createa script tag dynamically |
09:29:47 | flyx | it doesn't avoid x domain requests, it's just that the standard says that x domain requests from <script> tags are allowed |
09:29:48 | zachcarter | at runtime |
09:29:58 | zachcarter | yeah what flyx said :P |
09:30:58 | couven92 | dynamically add script tags... Isn't that what we call self generating code? :O |
09:31:34 | zachcarter | I mean I guess you could alter the contents of an existing scirpt tag |
09:31:36 | zachcarter | script tag |
09:31:37 | zachcarter | and execute it |
09:32:02 | couven92 | like so many things in JS, this does not sound like a good idea! :P |
09:32:07 | zachcarter | if you google jsonp javascript you’ll find examples of people doing it |
09:32:15 | zachcarter | JS is a horror show |
09:34:12 | euantor | Why do you need cross-domain AJAX requests anyway? |
09:34:29 | euantor | Whenever I've had that issue I've found better ways around it |
09:35:13 | zachcarter | in case someone wants to hit the API from another domain |
09:36:02 | euantor | Hm. Yes, that could be a problem |
09:36:14 | zachcarter | yeah :/ |
09:36:22 | zachcarter | this is for the nim playground thing euantor |
09:36:41 | euantor | Yeah, I guessed that. Does it have to be a POST request? |
09:37:13 | zachcarter | I think it makes sense for it to be one |
09:37:45 | zachcarter | I could do ugly query parameter stufff with a GET request but... |
09:37:47 | euantor | Yeah, I guess CORS is the only option then realistically |
09:38:22 | euantor | Easiest hackiest approach is `Access-Control-Allow-Origin: *` and `Access-Control-Allow-Methods: POST` |
09:38:37 | zachcarter | ah I was missing the latter part of that, thank you |
09:38:38 | * | GustavoLapasta joined #nim |
09:39:05 | euantor | I think there are some other headers about max age and stuff too, but I can't remember what they do |
09:39:27 | zachcarter | this should get me going |
09:39:40 | zachcarter | right now I’m fighting getting the service to run as a daemon without crashing instantly upon receiving a post request |
09:39:51 | euantor | Using systemd? |
09:39:53 | zachcarter | yup |
09:40:01 | euantor | WHat's the crash log look like? |
09:40:19 | zachcarter | https://gist.github.com/zacharycarter/0f53ea961ea211e485abef3f20da813e |
09:40:24 | zachcarter | I’m guessing it’s due to file system isssues |
09:40:32 | zachcarter | because the process creates a tmp directory |
09:40:44 | zachcarter | reads from another directory and writes to the tmp directory |
09:40:53 | euantor | Possibly |
09:41:15 | euantor | Should be fun to track down |
09:41:30 | zachcarter | yeah :/ I’ve never really messed with systemd before so this is painful for me |
09:41:47 | zachcarter | I wish services on nix were as easy as they were on windows |
09:42:00 | zachcarter | or rather I wish I understood as much about them as I do about services on windows |
09:42:19 | euantor | What have you got set up as the After and Requires? |
09:42:32 | zachcarter | After=network.target httpd.service squid.service nfs-server.service mysqld.service named.service postfix.service |
09:42:33 | zachcarter | Wants=network-online.target |
09:43:01 | euantor | that looks right to me. /tmp/ should be alive by that point I would think |
09:43:18 | zachcarter | it’s actually tring to write to ./tmp |
09:43:33 | zachcarter | so wherever the process is running from |
09:43:47 | euantor | The stack trace points to the line `await sleepAsync(500)` |
09:43:51 | euantor | Ah |
09:44:01 | zachcarter | yeah I figured it’s because the async method is failing |
09:44:23 | euantor | I wonder if you need to set the working directory |
09:44:31 | zachcarter | I tried that too :/ |
09:44:35 | euantor | Because by default the current working directory will probably be / |
09:45:15 | zachcarter | of course everything works fine if I run the service locally |
09:45:17 | zachcarter | oh I know what to try! |
09:45:25 | zachcarter | sorry I meant the binary |
09:45:30 | zachcarter | run the binary as that user let me give that a shot |
09:45:53 | euantor | Yeah, that's worth a shot |
09:49:39 | FromGitter | <Varriount> zachcarter: Do we want people to hot this from another API? Doesn't seem like something that should be done for an interactive playground. |
09:50:11 | zachcarter | hrm I think dom96 was mentioning he wanted to potentially use this for other things |
09:50:16 | euantor | It might be handy to have a "Run this code" option in the docs |
09:50:19 | zachcarter | I guess he could set up and deploy another instance of the project for that |
09:50:21 | euantor | Like Go has |
09:50:45 | zachcarter | we could probably just get pretty restrictive with what domains we allow post requests from |
09:50:54 | zachcarter | or if everything is on nim-lang.org |
09:50:57 | zachcarter | we don’t have to worry about it |
09:51:09 | euantor | Something like https://tour.dlang.org/ would be cool too |
09:51:20 | euantor | (see the "Run" button in the top right) |
09:51:28 | zachcarter | that would be neat |
09:51:38 | euantor | Yeah, you could restrict to *.nim-lang.org |
09:52:19 | zachcarter | that could work |
09:52:56 | euantor | IIRC you can comma separate domains so `*.nim-lang.org,nim-lang.org` would cover everything probably |
09:53:09 | euantor | And it would be super cool to be able to run code inside forum threads too |
09:53:18 | zachcarter | yeah it would! |
09:53:20 | zachcarter | or from irc |
09:53:28 | zachcarter | and gitter |
09:53:46 | FromGitter | <Varriount> If we had the money, I would use AWS autoscaling and/or lambda |
09:53:52 | euantor | Yeah, so plenty of use cases |
09:54:20 | euantor | I think DigitalOcean has donated some funds to run servers which is what hosts the forum and site at the minute |
09:54:30 | FromGitter | <Varriount> Or better yet, have the compiler compile and run the code virtually, within the user's browser |
09:54:32 | * | chemist69 quit (Ping timeout: 255 seconds) |
09:55:08 | Tiberium | Varriount: nim-sandbox does that |
09:55:29 | Tiberium | https://github.com/jscheid/nim-sandbox it works with latest nim devel, but it's configured without any modules except "system" |
09:55:30 | FromGitter | <Varriount> euantor: Yes, but such charity costs then little. It's not like Nim's website is a highly dynamic webapp |
09:55:52 | Tiberium | basically it's compiler compiled via emscripten |
09:55:59 | Tiberium | and then compiler emits JS code in browser |
09:56:08 | euantor | True, but it should be enough to run the playground I would think |
09:56:25 | * | PMunch joined #nim |
09:57:55 | FromGitter | <Varriount> For the forum and documentation, caching might help. |
09:58:22 | euantor | yeah, would be a good idea |
09:58:26 | FromGitter | <Varriount> Since compiler input, as a whole, produces the same output after repeated rubs |
09:58:31 | FromGitter | <Varriount> *runs |
09:58:55 | * | chemist69 joined #nim |
09:59:02 | euantor | caching would have to be inside the playground code, but shouldn't be overly difficult |
09:59:17 | zachcarter | yeah I can add caching |
09:59:24 | Tiberium | yeah, because I think 90% of playground requests would be the same from "samples" |
09:59:32 | Tiberium | (I mean there should be samples in nim playground) |
09:59:50 | * | adeohluwa joined #nim |
10:01:48 | euantor | zachcarter: How well does the playground handle concurrent requests? Looking at it, wouldn't `./tmp/in.nim` get overwritten by a second request if the first request was running? |
10:02:13 | zachcarter | yeah I’m going to have to create GUIDs for each request |
10:02:46 | zachcarter | I’m working on some modifications to it right now |
10:03:00 | euantor | I wonder if it might be a nice addition to the stdlib to add something like https://github.com/rust-lang-nursery/tempdir |
10:04:06 | euantor | with a template like `withTempDir(prefix="nim_playground")` |
10:04:30 | euantor | I might have a go at writing that actually |
10:04:42 | Tiberium | seems like very professional benchmarks: https://github.com/rust-lang-nursery/rustc-benchmarks/blob/master/compare.py |
10:04:47 | Tiberium | using python's time.time() |
10:04:55 | Tiberium | even python's own benchmarks doesn't use it |
10:05:37 | euantor | ¯\_(ツ)_/¯ |
10:09:35 | FromGitter | <Varriount> I might try something like this with lambda |
10:12:28 | * | vlad1777d joined #nim |
10:17:34 | euantor | Has anybody else found that libraries.io is supporting Nimble now: https://libraries.io/nimble/sysrandom |
10:18:34 | * | GustavoLapasta quit (Ping timeout: 268 seconds) |
10:19:12 | Tiberium | euantor, I think it was doing it a long time ago |
10:19:26 | euantor | I'd never heard of it before, it's pretty cool |
10:29:25 | * | CcxWrk quit (Ping timeout: 260 seconds) |
10:33:42 | * | CcxWrk joined #nim |
10:53:24 | * | nightmared joined #nim |
11:02:42 | * | Snircle joined #nim |
11:04:25 | * | Tiberium quit (Remote host closed the connection) |
11:04:46 | * | Tiberium joined #nim |
11:05:08 | Araq | how can I get emscripten to work on OSX? |
11:05:59 | Araq | I have python 2.7.7 and yet it fails with |
11:06:03 | Araq | File "/usr/local/Cellar/emscripten/1.37.1/libexec/tools/toolchain_profiler.py", line 3 |
11:06:03 | Araq | EM_PROFILE_TOOLCHAIN = int(os.getenv('EM_PROFILE_TOOLCHAIN')) if os.getenv('EM_PROFILE_TOOLCHAIN') != None else 0 |
11:06:03 | Araq | ^ |
11:06:05 | Araq | SyntaxError: invalid syntax |
11:06:16 | * | Tiberium quit (Remote host closed the connection) |
11:08:13 | * | Tiberium joined #nim |
11:09:49 | * | Tiberium quit (Remote host closed the connection) |
11:12:11 | * | Tiberium_ joined #nim |
11:12:11 | * | Tiberium joined #nim |
11:12:14 | * | Tiberium__ joined #nim |
11:12:47 | FromGitter | <Varriount> Araq: How are you invoking emscripten? |
11:12:47 | * | Tiberium quit (Remote host closed the connection) |
11:12:47 | * | Tiberium_ quit (Remote host closed the connection) |
11:12:48 | * | Tiberium__ quit (Remote host closed the connection) |
11:13:56 | Araq | cc = clang |
11:13:56 | Araq | clang.exe = "emcc" |
11:13:56 | Araq | clang.linkerexe = "emcc" |
11:13:57 | Araq | clang.options.linker = "" |
11:13:59 | Araq | cpu = "i386" |
11:14:02 | Araq | passC = "-s WASM=1 -s 'BINARYEN_METHOD=\"native-wasm\"' -Iemscripten" |
11:14:03 | Araq | passL = "-s WASM=1 -Lemscripten -s TOTAL_MEMORY=335544320" |
11:14:24 | Araq | but regardless of how I invoke it, it shouldn't fail with a Python syntax error... |
11:15:11 | euantor | Hm. When I try to build documentation for some code using `getTempDir` from the `os` module I get `ambiguous call; both ospaths.getTempDir() and os.getTempDir() match for: ()` |
11:15:23 | euantor | Prefixing `getTempDir` as `os.getTempDir()` doesn't help |
11:16:30 | * | Tiberium joined #nim |
11:17:16 | Araq | euantor: don't import os and ospaths |
11:17:22 | euantor | I don't |
11:17:54 | euantor | https://www.irccloud.com/pastebin/zQe26kIO/ |
11:18:00 | euantor | That's all of my imports |
11:18:27 | euantor | https://www.irccloud.com/pastebin/xw1VpZOv/ |
11:18:45 | euantor | I'd assume it's because I'm running it as a nimble task |
11:18:59 | FromGitter | <stisa> Araq I think you need to run a bat file that sets up some env variables, I don't remember the name though, `emsdk<something>` I think? |
11:19:06 | euantor | Nope, happens if I run the command on its own |
11:19:31 | FromGitter | <Varriount> Araq: I get "zipfile.BadZipfile: Truncated file header" |
11:19:38 | Araq | my emcc "binary" contains this |
11:19:42 | Araq | #!/usr/bin/env python |
11:19:42 | Araq | # This script should work in python 2 *or* 3. It loads emcc.py, which needs python 2. |
11:19:58 | Araq | and /usr/bin/env python gives me python 2.7.7 |
11:20:25 | Araq | so why would it produce a SyntaxError? if expressions in Python are surely in 2.7.7 |
11:21:06 | FromGitter | <Varriount> Araq: Worked on the second try for me. :/ |
11:21:36 | FromGitter | <Varriount> Araq: I suspect it's somehow using the system version of python, which I believe is 2.7 |
11:21:41 | FromGitter | <Varriount> er, 2.6 |
11:31:48 | euantor | Interestingly, `nim doc` works, but not `nim doc2` |
11:32:47 | FromGitter | <Varriount> Araq: Is your python installed from brew? |
11:52:43 | Araq | it used to be but I switched to pyenv |
11:54:43 | Araq | but now I noticed it's VS's terminal, it didn't pick up my other python |
11:54:51 | Araq | so ... now the error is: |
11:55:17 | Araq | WARNING:root:LLVM version appears incorrect (seeing "7.0", expected "3.9") |
11:55:17 | Araq | CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports: |
11:56:52 | zachcarter | http://162.243.192.65/ |
12:01:38 | FromGitter | <stisa> zachcarter: `failed to load resoure` |
12:03:13 | zachcarter | damn |
12:03:50 | FromGitter | <stisa> it's trying to load from `http://162.243.192.65/node_modules/spectre.css/docs/dist/spectre.min.css` |
12:08:49 | zachcarter | should be working now |
12:09:20 | zachcarter | ugh nevermind |
12:09:22 | zachcarter | need to fix one more thing |
12:10:24 | zachcarter | yay works now I think |
12:10:28 | zachcarter | stisa: mind verifying? |
12:10:45 | FromGitter | <stisa> POST http://localhost:5000/compile net::ERR_CONNECTION_REFUSED at app.js:1892 |
12:11:15 | FromGitter | <stisa> nevermind, works now |
12:11:18 | zachcarter | sweet :D |
12:11:22 | Tiberium | works for me |
12:11:27 | Tiberium | ehm |
12:11:31 | Tiberium | "missing semicolon" ? |
12:11:40 | zachcarter | oh |
12:11:41 | FromGitter | <stisa> Nice! But damn, almost 500kb for Ace |
12:11:41 | zachcarter | well |
12:11:50 | zachcarter | ace has no nim language extension |
12:11:50 | Tiberium | mmm, *dreaming about integrating nimsuggest into this playground thing* |
12:12:12 | zachcarter | I’m not sure there is currently a js editor out there with a nim language extension |
12:13:16 | FromGitter | <stisa> codemirror with this : https://github.com/zah/nim.lt/blob/master/codemirror/nimrod.js but I think it's GPL3 |
12:13:37 | Tiberium | also maybe in the future you could somehow not just send compile log to browser when compilation ends, but stream it? |
12:13:43 | Tiberium | or make some progress bar |
12:13:46 | FromGitter | <BontaVlad> @ace size, it's not minified, the size could be lowered |
12:13:56 | zachcarter | that will be difficult Tiberium |
12:14:06 | Tiberium | zachcarter, then just some spinning circle :) |
12:14:13 | zachcarter | I can do that |
12:14:14 | Tiberium | at least that we know that request have been sent |
12:14:20 | zachcarter | I have a lot of things to add |
12:15:28 | FromGitter | <BontaVlad> zachcarter, do you have a public repo for the code? |
12:15:34 | zachcarter | I do |
12:15:44 | FromGitter | <BontaVlad> care to share the url? :) |
12:15:50 | FromGitter | <stisa> zachcarter : why are compiler log and program result `<textarea>` ? I'm not good at web dev, but I think a <pre> block is enough? |
12:16:03 | zachcarter | https://github.com/zacharycarter/nim-playground & https://github.com/zacharycarter/nim-playground-frontend |
12:16:12 | Sentreen | Is there an easy way to pas a pointer to a var as a var argument? So if I have `proc foo(bar: var Type)`, can I pass a `ptr Type` to it somehow? |
12:16:17 | FromGitter | <BontaVlad> many thanks |
12:16:20 | zachcarter | np! |
12:16:28 | zachcarter | stisa: hrm potentially? I’m not sure |
12:16:32 | * | krux02 joined #nim |
12:16:39 | Araq | Sentreen: deref it, foo(x[]) |
12:16:49 | zachcarter | I wanted them to be resizable so I went with textarea |
12:18:17 | zachcarter | https://ace.c9.io/tool/mode_creator.html |
12:18:17 | Sentreen | Can't believe I didn't think of that. |
12:18:22 | zachcarter | looks like we can create a nim mode |
12:18:52 | FromGitter | <stisa> zachcarter oh alright then, Edge doesn't show the resize corner thing ( handler? ) , but chrome does |
12:18:53 | Sentreen | Will the compiler be smart enough to pass the original pointer as the "hidden" var pointer? |
12:19:36 | zachcarter | stisa: might be an issue with spectre css not sure |
12:20:55 | zachcarter | I have no idea how to even start writing a nim mode for ace |
12:21:38 | zachcarter | I took a look at the python mode and it’s quite complex |
12:23:10 | Araq | Sentreen: yeah but even if not, &*x is optimized away by every C compiler and the standard mandates it even. C's preprocessor wouldn't work as well otherwise |
12:23:41 | Sentreen | Okay, thanks again :) |
12:25:25 | Araq | ok, i give up, back to windows |
12:26:00 | FromGitter | <Varriount> Araq: Don't feel too bad. I got the webpage to load in Chrome, but the web console kept giving me a buffer error |
12:27:36 | FromGitter | <Varriount> Araq: Quick question - what effect does 'closureScope' have on backend code? |
12:28:06 | FromGitter | <Varriount> The template appears to create a single-use closure procedure , which seems rather inefficient. |
12:35:49 | Araq | yeah, don't use it for performance |
12:39:03 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
12:39:10 | FromGitter | <Varriount> Araq: What would it take for a more efficient technique? |
12:39:33 | Araq | dunno. escape analysis and closure removal? |
12:40:13 | FromGitter | <Varriount> I mean, is closureScope something that could be done directly by the compiler, rather than through a template? |
12:41:51 | Araq | the compiler used to do it, it was a pita |
12:42:52 | FromGitter | <Varriount> zachcarter: If you want, feel free to use the tmLanguage file from NimLime |
12:43:03 | zachcarter | thank you |
12:43:16 | zachcarter | I’ll most likely take you up on that |
12:43:28 | * | aedigix quit (Remote host closed the connection) |
12:43:33 | FromGitter | <Varriount> It's not perfect, but I think it does an adequate job. |
12:43:52 | * | aedigix joined #nim |
12:50:16 | couven92 | Uhm... trying to compile nim on my android... I managed to compile from csources, but now koch is struggling to boot nim. I follow https://github.com/nim-lang/Nim/pull/5646 I get an error from gcc: `nimcache/r_linux_arm/stdlib_os.c:1824:18: error: no member named 'st_mtim' in 'struct stat'` |
12:53:23 | * | zachcarter quit (Quit: zachcarter) |
12:57:15 | Tiberium | couven92, yes |
12:57:21 | Tiberium | you need some workarounds |
12:57:27 | Tiberium | I'll post a link |
12:57:53 | Tiberium | https://github.com/nim-lang/Nim/pull/5646#issuecomment-290931873 |
12:58:10 | Tiberium | starting from "my steps" |
12:58:31 | Tiberium | also for nimble you want to patch getTempDir() |
12:58:46 | Tiberium | to return "/data/data/com.termux/files/tmp" instead of "/tmp/" |
13:00:39 | * | TheLemonMan joined #nim |
13:07:01 | couven92 | ok, I got it to work now... Nim is surprisingly fast on my 3 years old HTC One m8!! :D |
13:12:24 | * | McSoFake quit (Ping timeout: 240 seconds) |
13:15:05 | * | bjz_ joined #nim |
13:16:29 | * | bjz quit (Ping timeout: 260 seconds) |
13:36:42 | * | zachcarter joined #nim |
13:43:55 | couven92 | Uhm... with Nim I just compiled karax and ran it on my Android! Weeeee! :D |
13:44:17 | * | vivus joined #nim |
13:44:41 | FromGitter | <Varriount> couven92: You ran the compiler on your phone? |
13:44:46 | couven92 | yup |
13:45:06 | FromGitter | <Varriount> O_o |
13:45:43 | couven92 | Works beautifully, but I haven't gotten round to compiling nimble yet... Have go to lunch now first :) |
13:46:02 | Tiberium | Varriount: see https://github.com/nim-lang/Nim/pull/5646#issuecomment-290931873 |
13:46:03 | FromGitter | <Varriount> Note to self: couven92 is dangerous |
13:46:09 | Tiberium | I did it three days ago |
13:46:14 | Tiberium | stisa did it even earlier |
13:47:09 | Tiberium | couven92, just patch lib/pure/ospaths.nim - replace "/tmp/" with "/data/data/com.termux/files/tmp/" |
13:47:22 | Tiberium | and nimble should compile now |
13:47:27 | Tiberium | (and run) |
13:47:31 | FromGitter | <Varriount> Why would you all ever want to run the compiler on a smartphone? |
13:47:49 | Tiberium | because why not? |
13:48:05 | Tiberium | for example, I can run my app on a phone |
13:48:07 | Tiberium | isn't it good? |
13:48:10 | Tiberium | (it's console app) |
13:48:20 | vivus | Does Nim support linux environment variables? |
13:48:25 | Tiberium | yes |
13:48:30 | Tiberium | AFAIK |
13:48:58 | Tiberium | vivus, https://nim-lang.org/docs/os.html#getEnv,string probably |
13:51:47 | FromGitter | <couven92> Well, PMunch and I were pretty impressed that it worked. |
13:52:36 | Tiberium | I think we can even contribute it to termux-packages |
13:52:49 | Tiberium | so new users would just type "apt install nim" |
13:52:54 | Tiberium | ah no |
13:52:54 | FromGitter | <couven92> I'm considering to write up a PR for niminst that adds the necessary changes to build.sh to bootstrap nim |
13:53:32 | vivus | if you're writing something to install nim, it should be 10x easier than what is currently available |
13:53:59 | vivus | Tiberium: a PPA for nim and nimble might be really nice |
13:54:07 | Tiberium | vivus, there's no PPA in termux |
13:54:12 | Tiberium | or I'm mistaken |
13:54:34 | Tiberium | ah yes, we can create custom PPA for termux only |
13:54:36 | FromGitter | <couven92> Because all in all there weren't many changes I had to do. Most of the time went to typing on the touch keyboard of my phone |
13:54:43 | Tiberium | yeah |
13:54:58 | Tiberium | you can also use adb if you have root (to launch termux shell) |
13:55:02 | Tiberium | from computer via usb |
13:55:26 | FromGitter | <couven92> Yeah I know |
13:55:35 | Tiberium | I think we can create a simple .sh script for now :) |
13:56:43 | vivus | well at least 0.16.0 has remained stable . is there a release-schedule? |
13:56:56 | FromGitter | <couven92> No, I'll change niminst build.sh then we're good to go |
13:57:24 | Tiberium | couven92: but we also need to change nim files |
13:57:27 | Tiberium | will build.sh handle this? |
13:59:35 | FromGitter | <couven92> Yes, and another PR to enable Android support in two places in the nim source |
13:59:45 | FromGitter | <couven92> That's it |
14:02:47 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
14:04:36 | Tiberium | couven92: I also thought about that, but later I realized that termux isn't a big platform, so I thought that PR would not be accepted :) |
14:07:06 | * | devted joined #nim |
14:12:36 | * | couven92 quit (Quit: Client disconnecting) |
14:17:05 | * | chemist69 quit (Ping timeout: 260 seconds) |
14:20:54 | * | chemist69 joined #nim |
14:23:29 | Tiberium | by the way, what style is preferred? "var a = 1; var b= 2" or one "var" block like "var\n a=1\nb=2" ? |
14:24:45 | PMunch | Tiberium, I prefer, and I think it's more ideomatic, to put it in one block. |
14:25:31 | Tiberium | and also, can I contribute some small changes to base64 (putting variables into one "var" or "let" block, and changing "var" to "let" where variables aren't changing)? |
14:25:39 | PMunch | But I have split stuff into two blocks when they are related to each other. So if I'm using two frameworks and need to set some variables for one, and some for another then I might split those up into two different blocks. |
14:26:01 | Tiberium | because my changes are small |
14:26:15 | PMunch | Tiberium, I don't see why not. Worst case scenario they don't get pulled :P |
14:26:39 | * | BennyElg quit (Remote host closed the connection) |
14:27:05 | * | BennyElg joined #nim |
14:30:01 | * | couven92 joined #nim |
14:30:14 | Tiberium | PMunch, https://github.com/nim-lang/Nim/pull/5755/commits/5ee75a66aca0205bb2ab72704473a94cd41e575a |
14:31:36 | * | BennyElg quit (Ping timeout: 260 seconds) |
14:32:47 | PMunch | 79 var -> let? |
14:33:05 | PMunch | Same for 89 |
14:33:10 | PMunch | lines that is |
14:33:15 | Tiberium | PMunch, oh :) |
14:33:49 | PMunch | But otherwise it looks gode |
14:33:52 | PMunch | good* |
14:34:21 | PMunch | But you removed the {.immediate.} pragma on line 47, was that on purpose? |
14:34:44 | Tiberium | oh sorry |
14:36:04 | Tiberium | PMunch, that's why I tried to remove immediate: "base64.nim(47, 75) Warning: use 'untyped' parameters instead; immediate is deprecated" |
14:36:18 | PMunch | Ah right |
14:36:28 | PMunch | I didn't know what it was, just saw that you removed it :P |
14:36:42 | PMunch | But then it's fine |
14:36:59 | Tiberium | let's wait for tests :D |
14:37:56 | Tiberium | (sorry I will not spam commits like that in future) |
14:40:03 | Tiberium | oh I think we gonna have long time with tests |
14:41:02 | * | PMunch quit (Quit: leaving) |
14:49:44 | * | BennyElg joined #nim |
14:59:14 | * | jivank[m] quit (K-Lined) |
14:59:15 | * | ehmry[m] quit (K-Lined) |
14:59:15 | * | stisa quit (K-Lined) |
14:59:16 | * | Jipok[m] quit (K-Lined) |
14:59:16 | * | hohlerde quit (K-Lined) |
14:59:17 | * | erwana[m] quit (K-Lined) |
14:59:17 | * | TheManiac quit (K-Lined) |
14:59:17 | * | M-Quora quit (K-Lined) |
14:59:17 | * | mindB quit (K-Lined) |
14:59:17 | * | Guest73656[m] quit (K-Lined) |
14:59:17 | * | MrAxilus[m] quit (K-Lined) |
14:59:18 | * | dyce[m] quit (K-Lined) |
15:01:36 | * | BennyElg quit (Remote host closed the connection) |
15:05:03 | * | samuell joined #nim |
15:06:06 | * | PMunch joined #nim |
15:10:53 | * | dyce[m] joined #nim |
15:16:08 | zachcarter | alright all requests to the nim playground should now get their own tmp directory |
15:16:09 | * | MrAxilus[m] joined #nim |
15:16:09 | * | M-Quora joined #nim |
15:16:09 | * | mindB joined #nim |
15:16:10 | * | ehmry[m] joined #nim |
15:16:15 | * | stisa joined #nim |
15:16:15 | zachcarter | still have to add reqest caching |
15:16:15 | * | Guest73656[m] joined #nim |
15:16:15 | * | TheManiac joined #nim |
15:16:16 | * | jivank[m] joined #nim |
15:16:16 | * | hohlerde joined #nim |
15:16:16 | * | erwana[m] joined #nim |
15:16:17 | * | Jipok[m] joined #nim |
15:16:57 | zachcarter | I may have just broken things too |
15:19:31 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
15:22:59 | * | gokr quit (Quit: Leaving.) |
15:24:28 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:28:50 | * | couven92 quit (Ping timeout: 240 seconds) |
15:29:19 | * | couven92 joined #nim |
15:31:55 | * | Trustable joined #nim |
15:33:41 | * | rauss joined #nim |
15:34:07 | * | nsf quit (Quit: WeeChat 1.7) |
15:35:55 | Tiberium | zachcarter, 502 again :) |
15:36:08 | zachcarter | yeah :/ working on the server again |
15:36:27 | Tiberium | zachcarter, also it gives "XMLHttpRequest cannot load http://162.243.192.65:3000/compile. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://162.243.192.65' is therefore not allowed access. The response had HTTP status code 502." |
15:36:47 | zachcarter | I don’t even think the service is running atm |
15:37:40 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:38:11 | vivus | when it is said "nim compiles to C" does it actually mean nim is being transpiled to C code and then compiled? |
15:39:10 | Tiberium | vivus, don't use word "transpile" please |
15:39:42 | vivus | Tiberium: that is why I am asking what is actually happening |
15:40:52 | Tiberium | vivus, it compiles to C and then C compiler compiles C code :) |
15:41:13 | Tiberium | if Nim would be something very similar to C, it would be possible to say "transpiles to C" |
15:41:18 | Tiberium | but Nim is very different |
15:41:43 | Tiberium | https://www.typescriptlang.org/ even typescript "compiles" |
15:41:48 | Tiberium | to JS |
15:42:19 | zachcarter | Tiberium: should be working again |
15:42:26 | vivus | thanks for clearing that up. I believe I can also compile to LLVM? |
15:42:38 | Tiberium | zachcarter, yep |
15:42:50 | zachcarter | sweet! |
15:42:51 | Tiberium | vivus, afaik not really, but someone is working on it |
15:43:45 | FromGitter | <stisa> vivus https://github.com/arnetheduck/nlvm if you are interested, that's the llvm backend |
15:43:57 | * | Jesin joined #nim |
15:44:13 | vivus | what advantages would compiling direct to LLVM have over compiling to C? |
15:45:27 | Tiberium | wat |
15:45:28 | Tiberium | https://github.com/arnetheduck/j2c |
15:45:43 | Tiberium | ah, java |
15:45:45 | Tiberium | I thought JS :D |
15:46:19 | dom96 | Actually for typescript I would say that "transpiling" is the correct term |
15:46:37 | Tiberium | yep |
15:46:43 | Tiberium | because it understands JS syntax fully |
15:46:47 | Tiberium | and it's built on top of it |
15:46:57 | dom96 | Take a look at the wikipedia page for "transpiler" |
15:47:24 | Tiberium | so nim compiler is transpiler? |
15:47:33 | Tiberium | ah sorry :) |
15:47:40 | Tiberium | while a traditional compiler translates from a higher level programming language to a lower level programming language |
15:48:05 | dom96 | indeed |
15:48:16 | dom96 | JS and Typescript are both the same level of abstraction |
15:48:26 | dom96 | Well, I guess you could say that they aren't |
15:48:48 | Araq | "transpiling" is still a pointless word |
15:48:48 | dom96 | *are both at |
15:49:22 | Araq | it's called "translator" or "compiler" or "assembler", there is no need for a "transcompiler", that's just bullshit |
15:49:44 | Tiberium | Araq, I think this word became popular from JS world? |
15:51:05 | Tiberium | Also, when someone say "Nim git repository has almost 1 thousand issues!", point him to https://github.com/Microsoft/TypeScript/issues :D |
15:51:41 | Araq | most of the classical optimizations on a decent IR could be performed by TypeScript targetting JS. |
15:52:17 | Araq | most of the high level vs low level distinctions are expressible in any programming language |
15:53:04 | Araq | loop invariant code motion, common subexpression elimination, loop hoisting etc etc can be done by a C to C "transpiler". |
15:54:29 | vivus | what advantages would compiling direct to LLVM have over compiling to C? |
15:54:57 | Araq | the only real difference is that most programming languages (including C) are really bad backend target languages |
15:56:35 | Araq | vivus: there is no consensus. arguably, for Nim: better debugging support, faster exception handling and a possibly faster GC |
15:57:29 | vivus | which would give those options? LLVM or C? |
15:57:37 | Tiberium | I think LLVM |
15:59:13 | subsetpark | Does the stdlib have a proc for making DNS requests? |
16:01:45 | dom96 | subsetpark: very low level, but getAddrInfo exists |
16:01:57 | dom96 | PRs to add a higher-level version to the next module are welcome |
16:02:04 | dom96 | *net module |
16:02:29 | dom96 | zachcarter: how's the site going? |
16:02:59 | subsetpark | dom96: Cool, sounds like a nice target |
16:10:00 | * | gokr joined #nim |
16:10:10 | couven92 | exit |
16:10:16 | couven92 | oh... fu*** |
16:10:22 | Tiberium | :D, wrong window? |
16:10:29 | couven92 | Tiberium, yup |
16:17:09 | * | BennyElg joined #nim |
16:21:44 | * | chemist69 quit (Ping timeout: 240 seconds) |
16:22:08 | * | chemist69 joined #nim |
16:24:46 | * | Jesin quit (Ping timeout: 245 seconds) |
16:26:19 | Tiberium | can we get a directory where source file is located? |
16:26:36 | Tiberium | for example I have "test.nim" in "/home/tiber/folder" |
16:26:41 | Tiberium | and I want to get "/home/tiber/folder" |
16:28:15 | * | brson joined #nim |
16:32:25 | * | gokr quit (Ping timeout: 255 seconds) |
16:39:41 | * | couven92 quit (Quit: Client disconnecting) |
16:42:52 | FromGitter | <stisa> Tiberium : look at https://nim-lang.org/docs/system.html#instantiationInfo, |
16:43:53 | * | xet7 quit (Quit: Leaving) |
16:43:54 | * | couven92 joined #nim |
16:48:30 | Sentreen | Is there any particular reason why nim handles circularity so poorly? (i.e. why recursive module imports don't work and why procs need to be forward declared)? It's something that keeps on coming back to bite me in the ass |
16:49:23 | * | yglukhov quit (Remote host closed the connection) |
16:51:35 | Sentreen | It seriously baffles me that this sort of thing is not on the 1.0 roadmap, so I assume there's a reason for it |
16:52:03 | * | yglukhov joined #nim |
16:56:42 | * | yglukhov quit (Ping timeout: 264 seconds) |
17:04:15 | * | samuell quit (Quit: Hejdå) |
17:04:21 | * | xet7 joined #nim |
17:05:28 | FromGitter | <Varriount> Sentreen: Compiler complexity. |
17:05:31 | zachcarter | dom96: good but me creating a nim mode for ace editor is not |
17:05:42 | zachcarter | dom96: http://162.243.192.65/ |
17:06:34 | dom96 | cool |
17:06:40 | dom96 | You need some spinners :) |
17:06:46 | zachcarter | haha Tiberium mentioned that |
17:06:49 | zachcarter | i will add some this evening |
17:07:18 | zachcarter | I think I’m going to leave creating a nim mode for ace up to someone else i don’t think I’m going to be able to do it |
17:07:29 | euantor | Was looking at the streams module earlier, and noticed something that I miss from the .net world - a `copyTo` procedure to copy contents from one stream to another |
17:07:31 | zachcarter | seems bizzrarely complex |
17:07:46 | FromGitter | <Varriount> Sentreen: I can't speak for circular imports, but requiring that procedures be forward declared simplifies quite a bit of the compiler logic. |
17:08:06 | * | GustavoLapasta joined #nim |
17:08:11 | euantor | And of course on systems that support it that proc could use sendfile when working with an IO stream |
17:08:51 | euantor | Which could then be used with sending data from a file to a HTTP client with a http server or reading from a TCP client into a file without doing it manually |
17:09:07 | dom96 | zachcarter: yeah, no need |
17:09:12 | euantor | Of course, that would require sockets/http client to use streams rather than strings but that's something I would like to see for definite |
17:09:14 | dom96 | just enable Python highlighting for now |
17:09:19 | zachcarter | dom96: alright |
17:09:33 | dom96 | although IIRC ace supports textmate syntax highlighting |
17:09:39 | dom96 | and there is a Nim one somewhere |
17:09:55 | zachcarter | oh it does? let me find that then |
17:11:06 | * | Ven joined #nim |
17:11:30 | * | Ven is now known as Guest25397 |
17:11:45 | * | PMunch quit (Quit: leaving) |
17:12:17 | * | Guest25397 quit (Client Quit) |
17:14:06 | Sentreen | That's a shame, but it makes sense :). |
17:15:28 | dom96 | Sentreen: Removing forward declarations is on our roadmap |
17:15:28 | FromGitter | <Varriount> Sentreen: Though, generally circular imports are frowned upon, even in languages that support them fairly weel. |
17:15:31 | FromGitter | <Varriount> *well |
17:18:05 | dom96 | We need to publish an updated roadmap :) |
17:18:10 | euantor | zachcarter: I'm getting the following error on the playground: ace.edit can't find div #editor |
17:18:19 | Sentreen | Ah, I didn't know it was outdated :). |
17:18:51 | Sentreen | I know that it's generally a design smell, but sometimes the only alternative is throwing everything in one huge file, which I personally hate :). |
17:21:56 | dom96 | I've been able to get away with a 'types' module in (IIRC) all cases. |
17:22:04 | dom96 | Maybe you could do the same? |
17:23:37 | Sentreen | I just switched to something like that, just dealing with a few procedure calls that cross module boundaries. |
17:24:34 | Sentreen | I just asked because it felt like I was struggling with the language, not with the actual problems, which is something I generally don't have when I'm writing nim :) |
17:27:41 | zachcarter | euantor: hrm |
17:29:01 | zachcarter | I got the error too but it seems sporadic |
17:29:03 | dom96 | Sentreen: that's fair, there likely is a way to improve this but I am not sure how. Suggestions welcome :) |
17:30:12 | FromGitter | <Varriount> dom96: I think Nim's module model could be improved a bit. |
17:35:27 | Sentreen | I think forward declarations would already help a great deal. Some way to have types depend on each other without generics (maybe by forward declaring types?) would also help a great deal. But I don't know enough about the compiler infrastructure to know the implications of something like that. |
17:36:35 | FromGitter | <Varriount> Sentreen: Types can be circular if they are in the same type block. |
17:37:15 | * | yglukhov joined #nim |
17:37:49 | Tiberium | Is there an opposite to https://nim-lang.org/docs/xmltree.html#escape,string in stdlib? |
17:38:03 | Sentreen | Sorry, I meant making that possible across module boundaries. But I don't think Araq was a fan of even doing it outside of a single type block. |
17:38:47 | FromGitter | <Varriount> I'm not a fan either. If two types depend on each other, they should be close together (in the same module) |
17:40:56 | FromGitter | <Varriount> @zacharycarter Present for you: https://github.com/amoffat/dockerbomb |
17:41:07 | Sentreen | That works for small type compositions, but it quickly becomes a mess if you have a few large (as in a lot of functionality) types that depend on each other. When that happens making a separate 'type' file (as dom said) seems to be the only real solution. |
17:41:16 | euantor | zachcarter: I think it's because the code is running before the DOM is loaded. Usually you'd use an event for document ready to invoke any code relying on the DOM |
17:41:26 | * | yglukhov quit (Ping timeout: 245 seconds) |
17:41:33 | Sentreen | This might just be really hating huge files though. |
17:41:37 | zachcarter | euantor I just tried pushing an update to make that happen |
17:41:41 | zachcarter | but it doesn’t look like it worked |
17:42:19 | Araq | if you have a large type graph full of cycles you have a mess really ;-) |
17:42:39 | FromGitter | <Varriount> Araq: You mean, like the compiler? |
17:42:42 | FromGitter | <Varriount> :P |
17:43:27 | FromGitter | <Varriount> I'm kidding. The compiler has a complex type graph because of it's nature. |
17:44:06 | Sentreen | I'd argue that the nim compiler is not the only system with a complex type graph, even though I agree that quickly becomes a mess :P |
17:47:39 | zachcarter | Araq: is there any way to do things post rendering the vdom with karax? |
17:48:04 | zachcarter | I tried this but it doesn’t seem to be working : https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/app.nim#L42-L75 |
17:50:41 | * | TheLemonMan joined #nim |
17:56:22 | * | adeohluwa joined #nim |
17:58:53 | * | vendethiel- quit (Ping timeout: 240 seconds) |
18:00:11 | * | GustavoLapasta quit (Quit: Leaving) |
18:02:51 | * | Ven joined #nim |
18:03:15 | * | Ven is now known as Guest3812 |
18:04:26 | * | couven92 quit (Quit: Client disconnecting) |
18:07:32 | Araq | zachcarter: why not? |
18:07:58 | zachcarter | not sure - keeep getting missing resource errors |
18:08:14 | Araq | loadScript "src/ace.js" # well I dunno what ace.js does |
18:09:02 | zachcarter | sorry the error is not missing resource the error is that an element is not found in the DOM |
18:09:07 | zachcarter | here’s the content of ace.js |
18:09:39 | zachcarter | https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/ace.js |
18:09:50 | zachcarter | line 3 is the culprit |
18:10:04 | zachcarter | the error is that an element with the ID editor does not exist |
18:10:21 | zachcarter | so it would seem to me this script is being executed before the DOM is actually fully loaded |
18:11:27 | Tiberium | why I cant create string table as a const? |
18:15:41 | demi- | tables aren't defined structures at runtime? |
18:16:38 | demi- | most languages i know of that allow you to `const` a non-primative type apply a hack to make it be interpreted as a const but has to be created at runtime, not compile-time |
18:16:50 | demi- | er |
18:17:04 | demi- | tables aren't defined structures at compile-time, is what i meant to ask |
18:18:06 | dom96 | demi-: that's more of a statement than a question :P |
18:18:31 | demi- | it is an educated guess as to why you cannot const a table |
18:18:35 | demi- | but i don't know for sure |
18:18:47 | Araq | well I can use a const table and it's in the test suite |
18:20:25 | Tiberium | yep, found it |
18:21:43 | * | BennyElg quit (Remote host closed the connection) |
18:22:01 | * | BennyElg joined #nim |
18:29:25 | * | yglukhov joined #nim |
18:32:34 | * | Jesin joined #nim |
18:34:46 | * | Guest3812 quit (Ping timeout: 245 seconds) |
18:34:52 | * | nsf joined #nim |
18:35:05 | Tiberium | https://github.com/nim-lang/Nim/pull/5755 yay no test errors |
18:35:38 | * | gokr joined #nim |
18:37:25 | * | brson quit (Quit: leaving) |
18:37:31 | * | Ven_ joined #nim |
18:40:23 | * | zachcarter quit (Ping timeout: 240 seconds) |
18:45:59 | krux02 | I found a new bug in the Nim language, just created the issue |
18:46:12 | krux02 | yay |
18:47:26 | dom96 | Tiberium: cool, merged |
18:47:48 | TheLemonMan | how comes everyone's interested in matrices? |
18:48:29 | dom96 | Tiberium: note that using multiple lets/vars is generally ok. |
18:48:57 | Tiberium | dom96, ok, but someone said that it's more idiomatic to use blocks |
18:51:00 | krux02 | TheLemonMan: you style of words let me think that you are not interested in matrices |
18:52:17 | krux02 | matrices are cool, because they describe linear mappins in just a bunch of numbers plus a lot of theory about them that allow very defined transformations |
18:54:33 | TheLemonMan | more like because I've been sifting trough the bug tracker and there are a lot of bugs involving static[T] and people trying to model matrices |
19:09:07 | * | Arrrr quit (Ping timeout: 258 seconds) |
19:19:42 | * | zachcarter joined #nim |
19:27:48 | * | rauss quit (Ping timeout: 246 seconds) |
19:30:25 | * | rauss joined #nim |
19:32:17 | * | rokups quit (Quit: Connection closed for inactivity) |
19:34:02 | * | brson joined #nim |
19:34:23 | Tiberium | wow https://github.com/nim-lang/Nim/issues/5757 |
19:36:01 | * | yglukhov quit (Remote host closed the connection) |
19:36:42 | Tiberium | hmm wait |
19:37:10 | Tiberium | it compiles on nim playground, but not on my PC |
19:39:31 | * | yglukhov joined #nim |
19:39:39 | * | Trustable quit (Remote host closed the connection) |
19:39:42 | * | yglukhov quit (Remote host closed the connection) |
19:40:59 | TheLemonMan | more like because I've been sifting trough the bug tracker and there are a lot of bugs involving static[T] and people trying to model matrices |
19:41:05 | * | TheLemonMan left #nim (#nim) |
19:41:31 | dom96 | Tiberium: known regression (maybe) |
19:52:46 | * | yglukhov joined #nim |
20:03:36 | * | yglukhov quit (Remote host closed the connection) |
20:06:54 | * | yglukhov joined #nim |
20:09:03 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
20:17:43 | * | couven92 joined #nim |
20:23:42 | Tiberium | dom96, can I somehow disable error throw at 404 error code? using async http client |
20:23:45 | Tiberium | or set up a callback |
20:24:22 | dom96 | use request |
20:24:58 | * | zachcarter quit (Quit: zachcarter) |
20:42:24 | * | Tiberium quit (Remote host closed the connection) |
20:46:48 | * | Vladar quit (Quit: Leaving) |
20:52:02 | * | Ven_ quit (Ping timeout: 252 seconds) |
20:53:28 | * | Ven joined #nim |
20:53:47 | * | couven92 quit (Quit: Client Disconnecting) |
20:53:52 | * | Ven is now known as Guest73192 |
20:57:04 | FromGitter | <ephja> the website is looking good |
20:59:58 | * | rauss quit (Quit: WeeChat 1.7.1) |
21:01:58 | * | bjz joined #nim |
21:03:01 | * | Matthias247 joined #nim |
21:05:55 | * | PMunch joined #nim |
21:14:24 | * | libman joined #nim |
21:18:40 | * | Guest73192 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:30:20 | * | gokr quit (Quit: Leaving.) |
21:58:30 | * | devted quit (Quit: Sleeping.) |
22:04:48 | * | vlad1777d_ joined #nim |
22:04:49 | * | zetashift joined #nim |
22:05:04 | * | scriptum quit (Ping timeout: 240 seconds) |
22:07:07 | * | vlad1777d quit (Ping timeout: 268 seconds) |
22:07:56 | * | gangstacat quit (Ping timeout: 252 seconds) |
22:08:04 | * | scriptum joined #nim |
22:09:46 | * | BennyElg quit (Read error: Connection reset by peer) |
22:10:33 | * | BennyElg joined #nim |
22:11:41 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:13:28 | * | gangstacat joined #nim |
22:14:44 | * | nsf quit (Quit: WeeChat 1.7) |
22:22:54 | * | themagician quit () |
22:23:08 | * | yglukhov quit (Read error: Connection reset by peer) |
22:23:39 | * | yglukhov joined #nim |
22:23:52 | * | zetashift left #nim ("Leaving") |
22:34:56 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:40:10 | * | PMunch quit (Quit: leaving) |
22:44:10 | * | yglukhov quit (Remote host closed the connection) |
22:44:42 | * | yglukhov joined #nim |
22:46:06 | FromGitter | <TiberiumPY> LOL nim has phone back end |
22:46:32 | FromGitter | <TiberiumPY> *php |
22:49:15 | * | yglukhov quit (Ping timeout: 260 seconds) |
22:58:12 | FromGitter | <TiberiumPY> And nim ffi is again so easy: default function to read import from console in PHP is readline so you just do "proc readline(prompt: cstring): cstring {.importc.}" and it just works |
23:00:06 | FromGitter | <TiberiumPY> s/import/input |
23:08:50 | * | zachcarter joined #nim |
23:12:10 | * | smt_ joined #nim |
23:12:39 | * | devted joined #nim |
23:15:10 | * | smt quit (Ping timeout: 255 seconds) |
23:15:40 | * | zachcarter quit (Ping timeout: 260 seconds) |
23:16:59 | * | zachcarter joined #nim |
23:21:33 | * | sz0 joined #nim |
23:43:17 | * | vopi181[m] joined #nim |
23:55:24 | zachcarter | man so weird the nim playground didn’t seem to be having this issue loading JS earlier today |
23:55:28 | zachcarter | not sure what I broke :/ |