00:00:25 | * | arnetheduck joined #nim |
00:07:22 | * | arnetheduck quit (Ping timeout: 260 seconds) |
00:08:00 | * | xkapastel quit (Quit: Connection closed for inactivity) |
00:12:39 | * | madpat quit (Read error: Connection reset by peer) |
00:12:41 | * | madpata joined #nim |
00:19:26 | * | gokr quit (Ping timeout: 276 seconds) |
00:19:37 | FromGitter | <Varriount> PMunch: What format is it parsing? |
00:20:31 | * | madpata quit (Quit: Have a good day! :)) |
00:22:05 | * | madpat joined #nim |
01:33:52 | * | xkapastel joined #nim |
01:43:02 | * | smt` quit (Ping timeout: 260 seconds) |
02:10:13 | * | vivus quit (Quit: Leaving) |
02:24:00 | * | MJCaley joined #nim |
02:35:17 | * | MJCaley quit (Quit: MJCaley) |
02:41:22 | * | chemist69 quit (Ping timeout: 260 seconds) |
02:55:01 | * | chemist69 joined #nim |
02:59:42 | * | couven92 quit (Quit: Client Disconnecting) |
03:08:06 | * | epr0xe joined #nim |
03:22:10 | * | endragor joined #nim |
03:36:20 | * | madpat quit (Ping timeout: 255 seconds) |
03:37:10 | * | madpat joined #nim |
03:41:53 | * | skrylar joined #nim |
03:48:08 | * | epr0xe quit (Remote host closed the connection) |
04:18:52 | * | endragor quit (Remote host closed the connection) |
04:19:21 | * | endragor joined #nim |
04:58:32 | * | dddddd quit (Remote host closed the connection) |
06:29:17 | * | planetis[m] quit (Ping timeout: 276 seconds) |
06:29:17 | * | Miguelngel[m] quit (Ping timeout: 276 seconds) |
06:29:31 | * | planetis[m] joined #nim |
06:29:32 | * | Miguelngel[m] joined #nim |
06:36:19 | * | SenasOzys joined #nim |
06:38:28 | * | nsf joined #nim |
07:03:34 | * | sz0 joined #nim |
07:26:35 | * | endragor quit (Remote host closed the connection) |
07:42:18 | * | BitPuffin|osx joined #nim |
07:50:25 | * | gokr joined #nim |
08:06:45 | * | endragor joined #nim |
08:08:20 | * | Vladar joined #nim |
08:34:02 | * | claudiuinberlin joined #nim |
08:40:22 | * | PMunch joined #nim |
08:54:48 | * | JappleAck joined #nim |
08:57:40 | * | vlad1777d joined #nim |
09:09:39 | * | floppydh joined #nim |
09:36:18 | * | madpat quit (Ping timeout: 268 seconds) |
10:02:07 | * | arnetheduck joined #nim |
10:07:23 | * | vlad1777d quit (Ping timeout: 255 seconds) |
10:29:46 | * | madpat joined #nim |
10:32:46 | FromGitter | <mratsim> @dom96 can't read the latest reply to https://forum.nim-lang.org/t/3295/2 |
10:34:04 | * | jjido joined #nim |
10:38:22 | dom96 | fixed |
10:38:35 | * | Vladar quit (Quit: Leaving) |
10:42:08 | * | madpat quit (Ping timeout: 276 seconds) |
10:44:49 | * | SenasOzys quit (Ping timeout: 248 seconds) |
10:47:56 | * | madpat joined #nim |
10:54:31 | * | SenasOzys joined #nim |
10:57:01 | * | jjido quit (Ping timeout: 240 seconds) |
11:22:06 | * | arecaceae quit (Remote host closed the connection) |
11:22:24 | * | arecaceae joined #nim |
11:27:56 | * | xkapastel quit (Quit: Connection closed for inactivity) |
11:28:44 | * | jjido joined #nim |
11:32:29 | FromGitter | <alehander42> https://www.mercurial-scm.org/wiki/OxidationPlan ah, that sounds like something that could be redone in Nim (some people already did python extensions/interop with nim and it should be much easier to pickup for people in a python codebase) |
11:32:38 | * | dddddd joined #nim |
11:57:44 | Araq | sure but people who start projects in Python+C don't deserve productivity, so Rust seems fine for them *cough* |
11:59:08 | Araq | mixed language development always was a pain for me, I don't understand why it's so popular. |
12:00:00 | * | skrylar quit (Remote host closed the connection) |
12:04:18 | * | elrood joined #nim |
12:05:11 | jjido | Well nim effectively encourages multi language dev |
12:05:21 | jjido | With C ffi |
12:09:32 | Araq | maybe, I beg to differ though. good interop just means you can use other libraries easily |
12:10:04 | Araq | not that you should continue to write C code, it's a legacy |
12:16:49 | * | salewski joined #nim |
12:17:00 | madpat | Why should one stop writing C code, if it enables the library to be used by different programming languages? |
12:17:53 | salewski | Yes, I hate mixed language development too, for example Ruby + C. |
12:18:33 | Araq | because it's an essentially an under specification of the program, is this really a pointer to a single element or a pointer to an array, is this zero terminated or not, is this 'int' actually a 'bool' |
12:18:43 | salewski | But I am still not sure how we can best support scripting with Nim, for example for a CAD tool. |
12:18:55 | * | Vladar joined #nim |
12:19:02 | Araq | there are plenty of languages that allow you to write native libraries. |
12:19:18 | salewski | People could write their scripts in Nim, but then they have to recompile full app. |
12:19:21 | Araq | C++, D with its "betterC" subset, Nim, Rust |
12:20:29 | salewski | I guess writing plugins would work with Nim? |
12:20:44 | Araq | "is this a natural number or does it depend on modulo arithmetic?" |
12:21:57 | Araq | salewski, if you use the "C-like" features of Nim, you can write a C-like plugin system. |
12:24:48 | salewski | Araq, does your NimEdit support scripting? |
12:24:58 | Araq | yeah, via NimScript |
12:25:20 | salewski | Ah, interesting. |
12:26:24 | salewski | Bye. |
12:26:27 | * | salewski quit (Quit: WeeChat 1.9.1) |
12:27:36 | * | Snircle joined #nim |
12:33:03 | * | couven92 joined #nim |
12:37:08 | * | madpat quit (Read error: Connection reset by peer) |
12:39:53 | * | madpat joined #nim |
12:58:18 | * | SenasOzys quit (Ping timeout: 260 seconds) |
13:00:57 | * | SenasOzys joined #nim |
13:01:28 | * | madpat quit (Read error: Connection reset by peer) |
13:02:50 | * | madpat joined #nim |
13:07:11 | * | madpat quit (Ping timeout: 255 seconds) |
13:07:45 | * | JappleAck quit (Ping timeout: 248 seconds) |
13:24:36 | * | JappleAck joined #nim |
13:37:43 | FromGitter | <kinokasai> Hey |
13:37:57 | FromGitter | <kinokasai> Is there a 1-bit type in Nim? |
13:38:41 | FromGitter | <kinokasai> Or do I have to use something akin to `nim-bitarray` to get a bit array? |
13:38:49 | * | natrys joined #nim |
13:44:13 | * | Jesin quit (Quit: Leaving) |
13:46:00 | * | MJCaley joined #nim |
13:47:28 | * | SenasOzys quit (Read error: Connection reset by peer) |
13:47:58 | * | SenasOzys joined #nim |
13:48:57 | FromGitter | <mratsim> 1-bit types are implementation dependant, not portable between x86, ARM, Mips, PowerPC, etc. |
13:49:20 | FromGitter | <mratsim> (and obviously JavaScript) |
13:50:04 | FromGitter | <kinokasai> Oh, okay |
13:51:47 | FromGitter | <mratsim> You can roll your own in 20 lines, see: https://github.com/mratsim/nim-projecteuler/blob/master/src/lib/bithacks.nim |
13:54:03 | FromGitter | <kinokasai> Hm. |
13:54:34 | FromGitter | <mratsim> (note, that was my very first Nim code so indentation is wrong, and some stuff are not idiomatic Nim). |
13:54:42 | FromGitter | <kinokasai> But then slices and such get tricky, don't they? |
13:55:08 | FromGitter | <mratsim> I never used nim-bitarray so can't comment on it. It seems to do much more than a simple bitarray. |
13:57:59 | FromGitter | <mratsim> I think nim-bitarray supports slices. |
13:57:59 | FromGitter | <kinokasai> Yeah, but only up to 64 bits long, I think |
13:59:42 | FromGitter | <kinokasai> Yes, that's also a solution. |
13:59:45 | FromGitter | <kinokasai> Thanks. |
14:04:18 | FromGitter | <RedBeard0531> What is the best way to go from a seq[char] or a pointer+len to a string? Is there anything better than newString() + copyMem? |
14:23:27 | def- | @RedBeard0531: $cast[cstring](foo) |
14:24:25 | FromGitter | <RedBeard0531> @def- it's not NULL terminated |
14:24:44 | def- | hm, doesn't seem to work anyway. yes, then copymem sounds reasonable |
14:27:04 | FromGitter | <RedBeard0531> @def- I think `$castcstring (addr foo[0])` would work if it was nul terminated. Although it is still kinda gross looking. |
14:27:29 | def- | yeah, exactly |
14:29:12 | def- | with copyMem you also have to access addr foo[0], so not much better |
14:31:14 | * | madpat joined #nim |
14:37:21 | FromGitter | <zetashift> @def- , selfish question but do you have plans for new blogposts?(nim or not nim related) |
14:37:31 | FromGitter | <zetashift> hopefully ofcourse nim related hehe |
14:46:19 | * | endragor quit (Remote host closed the connection) |
14:48:15 | * | endragor joined #nim |
14:52:27 | * | endragor quit (Ping timeout: 240 seconds) |
15:09:33 | * | nsf quit (Quit: WeeChat 1.9.1) |
15:11:21 | def- | @zetashift I have one waiting for review, but not nim related. not really using nim currently |
15:16:56 | * | MJCaley quit (Quit: MJCaley) |
15:23:17 | PMunch | kinokasai, what do you need a 1 bit type for? |
15:24:05 | crem | Sets can be at most 8 kilobytes in size, right? |
15:25:14 | * | MJCaley joined #nim |
15:35:00 | * | PMunch quit (Quit: Leaving) |
15:36:22 | * | Jesin joined #nim |
15:41:36 | Araq | crem, or 16kb can't remember. the limit mostly exists in order to keep people from doing set[int] |
15:42:26 | * | jjido quit (Ping timeout: 255 seconds) |
15:46:29 | crem | Is there a set with O(n) iteration (n is number of stored elements)? Basically tree-based, as std::set in C++. |
15:49:29 | FromGitter | <loongw> @Araq for https://github.com/nim-lang/Nim/issues/6860 ⏎ Here is a simple example: ⏎ https://play.nim-lang.org/?gist=968dbe0616b05e3f1ed98ad5fd401993 |
15:50:17 | * | SenasOzys quit (Ping timeout: 255 seconds) |
15:50:24 | Araq | so? Uid's definition is wrong |
15:50:33 | Araq | which is not an object |
15:51:48 | FromGitter | <loongw> So, it is not safe without --d:checkabi |
15:52:01 | Araq | crem, there are only hash sets and hashes of bitsets, trees are old fashioned |
15:53:16 | * | SenasOzys joined #nim |
15:53:22 | FromGitter | <RedBeard0531> @Araq what about intset and critbit? Aren't they (particularly fancy) trees? |
15:54:23 | Araq | loongw: -d:checkabi finds some serious bugs for the posix standard. I don't see the connection to the safety. |
15:54:43 | Araq | s/posix standard/posix module |
15:55:10 | Araq | it's not like you can use -d:checkabi, the code doesn't compile then |
15:59:59 | Araq | loongw: some parts in Nim deliberately underspecify the contents of some Posix structs though |
16:00:19 | Araq | because only some fields are accessed |
16:00:35 | Araq | so your check produces some false positives |
16:03:37 | FromGitter | <loongw> those deliberate cases should be marked with some flag to prevent abi checking |
16:06:25 | * | SenasOzys quit (Ping timeout: 248 seconds) |
16:08:12 | * | vivus joined #nim |
16:12:40 | * | jjido joined #nim |
16:16:09 | * | rbrt joined #nim |
16:18:35 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
16:21:07 | * | rbrt quit (Quit: Oíche mhaith) |
16:23:59 | Araq | it's marked with {.importc, header.} for a reason |
16:24:02 | Araq | it means "Import from the header" |
16:24:16 | Araq | what other annotation do you think should be used? |
16:24:36 | * | rbrt joined #nim |
16:30:37 | * | SenasOzys joined #nim |
16:37:14 | FromGitter | <loongw> marking with {.importc, header.} indicates only it's imported from c, lack some information that whether it should be keep the same size with C. sorry for my poor English! |
16:38:34 | FromGitter | <loongw> Anyway, the compiler should prevent this kind of bugs |
16:45:22 | FromGitter | <loongw> 'some parts in Nim deliberately underspecify the contents of some Posix structs though' ⏎ I mean this part should be marked to prevent them from being checked when -d:checkabi is defined |
16:47:38 | * | MJCaley quit (Quit: MJCaley) |
16:51:05 | * | rbrt quit (Quit: Oíche mhaith) |
16:53:28 | Araq | it always keeps the size with C. |
16:53:51 | Araq | -d:checkabi should ignore header'ed object type definitions |
16:57:03 | * | Lord_Nightmare joined #nim |
16:57:08 | * | miran joined #nim |
16:58:35 | FromGitter | <alehander42> araq: I thought the plan was for me to change the dsl for PR jsobject to `jsobject(x: int, y: bool)` before eventual merge |
17:01:21 | FromGitter | <loongw> So, the solution is '-d:checkabi should ignore header'ed object type definitions' and '-d:checkabi' should be default on ? |
17:05:45 | * | nsf joined #nim |
17:09:39 | * | Trustable joined #nim |
17:13:39 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:17:38 | * | MJCaley joined #nim |
17:24:07 | * | couven92 quit (Quit: Client disconnecting) |
17:30:45 | FromGitter | <Varriount> @loongw Perhaps, for header'd definitions, the only check should be if the Nim definition is larger? |
17:38:41 | GitDisc | <Lite5h4dow> hello |
17:41:10 | GitDisc | <Lite5h4dow> could i get some assistance? |
17:41:16 | GitDisc | <Lite5h4dow> im a little stuck |
17:41:34 | * | floppydh quit (Quit: WeeChat 1.9.1) |
17:41:51 | jjido | Just ask |
17:42:40 | GitDisc | <Lite5h4dow> im comming to nim from python (please dont stone me) |
17:43:07 | GitDisc | <Lite5h4dow> i know proc's arent the same as functions, but i dont know how to use them |
17:43:28 | GitDisc | <Lite5h4dow> im getting alittle stuck with the declaration of it |
17:43:34 | GitDisc | <Lite5h4dow> im getting alittle stuck with the declaration of the proc |
17:43:49 | GitDisc | <Lite5h4dow> im assuming it always has to return something. |
17:44:08 | jjido | Look at some examples it is not that different from Python |
17:44:10 | * | epr0xe joined #nim |
17:44:28 | FromGitter | <zetashift> it doesn't! https://nim-by-example.github.io/procs/ |
17:44:31 | GitDisc | <Lite5h4dow> im trying to understand it from nimbyexample |
17:44:36 | FromGitter | <zetashift> oh haha |
17:44:37 | GitDisc | <Lite5h4dow> yeah there |
17:44:39 | jjido | No it doesn't have to |
17:44:45 | GitDisc | <Lite5h4dow> does it not? |
17:45:07 | GitDisc | <Lite5h4dow> but atom throws exceptions at me |
17:45:19 | FromGitter | <zetashift> show the code |
17:47:27 | GitDisc | <Lite5h4dow> ```var |
17:47:28 | GitDisc | <Lite5h4dow> runProgram = false |
17:47:29 | GitDisc | <Lite5h4dow> programSelect = "Null" |
17:47:30 | GitDisc | <Lite5h4dow> config = ConfigTemp.new() |
17:47:32 | GitDisc | <Lite5h4dow> library = ApplicationLibrary.new() |
17:47:33 | GitDisc | <Lite5h4dow> |
17:47:34 | GitDisc | <Lite5h4dow> newFileStream("configs/root.yaml").load(config) |
17:47:36 | GitDisc | <Lite5h4dow> newFileStream("configs/appLibrary.yaml").load(library) |
17:47:37 | GitDisc | <Lite5h4dow> |
17:47:38 | GitDisc | <Lite5h4dow> proc'ApplicationLaunch'(): |
17:47:40 | GitDisc | <Lite5h4dow> if runProgram: |
17:47:41 | GitDisc | <Lite5h4dow> echo "program ", programSelect, "has been selected for launch" |
17:47:42 | GitDisc | <Lite5h4dow> |
17:47:43 | GitDisc | <Lite5h4dow> block mainLoop: |
17:47:45 | GitDisc | <Lite5h4dow> while true: |
17:47:46 | GitDisc | <Lite5h4dow> echo "enter input: " |
17:47:47 | GitDisc | <Lite5h4dow> var input = readLine(stdin) |
17:47:49 | GitDisc | <Lite5h4dow> for i in split(tolower(input)): |
17:47:50 | GitDisc | <Lite5h4dow> |
17:47:51 | GitDisc | <Lite5h4dow> if i in library.applist: |
17:47:53 | GitDisc | <Lite5h4dow> programSelect = i |
17:47:54 | GitDisc | <Lite5h4dow> |
17:47:55 | GitDisc | <Lite5h4dow> if i in config.disable: |
17:47:56 | GitDisc | <Lite5h4dow> echo "leaving loop" |
17:47:58 | GitDisc | <Lite5h4dow> break mainLoop |
17:47:59 | GitDisc | <Lite5h4dow> |
17:48:00 | GitDisc | <Lite5h4dow> if i in config.run: |
17:48:02 | GitDisc | <Lite5h4dow> runProgram = true |
17:48:03 | GitDisc | <Lite5h4dow> echo "Run's a Program" |
17:48:04 | GitDisc | <Lite5h4dow> |
17:48:06 | GitDisc | <Lite5h4dow> if i in config.interaction: <message clipped> |
17:48:07 | GitDisc | <Lite5h4dow> ```proc'ApplicationLaunch'(): |
17:48:08 | GitDisc | <Lite5h4dow> if runProgram:``` |
17:48:15 | GitDisc | <Lite5h4dow> those three lines are red |
17:48:22 | flyx | wtf, please use gist or something |
17:48:30 | GitDisc | <Lite5h4dow> sorry |
17:48:35 | GitDisc | <Lite5h4dow> im on the discord xD |
17:48:39 | GitDisc | <Lite5h4dow> hold on |
17:49:12 | flyx | hum, the other bridge to hows-it-called shortens code pastes |
17:49:22 | flyx | seems like the Discord one does not |
17:50:58 | FromGitter | <zetashift> @Lite5h4dow try https://play.nim-lang.org/ |
17:51:22 | flyx | anyway, should be `proc ApplicationLaunch():` instead of `proc'ApplicationLaunch'():` |
17:52:03 | dom96 | s/:/=/ |
17:52:31 | flyx | ah yes |
17:52:34 | flyx | missed that ^^ |
17:52:57 | flyx | btw, you do not need to initialize config or library, NimYAML does that for you |
17:54:13 | * | MJCaley quit (Quit: MJCaley) |
17:59:11 | FromGitter | <raydf> hi everyone |
18:00:06 | GitDisc | <Lite5h4dow> really? |
18:00:11 | GitDisc | <Lite5h4dow> i didnt know that |
18:00:44 | FromGitter | <raydf> Hi @Araq, i'm having an error running karax in android, when i try to use text "Activaci\243n" with the escaped latin character it gives decodeURIComponent "URI Malformed". Any idea how to fix this kind of error? |
18:01:09 | GitDisc | <Lite5h4dow> and why is it `proc ApplicationLaunch` instead of `proc 'ApplicationLaunch'` |
18:01:10 | * | MJCaley joined #nim |
18:03:17 | flyx | because the proc name is not a character literal, but an identifier. |
18:04:39 | flyx | you don't write `def 'ApplicationLaunch'():` in Python, do you |
18:05:57 | GitDisc | <Lite5h4dow> im assuming operators in nim dont specifically run commands then |
18:06:05 | GitDisc | <Lite5h4dow> also im still getting an error |
18:06:36 | flyx | well proc is not an operator. |
18:07:16 | GitDisc | <Lite5h4dow> https://play.nim-lang.org?gist=b8eead7035c533fc50fcb4ea6575955b |
18:07:18 | flyx | okay, I don't really understand what you mean by „operators don't specifically run commands“ |
18:07:43 | GitDisc | <Lite5h4dow> so in python i would use def's to run code that i didnt want to type multiple times |
18:08:05 | GitDisc | <Lite5h4dow> if it needed to be done multiple times, i put it in a def |
18:08:17 | GitDisc | <Lite5h4dow> i assumed that thats what operators were in nim |
18:08:35 | GitDisc | <Lite5h4dow> since the nim by example page shows them running operations |
18:08:42 | GitDisc | <Lite5h4dow> instead of just doing simple addition |
18:08:48 | GitDisc | <Lite5h4dow> and returning an integer |
18:09:03 | flyx | we need to pin down terminology a bit here |
18:09:50 | GitDisc | <Lite5h4dow> ok |
18:10:02 | flyx | „operator“ usually is the name for special procs like + in `1 + 2` |
18:10:12 | GitDisc | <Lite5h4dow> right |
18:10:16 | GitDisc | <Lite5h4dow> ok |
18:10:30 | GitDisc | <Lite5h4dow> that was a little confusing |
18:10:50 | FromGitter | <Varriount> Python has the same terminology. |
18:11:03 | flyx | procs and defs are very much the same. both can return values, but do not have to. both can have the purpose of calculating some result or executing some action or both |
18:12:16 | GitDisc | <Lite5h4dow> ok |
18:12:36 | GitDisc | <Lite5h4dow> so why is it complaining that i used an if statement after naming the proc |
18:13:09 | Miguelngel[m] | Hello, has at some point a syntax sugar to map `for var x in y` to `for x in y.mitems` like it does for the inmutable version considered for inclusion or thought about? |
18:14:19 | FromGitter | <Varriount> Lite5h4dow: In Nim, procedures go `proc name(arg: argType): returnType =` |
18:15:03 | FromGitter | <Varriount> Note the `returnType` between `:` and `=` |
18:15:39 | jjido | Use void if it returns nothing |
18:16:19 | GitDisc | <Lite5h4dow> right ok |
18:16:38 | GitDisc | <Lite5h4dow> i couldnt find anything that said anything about void |
18:17:11 | GitDisc | <Lite5h4dow> and say i want to use multiple arguments when i call the proc |
18:17:50 | flyx | well `: void` can be left out |
18:17:55 | GitDisc | <Lite5h4dow> would it go something like `proc name(arg: argType, arg2: arg2 Type): |
18:18:03 | flyx | yes |
18:18:39 | GitDisc | <Lite5h4dow> ok |
18:19:23 | GitDisc | <Lite5h4dow> and if i wanted to orun the proc would it be `name(argIn, argIn2)` |
18:20:11 | GitDisc | <Lite5h4dow> just making sure |
18:20:21 | GitDisc | <Lite5h4dow> because i have tard moments quite often |
18:20:46 | * | rbrt joined #nim |
18:20:48 | flyx | yep. just try to write a bit of code and see what happens |
18:22:39 | GitDisc | <Lite5h4dow> alrighty :3 thanks for the help guys |
18:22:48 | GitDisc | <Lite5h4dow> your much friendlier than stackoverflow |
18:23:50 | flyx | yeah well, SO is not really the place for learning languages |
18:28:24 | FromGitter | <Varriount> If you omit the return type, it has to end with `=`, not `:` |
18:29:33 | * | NimBot joined #nim |
18:30:13 | FromGitter | <alehander42> it always ends with `=`, `: void` can be skipped |
18:30:28 | * | claudiuinberlin joined #nim |
18:34:33 | * | rbrt quit (Quit: Oíche mhaith) |
18:35:01 | * | xkapastel joined #nim |
18:35:56 | FromGitter | <alehander42> btw there was some video before of a guy speeding up Python/or writing python extensions in Nim or something |
18:36:04 | * | rbrt joined #nim |
18:36:06 | FromGitter | <alehander42> does anybody know a link? |
18:36:16 | * | rbrt quit (Client Quit) |
18:36:36 | Araq | https://objective-see.com/blog/blog_0x24.html -- interesting read and once more a bug that can be blamed on the poor type system |
18:36:44 | Araq | of C. |
18:49:20 | FromGitter | <raydf> Thanks @Araq, fixed it with the help of your comment. |
18:49:56 | miran | is there a way to define a range which changes as the variable changes? |
18:50:19 | miran | e.g. myRange = range[-variable .. variable] |
18:51:42 | FromGitter | <zacharycarter> @alehander42 : https://2017.pygotham.org/talks/nim-a-new-option-for-optimizing-inner-loops/ |
18:53:49 | GitDisc | <Lite5h4dow> one more question |
18:54:13 | GitDisc | <Lite5h4dow> in python you can `if variable` and if it contains something then it will return true |
18:54:18 | GitDisc | <Lite5h4dow> can nim not do this? |
18:55:16 | FromGitter | <zacharycarter> No |
18:55:28 | FromGitter | <zacharycarter> you can check if a ref object is nil |
18:55:42 | FromGitter | <zacharycarter> and you can check if an object has been assigned a value |
18:55:45 | * | skoude joined #nim |
18:56:03 | GitDisc | <Lite5h4dow> im sotty what do you mean by ref object is nil? |
18:56:13 | GitDisc | <Lite5h4dow> i dont know coding terminoligy |
18:56:26 | FromGitter | <zacharycarter> might help to read through : https://nim-by-example.github.io/types/objects/ |
18:56:27 | GitDisc | <Lite5h4dow> i taught myself from reading other peoples code |
18:57:19 | GitDisc | <Lite5h4dow> oh right |
18:57:21 | GitDisc | <Lite5h4dow> hmm |
18:57:54 | GitDisc | <Lite5h4dow> not very n00b friendly |
18:58:09 | GitDisc | <Lite5h4dow> well ill work with it |
18:58:36 | FromGitter | <zetashift> Also PMunch explanation here helped me enormously: https://www.reddit.com/r/nim/comments/7dm3le/tutorial_for_types_having_a_hard_time/dpz9vue/ |
19:01:28 | GitDisc | <Lite5h4dow> ty |
19:05:00 | * | rbrt joined #nim |
19:05:06 | GitDisc | <Lite5h4dow> ooh |
19:05:29 | GitDisc | <Lite5h4dow> can proc's have multiple returns? |
19:05:51 | FromGitter | <zacharycarter> no |
19:05:55 | GitDisc | <Lite5h4dow> crap |
19:05:58 | FromGitter | <zacharycarter> but you can return tuples |
19:05:59 | GitDisc | <Lite5h4dow> ok |
19:06:00 | FromGitter | <zacharycarter> or objects |
19:06:07 | GitDisc | <Lite5h4dow> oooooooooooooooh |
19:06:12 | Araq | they can return a tuple or an Option[T] or ... |
19:06:13 | GitDisc | <Lite5h4dow> ok that gives me alot of options |
19:06:31 | GitDisc | <Lite5h4dow> do you have an example of a proce returning an object? |
19:06:36 | GitDisc | <Lite5h4dow> do you have an example of a proc returning an object? |
19:08:21 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=6e6ba3fe61416bfebf0d506db9ae1241 |
19:09:29 | FromGitter | <zacharycarter> or even more simple |
19:09:29 | * | Vladar quit (Quit: Leaving) |
19:09:45 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=aaccaeda94e201181682ca66765f1c76 |
19:14:50 | GitDisc | <Lite5h4dow> 10/10 ign |
19:15:44 | GitDisc | <Lite5h4dow> and what do i use instead of toLower , nim keeps saying is depreciated |
19:16:25 | FromGitter | <zacharycarter> toLowerAscii |
19:16:32 | FromGitter | <zacharycarter> https://nim-lang.org/docs/strutils.html#toLower,char |
19:17:16 | FromGitter | <zetashift> toLowerAscii |
19:17:18 | FromGitter | <zetashift> damn it! |
19:18:41 | Araq | or unicode.cmpIgnoreCase() == 0 |
19:18:50 | Miguelngel[m] | Bumping the question in case it was missed before: Has at some point a syntax sugar to map `for var x in y` to `for x in y.mitems` like it does now for the inmutable version considered for inclusion in the language? |
19:18:55 | Araq | toLower is a bad idea |
19:19:08 | Araq | Miguelngel[m], not really. |
19:20:10 | Araq | seems a nice idea |
19:26:58 | * | JappleAck quit (Quit: Leaving) |
19:27:35 | * | jjido quit (Ping timeout: 240 seconds) |
19:30:38 | GitDisc | <Lite5h4dow> Because im going to remember `unicode.cmpIgnoreCase() == 0` |
19:30:42 | GitDisc | <Lite5h4dow> xD |
19:42:27 | Araq | pretty sure you will, you already connected an emotion to it |
19:44:43 | * | rbrt quit (Quit: Oíche mhaith) |
19:45:11 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
19:59:57 | * | jjido joined #nim |
20:03:11 | * | skoude quit (Ping timeout: 255 seconds) |
20:07:27 | GitDisc | <Lite5h4dow> you sir have no social life( im assuming) xD |
20:09:25 | FromGitter | <RedBeard0531> @Araq I noticed unicode.cmpIgnoreCase() is using toLower rather than the full unicode case-folding rules from http://unicode.org/Public/UNIDATA/CaseFolding.txt. Would you accept a PR to do full case folding, or is the current behavior desired? |
20:09:30 | jjido | if you have Fecebook you are social |
20:10:18 | FromGitter | <zacharycarter> I abhor fb |
20:10:29 | FromGitter | <zacharycarter> so I guess I'm anti-social? |
20:10:30 | FromGitter | <zacharycarter> :P |
20:10:38 | Araq | RedBeard0531: PR please |
20:10:49 | jjido | yeah |
20:11:40 | FromGitter | <zetashift> Araq's only true friend is the Nim repo |
20:14:01 | * | epr0xe quit (Remote host closed the connection) |
20:14:48 | FromGitter | <alehander42> he just has to start enforcing one of those "emoji for each commit" methodologies |
20:17:26 | FromGitter | <RedBeard0531> @Araq which version of the unicode data files are currently used in nim? Should I just use the latest data file for case folding? |
20:18:10 | Araq | yeah please. |
20:18:28 | * | skoude joined #nim |
20:18:40 | Araq | currently we use Plan 9's tables from 1850 |
20:20:16 | Miguelngel[m] | 1850 was a good year for unicode. |
20:24:02 | Araq | more importantly, find a way to generated the Nim lookup tables from the unicode tables |
20:24:08 | Araq | *to generate |
20:25:17 | FromGitter | <RedBeard0531> Should be easy using slurp() |
20:26:47 | Araq | zetashift: Da ist noch was tief in mir drin, ein Schatten im Verstand, |
20:26:47 | Araq | es ist wie ein Teil von mir, es hat mich in der Hand. |
20:27:58 | dom96 | s/:/=/ |
20:28:13 | dom96 | ugh. Anyone familiar with rpath on mac os x? |
20:28:27 | FromGitter | <zacharycarter> dom96: kind of |
20:28:54 | dom96 | zacharycarter: I put all my sfml dylib's into a ./lib folder |
20:29:24 | dom96 | and set the DYLD_LIBRARY_PATH to lib, but it's complaining that it can't find "@rpath/libsfml-system.2.4.dylib" :\ |
20:31:08 | FromGitter | <zacharycarter> I know you can set rpath as a linker flag |
20:31:18 | dom96 | yeah. But what do I set it to? :) |
20:31:31 | Araq | set it to '.' |
20:31:55 | dom96 | Araq: Doesn't help |
20:32:11 | Araq | well change your cwd |
20:33:06 | FromGitter | <zacharycarter> `````` |
20:33:10 | FromGitter | <zacharycarter> is how I've generally done it |
20:33:58 | dom96 | again, I can set the rpath |
20:34:01 | dom96 | I don't know what to set it to |
20:34:21 | FromGitter | <zacharycarter> it's wherever the library is relative to your CWD |
20:34:29 | FromGitter | <zacharycarter> so I would imagine ./lib or ../lib would work |
20:36:19 | dom96 | I just tried setting it to the absolute path and it still refuses to work :\ |
20:36:31 | FromGitter | <zetashift> @Araq as I'm dutch and we had 3 years of german which I forgot most of I can only say you have something deep inside and it controls you? |
20:36:40 | FromGitter | <zacharycarter> wtf |
20:36:57 | FromGitter | <zacharycarter> did you try using an absolute path along with the library name? |
20:36:58 | FromGitter | <zacharycarter> like |
20:37:12 | FromGitter | <zacharycarter> -Wl,-rpath=/usr/local/lib/foo.dylib |
20:37:18 | FromGitter | <zacharycarter> that's the only other thing I can think to try |
20:37:25 | dom96 | omg |
20:37:32 | dom96 | It's because 2.4.0 exists but not 2.4 |
20:37:33 | dom96 | -.- |
20:37:35 | FromGitter | <zacharycarter> :P |
20:37:50 | FromGitter | <zacharycarter> why are you using shitty sfml anyway? |
20:39:56 | dom96 | What's wrong with sfml? |
20:39:58 | dom96 | it's awesome |
20:40:25 | FromGitter | <zacharycarter> meh - I just look at it lagging severely behind SDl2 |
20:40:29 | FromGitter | <zacharycarter> and GLFW3 |
20:40:42 | FromGitter | <zacharycarter> It also takes too much control over your game IMO |
20:40:47 | * | SenasOzys quit (Read error: Connection reset by peer) |
20:40:50 | FromGitter | <zacharycarter> and has poo support for mobile |
20:41:26 | dom96 | "Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype" |
20:41:38 | dom96 | this is really not fun when you're time constrained arghhhh |
20:44:49 | FromGitter | <zetashift> I still can't take of anything except shitty endless runners and some sheep herding game |
20:45:22 | * | SenasOzys joined #nim |
20:46:01 | * | couven92 joined #nim |
20:47:15 | Araq | btw what is OSX's equivalent of control-alt-del? |
20:48:06 | FromGitter | <zacharycarter> cmd + option + esc |
20:48:08 | FromGitter | <zacharycarter> to force kill an app |
20:48:52 | Araq | what's the option key? |
20:49:14 | Araq | shift? |
20:49:20 | FromGitter | <zacharycarter> no it's like the alt key on windows |
20:49:39 | FromGitter | <zacharycarter> in fact I think shift + option = alt |
20:49:46 | FromGitter | <zacharycarter> it's a clusterfuck if you ask me |
20:52:35 | Araq | well it's Apple. poor usability on top of a Unix. |
20:52:39 | * | miran quit (Quit: Konversation terminated!) |
20:53:20 | dom96 | You guys just haven't felt Steve's light. |
20:56:22 | FromGitter | <zacharycarter> I played a tiny bit with nim-godot this weekend and by that I mean I got an example project up and running |
20:56:34 | FromGitter | <zacharycarter> may play around with it more this evening and if my experiments go well I'll write a blog post about it |
20:58:20 | FromGitter | <zetashift> I tried it too but I couldn't figure out much(this is mostly cause I'm also a noob at godot), I wrote a small shmup in nimgame2 instead |
20:58:50 | FromGitter | <zetashift> weird I usually don't send double posts...also @zacharycarter looking forward to your writeup if it goes well |
21:02:09 | * | marenz_ joined #nim |
21:16:15 | * | MightyJoe is now known as cyraxjoe |
21:17:59 | * | qwertfisch is now known as cefhiqrstw |
21:21:36 | * | natrys quit (Read error: Connection reset by peer) |
21:27:26 | * | gokr quit (Ping timeout: 260 seconds) |
21:29:03 | FromGitter | <ephja> early access sheep herding simulator? |
21:32:15 | Araq | zacharycarter: what's your RTS doing? DoW 3 is so boring I stopped playing |
21:37:07 | * | vlad1777d joined #nim |
21:48:21 | dom96 | when htop crashes you know you're having a bad day |
21:49:11 | * | skoude quit (Ping timeout: 255 seconds) |
21:49:33 | * | skoude joined #nim |
21:50:21 | * | Trustable quit (Remote host closed the connection) |
21:53:35 | * | skoude quit (Ping timeout: 240 seconds) |
21:56:46 | Araq | anybody with an opinion on "Smart TVs"? |
21:57:17 | * | rbrt joined #nim |
22:00:07 | elrood | want to increase you household's hackability index or your personal surveillability? get one ;P |
22:02:48 | Araq | it's not for me :P. I know everything built on top of millions of lines of C code is as safe as dynamite in the open sun |
22:03:03 | elrood | nah, more seriously, if you're into netflixing etc. they're a nice thing to have, nothing you couldn't achieve with a settop-box as well though, apart from some usability benefits with an integrated solution |
22:04:29 | FromGitter | <zetashift> ^ agree |
22:06:41 | Calinou | <Araq> anybody with an opinion on "Smart TVs"? |
22:06:46 | Calinou | var opinion = "negative" |
22:07:15 | Calinou | but I never watch TV anyway (except when my parents watch it, therefore I also watch it) |
22:08:14 | FromGitter | <zetashift> Calinou, are you doing the LDJam? |
22:08:45 | Calinou | nope :( complete lack of time |
22:08:59 | FromGitter | <tim-st> When I have the choice between using const and let, is there one to prefer always? |
22:09:12 | Calinou | I made this, though: https://github.com/Calinou/godot-sponza |
22:11:45 | Araq | tim-st: when you have the choice, use 'const' |
22:13:08 | Calinou | it's a good idea to always use constants if possible, or immutable variables if constants are not possible |
22:13:12 | Calinou | (in any language) |
22:16:23 | FromGitter | <tim-st> Ok, thanks. One other question regarding source code and the compiler: I saw for example the lines `if not rune.isWhiteSpace() and firstRune: ... elif rune.isWhiteSpace():` couldn't this be simplified and if so is a modern compiler smart enough to do this? |
22:16:44 | elrood | someone should write a language which only provides SSA and no variables to prove the point, Calinou. i'm sure it would be a joy to use ;) |
22:21:06 | * | MJCaley quit (Quit: MJCaley) |
22:21:22 | Araq | elrood, huh? Haskell already exists ;-) |
22:21:38 | Calinou | elrood: SSA? |
22:21:51 | elrood | static single assignment |
22:21:52 | Calinou | also, when I meant "if possible", I mean "without having to modify other sections of your code" :) |
22:22:08 | Calinou | I see many people using "let" in ES2015 where they could use "const" |
22:22:19 | Calinou | (JetBrains IDEs will warn you about this) |
22:32:26 | * | klaver010110 quit (Quit: Connection closed for inactivity) |
22:34:06 | FromGitter | <zacharycarter> @Araq I got a pre-rendered sprite workflow down so I'm now deciding whether to build the engine myself or go with godot / ue4 / unity / whatever engine here |
22:36:08 | * | nsf quit (Quit: WeeChat 1.9.1) |
22:36:11 | Araq | build it yourself, we have another wrappers that -uhm- become abandoned |
22:36:17 | Araq | *we have enough |
22:36:34 | FromGitter | <zacharycarter> hehe truth |
22:37:03 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:37:33 | FromGitter | <zacharycarter> I'll work on some graphics tonight I think |
22:48:35 | * | maximpertsov quit (Quit: Connection closed for inactivity) |
22:50:05 | * | rbrt quit (Quit: Oíche mhaith) |
22:50:42 | * | Jesin quit (Quit: Leaving) |
22:53:02 | FromGitter | <barcharcraz> tim-st: I tend to use const for constants and var for everything else |
22:53:25 | FromGitter | <barcharcraz> let for stuff I can't put const on but is in a wide scope |
22:53:35 | * | rbrt joined #nim |
22:54:15 | FromGitter | <tim-st> Ok, thanks for your answers! |
22:55:54 | GitDisc | <Lite5h4dow> ok im getting the hang of procs now thanks to you guys |
22:56:12 | GitDisc | <Lite5h4dow> code is coming together nicely in an oop method that i have never used before |
22:56:20 | GitDisc | <Lite5h4dow> do have one question though |
22:57:20 | GitDisc | <Lite5h4dow> now im wrighting procs ina a file that hosts the procs for other running programs to access, however i have a main file that pulls the commands from the command bank, that wants to access a library |
22:57:35 | GitDisc | <Lite5h4dow> now the code is working the imports are becoming a mess |
22:58:56 | GitDisc | <Lite5h4dow> if im running a command from imported nim file 1, that takes the command form imported nim file 2, can impoerted nim file 2 access imported nim file 3's public variables? |
22:59:17 | * | skrylar joined #nim |
22:59:54 | FromGitter | <barcharcraz> If I understand the question correctly the answer is no |
23:01:21 | GitDisc | <Lite5h4dow> crap |
23:02:13 | GitDisc | <Lite5h4dow> crap, let me see if i can clarify it |
23:02:48 | GitDisc | <Lite5h4dow> ok core runtime application, imports a command from file 1, that needs a variable from imported file 2 |
23:04:23 | GitDisc | <Lite5h4dow> how can the imported command read the variable from imported file 2 |
23:05:06 | GitDisc | <Lite5h4dow> does that clear it up a little? |
23:09:46 | FromGitter | <zetashift> make a proc that returns that variable and make it so you can use it in another module? |
23:10:07 | FromGitter | <zetashift> putting a * behind the procs name |
23:14:55 | shashlick | dom96: I've finally added nimgen to the Nimble package.json, please approve the pull request |
23:19:25 | GitDisc | <Lite5h4dow> alrighty |
23:19:46 | GitDisc | <treeform> what is nimgen? |
23:21:38 | FromGitter | <zetashift> Probably this: https://github.com/genotrance/nimgen -> "Nimgen is a helper for c2nim to simpilfy and automate the wrapping of C libraries." |
23:24:25 | * | jjido quit (Remote host closed the connection) |
23:30:29 | shashlick | thanks @zetashift |
23:30:52 | shashlick | just updated the README to link to nimfuzz which is a fuzzy match wrapper |
23:34:25 | * | rbrt quit (Quit: Oíche mhaith) |
23:34:57 | * | rbrt joined #nim |
23:35:34 | GitDisc | <treeform> looks cool |
23:36:17 | * | rauss quit (Quit: WeeChat 1.9.1) |
23:36:38 | * | rbrt quit (Client Quit) |
23:37:43 | * | rauss joined #nim |
23:40:22 | * | jjido joined #nim |
23:40:50 | GitDisc | <treeform> flyx, are you around? I am using your YAML parser, but run into really strange things where it parses stuff incorrectly some times. (it gets values from different fields) But if i shuffle unrelated lines or change -d:release it parses correctly again. But I think I might be just loosing my mind. Not sure how to debug it. |
23:41:24 | flyx | treeform: can you show me an example? didn't want to sleep anyway |
23:41:56 | GitDisc | <treeform> I try to make a small example but it seems to only happen when results are really large. |
23:42:08 | GitDisc | <treeform> Small example everything works 100%. |
23:43:22 | GitDisc | <treeform> Here is the yaml it some times gets confused on: https://raw.githubusercontent.com/ua-parser/uap-core/master/tests/test_device.yaml |
23:44:16 | GitDisc | <treeform> Some times on line 15,648 it grabs fields from couple of lines bellow. |
23:45:44 | GitDisc | <treeform> for example it parsed the following entry as some thing completely different: |
23:45:45 | GitDisc | <treeform> https://gist.github.com/treeform/9e09a2f89f8f03d75ce69cb7816604ce |
23:46:02 | flyx | from the description it could be a bug in lexbase since the problem occurring only at large inputs hints to an issue with buffer refilling. otoh, I read most of lexbase and did't see any error |
23:46:25 | GitDisc | <treeform> interesting |
23:46:42 | GitDisc | <treeform> but why does adding or removing echo's change how it parses? |
23:46:47 | flyx | another possibility is that I am too eager with shallow string copying |
23:47:22 | flyx | however I can't imagine why that would only pop up on large inputs |
23:47:29 | GitDisc | <treeform> It appears its gets confused with many little strings are involved? |
23:48:17 | flyx | well it shouldn't. strings are managed by Nim's memory management. do you parse it into an in-memory data structure? |
23:48:27 | GitDisc | <treeform> yes |
23:49:20 | GitDisc | <treeform> Now that I know that you are listening. I can try to give you a better write up tomorrow, when you wake up? |
23:49:23 | flyx | might be worth looking at the event stream |
23:49:43 | flyx | can you drop it into an issue on GH? |
23:49:57 | flyx | I am usually at work during the day ;) |
23:50:54 | flyx | something you can do: compile tools/testSuiteEvents.nim . it compiles a binary that reads YAML from stdin and emits events |
23:51:22 | flyx | (the file is probably not part of the nimble install, you can fetch it from the GH repo) |
23:51:34 | * | def-pri-pub joined #nim |
23:51:50 | GitDisc | <treeform> I will produce a good issue for you. |
23:51:52 | flyx | you can inspect the output with grep or something and check whether the events have the correct string values there |
23:53:21 | GitDisc | <treeform> The funny thing if I just load yaml file by itself it loads correctly. |
23:54:00 | GitDisc | <treeform> The parse error is random but stable to a compiled binary. |
23:54:22 | GitDisc | <treeform> If I compile an binary the error will be in the same place. |
23:54:35 | GitDisc | <treeform> If I compile another binary it would be in a different place. |
23:54:50 | flyx | now that is definitely interesting |
23:54:52 | GitDisc | <treeform> Some times it works. |
23:55:06 | flyx | and definitely hard to debug |
23:55:09 | GitDisc | <treeform> It seems to be a dice roll during compile. |
23:55:27 | GitDisc | <treeform> You are doing doing any const rand() ? |
23:56:15 | flyx | nope |
23:56:35 | GitDisc | <treeform> Its like cosmic rays are hitting my computer. |
23:56:49 | GitDisc | <treeform> flipping bits |
23:57:09 | flyx | we are going to be rich and famos after we showed Nim can be used to detect cosmic rays. |
23:58:38 | * | Jesin joined #nim |