00:34:27 | * | zolk3ri quit (Remote host closed the connection) |
00:39:28 | * | nekits joined #nim |
00:39:56 | * | ieatnerds quit (Ping timeout: 256 seconds) |
00:40:19 | * | yglukhov joined #nim |
00:45:05 | * | yglukhov quit (Ping timeout: 260 seconds) |
01:21:15 | FromGitter | <Quelklef> What's the best real "toy language" out there? |
01:21:52 | FromGitter | <Quelklef> i.e. I'm playing with a language-agnostic idea for a preprocessor; what language would be small and simple enough to write a full preprocessor for |
01:22:01 | FromGitter | <Quelklef> while still having the same functionality as any other language |
01:27:26 | skrylar | smalltalk :> |
01:28:28 | skrylar | preprocessors are agnostic to what they are preprocessing, though. you're thinking of a meta compiler as in ocaml_p4 |
01:28:44 | skrylar | gcc -E, m4, awk, etc, they don't care |
01:29:25 | FromGitter | <Quelklef> OTOH, SASS is a preprocessor but isn't language-agnostic |
01:29:44 | FromGitter | <Quelklef> regardless, thanks for the suggestion. Time to learn Smalltalk : ) |
01:55:59 | * | livcd quit (Ping timeout: 256 seconds) |
02:21:18 | * | d10n-work joined #nim |
02:22:19 | * | chemist69 quit (Ping timeout: 265 seconds) |
02:34:50 | * | livcd joined #nim |
02:35:47 | * | chemist69 joined #nim |
02:49:34 | * | yglukhov joined #nim |
02:53:40 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:56:34 | * | endragor quit (Remote host closed the connection) |
02:56:49 | * | endragor joined #nim |
03:06:14 | * | arecaceae quit (Remote host closed the connection) |
03:06:36 | * | arecaceae joined #nim |
03:10:05 | * | dddddd quit (Remote host closed the connection) |
03:20:05 | skrylar | sometimes i wonder if there is a point to reimplementing some things |
03:20:26 | skrylar | i mean is the added understanding of the algorithms worth more than just slapping some python toolkits together and 'being done' |
03:20:59 | FromGitter | <Quelklef> ...........? |
03:22:56 | skrylar | Oh, just dealing with some machine learning algorithms |
03:23:53 | skrylar | Everyone's all in to deep neural nets but some stuff i've been reading suggests HMM-based systems are more effective for less compute |
03:24:53 | skrylar | the voice sector seems to be competing for HMM (extremely efficient, but cell phone quality) and deep nets (sounds good, impractical performance) |
03:25:21 | * | rockcavera quit (Remote host closed the connection) |
03:32:17 | * | rockcavera joined #nim |
03:45:48 | * | rinzai quit (Ping timeout: 256 seconds) |
03:48:57 | * | rinzai joined #nim |
03:51:35 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:53:32 | * | rinzai quit (Ping timeout: 255 seconds) |
03:59:07 | FromGitter | <honewatson> @Quelklef there is moonscript which I really like as a scripting language. Nice and simple. https://github.com/leafo/moonscript |
04:00:08 | FromGitter | <honewatson> Also there is Min https://min-lang.org/ though I would not call either toy languages since I think both are great even though they are simple |
04:03:59 | FromGitter | <Quelklef> I think I'm gonna use JS so that maybe in the future I'll be able to make actual use of the project |
04:04:05 | FromGitter | <Quelklef> although Min looks interesting |
04:18:00 | * | rinzai joined #nim |
04:22:20 | * | rinzai quit (Ping timeout: 255 seconds) |
04:32:40 | skrylar | i thought arrays in raw mem were array[(y * ydim) + x] and yet i'm getting the wrong values even when using that for input and output |
04:32:42 | * | skrylar headscratches |
04:44:58 | * | skrylar quit (Remote host closed the connection) |
05:17:08 | * | radagast_04 joined #nim |
05:24:38 | radagast_04 | imo, as a Nim user, you should be proficient with C as well. You may find yourself porting C codebases with C2Nim |
05:58:12 | * | darithorn quit (Quit: Leaving) |
06:04:47 | * | Lord_Nightmare quit (Ping timeout: 248 seconds) |
06:05:47 | * | rinzai joined #nim |
06:07:20 | * | Lord_Nightmare joined #nim |
06:13:28 | * | rinzai quit (Ping timeout: 268 seconds) |
06:15:59 | * | nsf joined #nim |
06:20:02 | * | d10n-work quit (Quit: Connection closed for inactivity) |
06:30:41 | Araq | radagast_04: nah, Nim should have enough of a library ecosystem to require no C knowledge (we're not there yet though) |
07:08:06 | FromGitter | <gogolxdong> How to set charset of db_mysql client ? meet error when using setEncoding("utf8") except latin1 . |
07:08:55 | * | solitudesf joined #nim |
07:15:44 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a7bf91f4a6b0dd32ba3e16b] |
07:16:08 | FromGitter | <gogolxdong> We have set everything we know. |
07:20:39 | FromGitter | <gogolxdong> well , solved , seems setEncoding() should use the same charset with client or connection |
07:36:38 | * | rinzai joined #nim |
07:40:49 | * | rinzai quit (Ping timeout: 248 seconds) |
07:41:12 | * | hogeland_ joined #nim |
07:43:34 | * | hogeland_ quit (Client Quit) |
07:49:00 | * | hogeland quit (Quit: leaving) |
07:50:47 | * | hogeland joined #nim |
07:58:04 | * | yglukhov joined #nim |
08:02:27 | * | yglukhov quit (Ping timeout: 260 seconds) |
08:04:40 | * | yglukhov joined #nim |
08:05:03 | * | yglukhov quit (Read error: Connection reset by peer) |
08:05:19 | * | yglukhov joined #nim |
08:07:45 | * | gokr joined #nim |
08:08:08 | * | j_rod_s quit (Quit: j_rod_s) |
08:08:20 | * | j_rod_s joined #nim |
08:27:45 | FromGitter | <mratsim> @Quelklef Regarding speed, and "Nim is designed to be fast, but no compiler will ever be smart enough to outperform handwritten code in the language it compiles to ⏎ (Given that the programmer is experienced in that language)”. The biggest issue is maintenance time. People have to write handwritten assembly for a lot of stuff (video processing, matrix multiplications, etc) however each time Intel/AMD/ARM release a |
08:27:45 | FromGitter | ... new feature you need an expert to revisit the stuff while with compiled language you can expect GCC/LLVM to get better |
08:30:35 | * | rinzai joined #nim |
08:34:57 | * | rinzai quit (Ping timeout: 240 seconds) |
08:35:33 | * | Yardanico_ joined #nim |
08:38:51 | Araq | " but no compiler will ever be smart enough to outperform handwritten code in the language it compiles to" |
08:39:03 | Araq | that's just bullshit. |
08:39:41 | Araq | GCC produces better asm than most people. Nim produces C code free of undefined behaviour. well it could. |
08:40:02 | * | Yardanico_ quit (Read error: Connection reset by peer) |
08:40:13 | Araq | the opposite is true, no human being will ever be as effective as a machine at what the machine was built to do. |
08:40:50 | Araq | GCC doesn't become bored half-way through register allocation |
08:41:14 | * | PMunch joined #nim |
08:48:58 | FromGitter | <alehander42> that would be an amusing ML idea,gcc .. with feelings |
08:49:27 | PMunch | "I'm sorry Dave, I can't let you do that" |
08:50:41 | FromGitter | <mratsim> Actually it reminds me AMD ads from December about Machine Instinct, let me find it |
08:50:47 | FromGitter | <alehander42> My God, it's full of * |
08:51:59 | FromGitter | <mratsim> https://www.youtube.com/watch?v=pmg9zXZinh4 |
08:53:52 | * | Arrrr joined #nim |
08:53:52 | * | Arrrr quit (Changing host) |
08:53:52 | * | Arrrr joined #nim |
08:58:43 | FromGitter | <alehander42> this is so over the top, amazing |
09:01:00 | FromGitter | <survivorm> @Araq https://hackernoon.com/why-funding-open-source-is-hard-652b7055569d |
09:01:43 | FromGitter | <survivorm> Great article, may help to get more money to nim, to sustain more core developers |
09:01:47 | FromGitter | <mratsim> At least AMD marketing team is in shape because they were so quiet in the past years |
09:03:57 | * | sleepyqt joined #nim |
09:05:51 | * | wurui joined #nim |
09:07:15 | * | sendell joined #nim |
09:08:00 | FromGitter | <k0pernicus> What is the state of Tail Call/Tail recursion optimization in Nim? ⏎ I tried to run (`release` build) a recursive program that compute the hanoi towers and returns the number of switches, and it seems it performs like the C build (with -O2 flag). ⏎ I tried also with Rust, and it seems the Rust compiler (LLVM IR) is rewriting the recursive function as an iterative function (I have a little knowledge in asm, so is |
09:08:00 | FromGitter | ... it highly possible I made a mistake in my hypothesis)... |
09:08:14 | FromGitter | <k0pernicus> (https://files.gitter.im/nim-lang/Nim/D143/Capture-d_ecran-2018-02-08-a-10.06.07.png) |
09:09:22 | * | Vladar joined #nim |
09:10:02 | FromGitter | <mratsim> @k0pernicus There is none but it might be possible with a macro |
09:11:02 | FromGitter | <k0pernicus> Ok - so it seems `clang` does not optimized much the C code with `-O2`... |
09:11:18 | * | wurui quit (Read error: Connection reset by peer) |
09:14:28 | * | radagast_04 quit (Ping timeout: 256 seconds) |
09:14:45 | * | radagast_04 joined #nim |
09:21:02 | * | BitPuffin joined #nim |
09:22:31 | PMunch | survivorm[m], hi did you see the link I posted yesterday? |
09:24:14 | * | skelett joined #nim |
09:24:20 | * | Ven`` joined #nim |
09:24:33 | * | rinzai joined #nim |
09:24:37 | PMunch | honewatson, Quelklef: Min is pretty neat, but you've got to be comfortable with stack based computers or RPN to really be able to do anything in it :P |
09:24:47 | * | skelett quit (Client Quit) |
09:26:46 | * | skelett joined #nim |
09:27:07 | FromGitter | <alehander42> stack-based languages are very fun for langdev experimentation indeed |
09:28:35 | * | rinzai quit (Ping timeout: 240 seconds) |
09:28:44 | * | Ven`` quit (Ping timeout: 252 seconds) |
09:29:43 | PMunch | alehander42, yeah stack based is fun. I've used RPN calculators my entire life and there's something nice about having a language that works the same way |
09:30:13 | PMunch | That's actually one of the things on my todo list, create a good RPN calculator in Gtk |
09:30:23 | PMunch | Or whatever toolkit, but for desktops |
09:30:30 | PMunch | Maybe even port it to Android as well |
09:35:21 | FromGitter | <alehander42> yeah, I can see the appeal |
09:36:12 | FromGitter | <alehander42> simple "teaching" stack-based vm-s are also very fun to create, I remember once I did it in prolog, and it was the most obvious and declarative thing I've ever written |
09:45:52 | FromGitter | <survivorm> @PMunch i had. But i've got no time to actually read it yet. Once i'll be able to do it, i'll give you the ffedback |
09:46:16 | FromGitter | <survivorm> And, of cource, you have my thanks |
09:47:30 | PMunch | Haha, don't thank me before you've read it :P |
09:48:00 | PMunch | Just to warn you, it's a first draft. I just typed it up as I read along and skipped a couple things I wanted to ask you about |
09:55:18 | FromGitter | <survivorm> feel free to do it any time i'm here :) |
09:59:58 | PMunch | I don't quite remember what it was that I was going to ask you, have to read my notes to rememeber :P |
10:00:55 | FromGitter | <survivorm> Just some off top, @PMunch do you like good sci-fi (as you like space and science)? |
10:01:06 | PMunch | Sure do :) |
10:01:19 | PMunch | I probably like some bad sci-fi as well :P |
10:01:35 | FromGitter | <survivorm> Then take this: http://samlib.ru/t/tokanawa_t/weboflight.shtml |
10:01:59 | FromGitter | <survivorm> it's unfortunately more like a teaser, cause author is russian |
10:02:21 | PMunch | Ohh, I'll be sure to check it out once I get back from lunch :) |
10:02:52 | FromGitter | <survivorm> but it's a great read, joriginal has 5 +3 volumes |
10:03:04 | FromGitter | <survivorm> i've read it non-stop |
10:04:00 | FromGitter | <survivorm> If you'd like a teaser, you may take a google translation on the other parts. It may be painful, but you'll understand it, at least ^) |
10:18:25 | * | rinzai joined #nim |
10:20:02 | * | Yardanico_ joined #nim |
10:32:16 | FromGitter | <94JerryZhou> How to avoid data duplication when inserting data into mysql with nim ? |
10:38:11 | Araq | you use an "update or insert" query |
10:38:43 | Araq | https://stackoverflow.com/questions/4205181/insert-into-a-mysql-table-or-update-if-exists |
10:38:53 | Araq | INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE |
10:38:53 | Araq | name="A", age=19 |
10:39:04 | * | Yardanico_ quit (Read error: Connection reset by peer) |
10:56:14 | * | skelett quit (Ping timeout: 255 seconds) |
11:06:59 | * | xet7 quit (Ping timeout: 256 seconds) |
11:13:37 | yglukhov | Is there a term for wrapping a call to an argless lambda, evaluating the args, but not the call itself? |
11:15:16 | PMunch | What? |
11:15:49 | PMunch | An argless lambda with arguments? |
11:16:09 | PMunch | Or are you thinking of partially applied functions? |
11:16:39 | FromGitter | <survivorm> that's a little more complicated, if i understand correctly |
11:16:51 | FromGitter | <survivorm> he's speaking about closure |
11:17:50 | FromGitter | <survivorm> there are evaluated args for function call, but we give up only argless call, which will call a func with evaluated args |
11:18:07 | FromGitter | <survivorm> Am i correct, @yglukhov ? |
11:19:26 | FromGitter | <survivorm> When i speak it like this, i think it's really partially applied function :) |
11:20:05 | * | xet7 joined #nim |
11:20:05 | FromGitter | <survivorm> just the case then we specify all args |
11:22:11 | euantor | Rather than `INSERT ... ON DUPLICATE`, you can use MySQL's `REPLACE INTO...` if you use proper keys in your tbale (hint: you should) |
11:23:10 | * | skelett joined #nim |
11:23:59 | * | Arrrr quit (Ping timeout: 256 seconds) |
11:25:05 | * | Ven`` joined #nim |
11:26:58 | PMunch | survivorm, well partially applied is just a superset of what you described |
11:27:44 | PMunch | Instead of having to pass all the arguments you can pass some of them and get a closure back that wraps the ones you passed and takes the rest of them |
11:27:57 | * | solitudesf quit (Ping timeout: 264 seconds) |
11:29:11 | * | vlad1777d joined #nim |
11:29:53 | * | Ven`` quit (Ping timeout: 276 seconds) |
11:41:29 | * | dddddd joined #nim |
11:42:07 | * | chemist69 quit (Ping timeout: 256 seconds) |
11:50:59 | rinzai | hi everyone. nim -> js question: after defining an `var foo: Interval` with `dom.setInterval` how do I actually call it? |
11:54:06 | rinzai | nevermind |
11:54:35 | rinzai | I was thrown off by the fact that the compiler warns about an "unused variable foo: Interval" |
11:54:40 | rinzai | but it works on the browser |
11:54:48 | yglukhov | survivorm, PMunch: having a call like foo(a.a, b.b, v[bar()]), i want to produce a proc of type proc() that calls this foo, but i want the arguments like v[bar()] to be evaluated on proc creation. |
11:55:31 | FromGitter | <survivorm> yeah, it's partial apply |
11:55:47 | * | chemist69 joined #nim |
11:55:51 | FromGitter | <survivorm> in python it's functools.partial |
11:57:06 | yglukhov | indeed, looks like it. thanks. now is there any nim impl for that... |
11:57:31 | PMunch | Hmm, not as far as I know.. |
11:57:46 | PMunch | But it would be fairly easy to do with a macro I believe |
11:57:53 | * | Vladar quit (Remote host closed the connection) |
11:58:04 | yglukhov | true |
11:58:25 | PMunch | https://rosettacode.org/wiki/Currying#Nim |
11:59:02 | PMunch | I mean if it's only for one particular procedure you could just write a procedure to do it for you |
11:59:04 | yglukhov | yeah, there's also a curring lib for nim which allows haskel-like functions. |
11:59:26 | yglukhov | https://github.com/t8m8/currying |
11:59:27 | PMunch | But if you want a general case thing then implementing it as a macro is probably your only choice |
11:59:57 | PMunch | Oh wow, that's cool |
11:59:58 | yglukhov | i think nim should have some more higher level metaprogramming helpers like this... |
12:00:05 | PMunch | Didn't know of the currying library |
12:01:00 | FromGitter | <alehander42> well just importing a library is cool too |
12:01:11 | PMunch | yglukhov, yeah. The powers that metaprogramming brings with it can be a bit inconvenient to harness |
12:02:16 | PMunch | Oh, the implementation of the currying thing is pretty neat |
12:02:37 | PMunch | It just takes all the arguments and creates procedures that takes the various amount of arguments |
12:03:21 | * | vlad1777d quit (Ping timeout: 264 seconds) |
12:03:39 | yglukhov | e.g. this typedParams func is implemented there, and i used to implement it like 4 times in different libs, like iterators and like functions. i mean it would be really useful to have such an iterator in stdlib |
12:05:15 | yglukhov | also different proc introspection stuff, like make a tuple of types of function args, apply function to a such tuple, etc. thats pretty basic to reside in stdlib imo |
12:14:38 | FromGitter | <Quelklef> @mratsim yeah, that's a really good point that hadn't occurred to me when I was writing. I was mostly concerned with theoretical results rather than realistic ones |
12:18:07 | FromGitter | <Quelklef> @Araq you're right, once we concern ourselves with code flexibility, portability, and comprehensiveness in comparison to programmer effort and time spent. I was mostly concerned about what is *possible*, which I suppose is a bit of a naive viewpoint |
12:21:16 | FromGitter | <Quelklef> Or rather not what is possible but I just didn't really concern my argument with time or effort or anything else human besides intelligence. It did occur to me slightly later, and I noted it in the chat |
12:22:42 | Araq | we had Nim programs run faster than C programs |
12:23:01 | Araq | the C run as fast once it was uglified to what Nim produces |
12:23:41 | Araq | no C programmer would have written the program in this way without Nim's results. |
12:24:05 | FromGitter | <alehander42> @Quelklef the argument about development speed is bigger than you imagine, loads of people use python/ruby etc which are magnitudes slower because even that kind of slowdown(more servers) is cheaper than development time |
12:29:50 | * | sleepyqt quit (Quit: Leaving) |
12:30:53 | FromGitter | <Quelklef> @Araq really? That's crazy, can you link? Is it a case of bad C or is the compiler really that good |
12:32:04 | Araq | yes really, more details are in some old forum post |
12:32:32 | FromGitter | <Quelklef> @alehander42 sure, I don't disagree with that, but it also wasn't my argument. As a bit of a tangent, I always found Python a bit slow to develop because debugging is a chore |
12:32:46 | Araq | C is not mystical, it goes through an optimizing compiler backend that tries to remove much of C's misfeatures |
12:32:58 | Araq | (pervasive aliasing, for example) |
12:33:10 | Araq | the result is hard to reason about performance wise |
12:33:32 | Araq | everything else is a lie. |
12:34:04 | FromGitter | <Quelklef> What do you mean by those last two lines? |
12:34:36 | Araq | it's just not true that C is a "portable assembler". the mapping to machine code is far from obvious with today's compilers |
12:36:54 | Araq | you really don't get benefit by writing C by hand. Nor by writing LLVM bit code by hand. it's bullshit. |
12:39:57 | FromGitter | <Quelklef> Except for for educational purposes. But on a more serious note, you've definitely changed my opinion on this and I'd be curious to see that forum post |
12:40:14 | Araq | C is a primitive tedious language to work in with an atrocious type system which has never been copied by any language in widespread use. |
12:44:07 | FromGitter | <Quelklef> This is a bit of a nonsequiter but the type system is necessary to provide the amount of memory control you get right! |
12:44:12 | FromGitter | <Quelklef> ?* |
12:45:32 | * | Snircle joined #nim |
12:48:22 | FromGitter | <alehander42> despite its problems, C is sometimes a "simpler and more reasonable C++" honestly (but I am not a big fan of both) |
12:56:02 | * | rinzai quit (Ping timeout: 256 seconds) |
12:58:31 | yglukhov | How do i create an anonymous tuple with 1 field? So that i can index it? e.g. (1, 2)[0] == 1, but (1) == 1 |
12:59:24 | Araq | Quelklef: The type system could be better for optimizers ;-) |
12:59:42 | Araq | yglukhov, you can't :-) |
13:00:33 | yglukhov | bummer |
13:01:43 | yglukhov | is there a case when (smth) == smth is useful? |
13:03:25 | yglukhov | (1,) == 1 as well, even though there's a comma |
13:04:02 | FromGitter | <GULPF> there's an issue for that one |
13:04:08 | FromGitter | <GULPF> https://github.com/nim-lang/Nim/issues/1987 |
13:04:47 | yglukhov | oh cool, thanks |
13:05:22 | yglukhov | the fact its not closed makes me believe its gonna be fixed =) |
13:06:06 | yglukhov | on the other hand its more than 2 years old... :D |
13:10:05 | * | rinzai joined #nim |
13:12:57 | Araq | are you serious? |
13:13:11 | Araq | don't want to be able to influence operator precedence with () ? |
13:13:26 | Araq | Quelklef: one example https://forum.nim-lang.org/t/1779/3 |
13:14:12 | Araq | is there a case when 1 field tuples are useful in a statically typed environment? |
13:14:17 | FromGitter | <alehander42> is there a way to get line/path of argument of a macro? I want to be able to somehow preserve the corresponding source code |
13:14:39 | Araq | there is, check lineInfo procs |
13:14:44 | * | rinzai quit (Ping timeout: 256 seconds) |
13:17:20 | yglukhov | Araq: collecting function arguments to a tuple in a macro |
13:18:26 | yglukhov | but ok, its not that big deal for my particular use case |
13:18:37 | Araq | it doesn't have to be a tuple then |
13:18:47 | yglukhov | what else? |
13:18:56 | Araq | you produce () nnkPar and if n.len == 0 you skip the accessor generation |
13:19:04 | Araq | er, n.len == 1, that is. |
13:20:08 | * | endragor quit (Remote host closed the connection) |
13:20:44 | * | endragor joined #nim |
13:21:13 | yglukhov | well so it has to be a (tuple or argtype). and requires special handling. anyways like i said, not a big deal. in my particular case i just always append newlit(0) to the end of the tuple =) |
13:21:58 | yglukhov | but looks like i've just found another bug. |
13:25:19 | * | endragor quit (Ping timeout: 248 seconds) |
13:25:20 | FromGitter | <Quelklef> @Araq super cool, thanks for the example |
13:37:34 | * | rinzai joined #nim |
13:53:57 | * | couven92 quit (Quit: Client disconnecting) |
14:23:10 | * | gokr quit (Ping timeout: 240 seconds) |
14:27:56 | * | sendell quit (Remote host closed the connection) |
14:39:11 | * | SusWombat joined #nim |
15:05:30 | * | solitudesf joined #nim |
15:26:24 | * | Ven`` joined #nim |
15:34:12 | * | d10n-work joined #nim |
15:37:55 | PMunch | Haha yglukhov's quote from that forum post: "AST macros [...] is the gatling laser gun feature that should blow the minds of the most pervert metaprogramming junkies." |
15:38:11 | * | gokr joined #nim |
15:38:11 | PMunch | Put that on the flier next time :P |
15:45:35 | * | Ven`` quit (Ping timeout: 248 seconds) |
15:54:39 | FromGitter | <alehander42> that's pure poetry |
16:08:53 | federico3 | :D |
16:16:02 | * | gokr quit (Ping timeout: 255 seconds) |
16:18:29 | * | arnetheduck quit (Ping timeout: 265 seconds) |
16:18:29 | * | acidx quit (Read error: Connection reset by peer) |
16:18:47 | Araq | here is a puzzle for you |
16:18:53 | Araq | https://github.com/google/boringssl/blob/master/crypto/bio/bio.c#L71 |
16:19:07 | Araq | https://github.com/google/boringssl/blob/master/crypto/bio/bio_mem.c#L69 |
16:19:27 | Araq | BIO_new_mem_buf calls BIO_new and uses the 'ptr' field |
16:19:50 | Araq | the 'ptr' field can only be NULL though |
16:21:27 | PMunch | Uhm.. |
16:21:28 | PMunch | What?? |
16:22:05 | PMunch | Ah |
16:22:10 | PMunch | line 83 |
16:22:12 | federico3 | PMunch: don't spoiler |
16:22:17 | PMunch | Oh, woops |
16:28:15 | * | Jesin joined #nim |
16:29:24 | yglukhov | Araq: method->create(ret) and mem_new fills it in? |
16:29:51 | yglukhov | line 113 |
16:29:51 | Araq | yglukhov, that's pretty much the only solution, right? |
16:30:14 | yglukhov | at least the first that comes to mind |
16:30:16 | PMunch | I've figured it out |
16:30:16 | yglukhov | why? |
16:30:20 | PMunch | Hold on a sec |
16:31:25 | * | yglukhov quit (Remote host closed the connection) |
16:31:58 | * | yglukhov joined #nim |
16:33:21 | * | nsf quit (Quit: WeeChat 2.0.1) |
16:35:13 | * | sp33der89 joined #nim |
16:35:20 | * | sp33der89 left #nim ("Leaving") |
16:36:46 | PMunch | SPOILER: http://ix.io/FuK/ |
16:36:55 | * | yglukhov quit (Ping timeout: 268 seconds) |
16:37:00 | * | Trustable joined #nim |
16:37:01 | PMunch | That's how it works |
16:38:24 | PMunch | Don't drink and code kids |
16:40:33 | Araq | OpenSSL -- when Java's OOP doesn't cut it |
16:41:07 | federico3 | clever and tricky code in a crypto lib - what could possibly go wrong? |
16:41:29 | PMunch | It appears to be someone trying to emulate an interface in C, kinda similar to how you would do it in Nim really (like a Stream for example) |
16:41:40 | PMunch | federico3, haha exactyl |
16:42:04 | Araq | my streams are not an exercise in code obfuscation |
16:42:23 | PMunch | Oh no, that's not what I meant. In Nim it's pretty obvious what you are doing |
16:42:47 | PMunch | This C solution is a bit less readable to say the least :P |
16:53:18 | * | PMunch quit (Quit: Leaving) |
16:56:06 | * | dddddd quit (Remote host closed the connection) |
16:59:37 | FromGitter | <krux02> Does nim have a compilation cache for generic functions? |
17:02:15 | FromGitter | <krux02> I am just asking because glm is entirely generic, and when generic functions are not chached at all, incremental compilation might become expensive at some point. |
17:04:48 | * | Melon_Melon joined #nim |
17:06:56 | Melon_Melon | hi guys, i am going to stick with Common Lisp :D, i think. I may learn Nim when it is 1.0 or 2.0. And Rust :/ well i don't know, i don't feel like i want to learn Rust. |
17:07:19 | Melon_Melon | Then, i am going to be a Common Lisp programmer |
17:07:49 | Melon_Melon | I am the" pony lang guy", just letting you to know that i choose Common Lisp |
17:08:04 | Melon_Melon | NOT rust |
17:11:33 | * | heinrich5992 joined #nim |
17:11:36 | heinrich5992 | I Changed my mind, i never gonna learn Nim, Nim's community sucks honestly, and Nim will never be a good language, maybe in 10 years who knows, i would rather learn Rust that has a good community |
17:12:18 | federico3 | was that the usual troll? |
17:16:45 | * | Nim-ogre joined #nim |
17:16:48 | FromGitter | <krux02> federico3: I think so |
17:16:48 | Nim-ogre | Also, Common Lisp is much better than Nim-Ogres (yeah Nim is for Ogres like the guy who is constantly banning me because he can't stand my opinion), Common Lisp is a real programming language, Not a toy language like Nim.... And i am going to master Common Lisp to create games, game servers and DoS tools (Common Lisp + C). |
17:17:21 | FromGitter | <krux02> Ogres? |
17:17:45 | FromGitter | <krux02> DoS tools? |
17:17:51 | FromGitter | <krux02> like MS DOS tools? |
17:19:30 | FromGitter | <krux02> Nim-ogre: Did you know that Python startey as a toy project for someone just to have something to do over christmas holydays? Now look what it became. |
17:21:11 | FromGitter | <krux02> Nim-ogre: Did you know that nobody is banned just for an opinion. But people get banned because of the way those people express their opinion? |
17:21:54 | federico3 | please don't feed the trolls |
17:21:56 | FromGitter | <Quelklef> Why's this guy keep coming back |
17:23:22 | FromGitter | <krux02> I like arguing with my-programming-language-is-better-than-yours-people |
17:23:33 | * | natrys joined #nim |
17:24:04 | * | foobar_baz joined #nim |
17:24:33 | * | foobar_baz quit (Client Quit) |
17:24:38 | FromGitter | <krux02> I have enough experience to say that every programming language sucks. And there is no programming language objectively better than another language at least not what that language has a decent amount of history. |
17:24:59 | * | gokr joined #nim |
17:25:06 | FromGitter | <Quelklef> Take this: brainfuck is the best language because it manages to be the most minimal while still being Turing complete. That makes it the most elegant and the best |
17:25:34 | FromGitter | <krux02> @Quelklef thank you, you understand my point. |
17:25:44 | FromGitter | <Quelklef> : ) |
17:26:48 | * | Gay-Araq joined #nim |
17:27:24 | FromGitter | <krux02> I really think there is little space for new programming languages. People don't want new programming languages. At least not until they saw the limits and the frustration in their language. |
17:27:46 | FromGitter | <krux02> But even frustration sometimes makes people defend their language because they had to go though all of that. |
17:29:02 | FromGitter | <krux02> I program entirely in emacs lisp now. |
17:29:12 | FromGitter | <krux02> :P |
17:29:40 | FromGitter | <krux02> Who needs applications when you can spend the entire productivity into optimizing your workflow. |
17:29:54 | * | sleepyqt joined #nim |
17:38:34 | * | darithorn joined #nim |
17:38:38 | * | Arrrr joined #nim |
17:41:46 | * | nsf joined #nim |
17:53:50 | Arrrr | "And i am going to master Common Lisp to create games" underaged detected |
17:58:04 | * | SusWombat quit (Quit: Leaving) |
18:09:27 | * | gokr quit (Ping timeout: 240 seconds) |
18:17:07 | * | vivus joined #nim |
18:19:37 | * | Jesin quit (Quit: Leaving) |
18:37:24 | * | acidx joined #nim |
18:50:12 | * | rockcavera quit (Ping timeout: 256 seconds) |
19:01:07 | FromGitter | <alehander42> i have to admit common lips is still a cooler choice than the previous ones |
19:01:35 | FromGitter | <alehander42> one day he might find out about prolog or idris or something |
19:01:39 | * | rockcavera joined #nim |
19:03:18 | Araq | or maybe he grows up one day |
19:05:43 | FromGitter | <alehander42> :D I think he'll be bored of this max month from now |
19:08:08 | * | gokr joined #nim |
19:25:29 | * | mgdelacroix quit (Ping timeout: 255 seconds) |
19:26:15 | * | xet7_ joined #nim |
19:26:26 | * | Syneh__ quit (Ping timeout: 276 seconds) |
19:26:59 | * | enigmeta quit (Ping timeout: 265 seconds) |
19:27:57 | * | xet7 quit (Ping timeout: 265 seconds) |
19:28:29 | * | mgdelacroix joined #nim |
19:30:14 | * | Syneh__ joined #nim |
19:30:29 | * | enigmeta joined #nim |
19:31:00 | * | Arrrr quit (Ping timeout: 256 seconds) |
19:44:48 | * | scriptum quit (Quit: Leaving) |
19:45:10 | * | scriptum joined #nim |
19:47:51 | FromGitter | <zacharycarter> Okay stupid question - can I somehow use an emoji in my code? Like assign it as a value to a variable? |
19:50:45 | FromGitter | <zacharycarter> ah I see I just need to use double quotes around it |
19:50:57 | FromGitter | <Quelklef> ... but why |
19:51:59 | FromGitter | <zacharycarter> I'm writing a project for a hackathon at work in Nim. I need to hash some arbitrary data for the example, so I want to just use an emoji as the input data - so that I'm reviewing the code with non technical folks they will think - oh cute, that's a fox emoji! |
19:52:02 | FromGitter | <zacharycarter> I work for carfax btw |
19:52:07 | FromGitter | <zacharycarter> thus the fox emoji |
19:55:06 | FromGitter | <Quelklef> Ah |
19:55:21 | FromGitter | <Quelklef> also, I misread that as you wanting to use an emoji as an identifier which was partially why I was baffled |
19:56:42 | FromGitter | <zacharycarter> oh haha nope not htat |
19:56:45 | FromGitter | <zacharycarter> that* |
19:57:52 | FromGitter | <zacharycarter> actually, interestingly enough, `const 🦊 = "🦊"` is valid Nim code |
20:03:15 | * | natrys quit (Quit: natrys) |
20:05:19 | FromGitter | <Quelklef> Yessss that's how you know a language is well-made |
20:05:26 | FromGitter | <zacharycarter> right? |
20:05:46 | dom96 | !eval let 👑 = "Nim"; echo 👑 |
20:05:49 | NimBot | Nim |
20:05:52 | dom96 | :D |
20:07:54 | * | xet7_ is now known as xet7 |
20:14:33 | * | Trustable quit (Remote host closed the connection) |
20:24:10 | federico3 | valid... by design? |
20:24:46 | * | thor77 joined #nim |
20:26:25 | thor77 | Hey, i just started looking at nim a few days ago and so far I really like it. I'm already starting to mess with it's metaprogramming-features and got a question: Is there any way to generate (that seems to be possible) and execute a NimNode at runtime? |
20:27:57 | thor77 | I'm trying to implement something similar to this (http://howistart.org/posts/nim/1/index.html, brainfuck -> nim compiler) but would like to allow for dynamic input. is there any way to do that? |
20:28:43 | thor77 | If you need to see some code to understand my "problem", just let me know and I'll get smth together |
20:35:27 | FromGitter | <tim-st> does someone knows if `val != 0` is quicker than `val >= 0` when compiled? I'm asking because `>= 0` is used in `strutils`where `!= 0` can be used |
20:37:21 | dom96 | thor77: Whatever NimNode your macro returns will be included in your program and executed |
20:37:43 | dom96 | That's I suppose the fundamental way that macros work in Nim |
20:37:52 | thor77 | dom96: but if I use a macro, I can't give it runtime arguments, can I? |
20:38:00 | dom96 | yeah, you can't |
20:38:10 | thor77 | yeah, that's what i would like to do |
20:38:14 | dom96 | Your macro should generate code that acts on these arguments |
20:38:47 | thor77 | hm, that's hard in that case, i guess, because the generated code is dependent on the input |
20:39:24 | dom96 | If you want a BF -> Nim compiler then you need to supply the BF at compile-time |
20:39:43 | thor77 | there's no way arround that? |
20:40:50 | dom96 | Hrm, I guess you could create a procedure that generates NimNodes |
20:40:56 | dom96 | and then run that at runtime |
20:41:22 | dom96 | Not sure if that's allowed though |
20:42:31 | dom96 | But if your aim is to make a Brainfuck -> Nim -> Executable compiler then you may as well write a small wrapper CLI app that creates a new .nim file which calls your macro, then executes the Nim compiler on the .nim file. |
20:42:44 | dom96 | If that makes sense |
20:43:11 | thor77 | that makes sense, yeah, thank you :) |
20:44:04 | thor77 | i've already got a procedure generating a nimnode now, but i can't find a way to execute it |
20:44:16 | thor77 | so i could probably just write it's code to a file and execute that |
20:45:04 | thor77 | oh, it seems like newStmtList can only be called at compiletime |
20:46:19 | thor77 | so that doesnt work |
20:47:25 | FromGitter | <tim-st> I checked my question using: https://godbolt.org/ ; `!=` is quicker |
20:47:52 | dom96 | tim-st: by how much? |
20:47:59 | FromGitter | <tim-st> one op |
20:48:18 | FromGitter | <tim-st> but I'm not sure if my understanding of asm is correct |
20:48:29 | FromGitter | <tim-st> // Type your code here, or load an example. ⏎ int cmp1(int num) { ⏎ ⏎ ```return num != 0;``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a7cb79cce68c3bc7461c9da] |
20:57:59 | FromGitter | <tim-st> (at least on gcc; on clang they have the same number of operations) |
20:58:48 | * | clyybber joined #nim |
20:59:35 | * | clyybber quit (Client Quit) |
20:59:45 | * | clyybber joined #nim |
21:08:14 | FromGitter | <tim-st> Wow... I just noticed the gcc guys cannot reduce `>=` to `>` so `>=` has badder performance than `>` |
21:14:37 | * | rinzai quit (Ping timeout: 260 seconds) |
21:16:40 | * | scriptum quit (Quit: Leaving) |
21:28:07 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:30:00 | * | radagast_04 quit (Ping timeout: 256 seconds) |
21:32:54 | * | dddddd joined #nim |
21:45:23 | FromGitter | <Quelklef> Why would they be able to? |
21:45:38 | * | clyybber quit (Quit: good night) |
21:45:54 | * | dddddd quit (Quit: Hasta otra..) |
21:46:16 | * | dddddd joined #nim |
21:55:51 | FromGitter | <zacharycarter> is there any way to alias a type declared in another module being imported? |
21:56:14 | * | darithorn quit (Quit: Leaving) |
21:56:59 | FromGitter | <mratsim> `type Foo = ImportedFoo`? |
21:58:50 | FromGitter | <zacharycarter> hrm it's more to avoid namespace conflicts |
21:59:00 | FromGitter | <zacharycarter> I'm importing jester and it defines a REquest object |
21:59:17 | FromGitter | <zacharycarter> and asynchttpserver which I need to import to get the websocket package working, also declares a Request type |
21:59:31 | FromGitter | <zacharycarter> so the module names are causing a naming conflict when I'm using the routes macro jester provides |
22:01:55 | * | rinzai joined #nim |
22:06:10 | * | rinzai quit (Ping timeout: 240 seconds) |
22:07:39 | FromGitter | <zacharycarter> using - `from asynchttpserver import nil` and then fully qualifying everything works |
22:08:55 | * | solitudesf quit (Quit: solitudesf) |
22:09:22 | * | yglukhov joined #nim |
22:13:36 | * | yglukhov quit (Ping timeout: 252 seconds) |
22:14:43 | * | rinzai joined #nim |
22:31:52 | FromGitter | <Quelklef> I think you can do something like |
22:32:12 | FromGitter | <Quelklef> From X import Y excluding Z |
22:56:58 | FromGitter | <mratsim> or `import asynchttpserver as srv` and then `srv.request` |
23:01:36 | * | skrylar joined #nim |
23:19:04 | * | yglukhov joined #nim |
23:19:18 | * | gokr left #nim (#nim) |
23:23:27 | * | yglukhov quit (Ping timeout: 256 seconds) |
23:48:18 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |