00:11:02 | * | theelous3_ quit (Ping timeout: 246 seconds) |
00:14:28 | clyybber | good night |
00:14:29 | * | clyybber quit (Quit: WeeChat 2.4) |
00:31:24 | * | rnrwashere joined #nim |
00:34:46 | cy1 | How do you strify something in a template? like let name: string = #name |
00:37:30 | FromGitter | <jrfondren> you can do that easily with a macro, and you can have the macro use a template for simplicity |
00:37:55 | FromGitter | <jrfondren> https://gist.github.com/jrfondren/829889fe6519118a71fb1ce76386e972 <- example of that |
00:38:54 | cy1 | yeah I know. Just hoped you could do it with only a template. |
00:44:01 | rayman22201 | you can pass a string to a template for a simple case: http://ix.io/1Is2/nim |
00:59:44 | * | ryanhowe joined #nim |
01:00:39 | * | ryanhowe quit (Client Quit) |
01:26:38 | * | shodan45 quit (Quit: No Ping reply in 180 seconds.) |
01:30:58 | * | shodan45 joined #nim |
01:32:59 | * | laaron- joined #nim |
02:00:17 | * | banc quit (Quit: Bye) |
02:02:35 | * | dddddd quit (Remote host closed the connection) |
02:08:28 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:10:16 | * | PrimHelios joined #nim |
02:11:43 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:12:13 | * | laaron joined #nim |
02:16:38 | * | PrimHelios quit (Quit: Leaving) |
02:22:14 | * | banc joined #nim |
02:43:39 | * | rnrwashere quit (Ping timeout: 248 seconds) |
02:51:05 | * | sacredfrog joined #nim |
02:56:35 | * | disruptek quit (Ping timeout: 246 seconds) |
02:59:52 | * | PrimHelios joined #nim |
03:00:30 | PrimHelios | I found a bug present in master that's fixed in devel. Should I send a PR to merge the bugfix, or just wait until the commit trickles into master? |
03:02:31 | * | disruptek joined #nim |
03:02:54 | * | sacredfrog quit (Quit: WeeChat 1.9.1) |
03:04:05 | shashlick | @narimiran usually backports devel fixes that are relevant into the version-0-19 branch which will become 0.19.6 in the near future |
03:10:36 | * | PrimHelios quit (Quit: Leaving) |
03:11:01 | * | PrimHelios joined #nim |
03:14:55 | * | SenasOzys quit (Ping timeout: 258 seconds) |
03:29:59 | FromGitter | <jrfondren> cd moe |
03:31:41 | * | PrimHelios quit (Quit: Leaving) |
03:31:52 | * | PrimHelios_ joined #nim |
04:24:08 | * | nsf joined #nim |
04:42:52 | * | narimiran joined #nim |
04:56:04 | * | cyberjpn joined #nim |
04:57:49 | shashlick | just added dynlib support to nimterop |
05:22:48 | cy1 | Man, how do you export a template, and also all the stuff it needs imported? |
05:23:13 | FromGitter | <jrfondren> you add a * to all that stuff yourself, I believe |
05:24:11 | cy1 | No, I mean you can't do "from X import Y" in the template, if it's ever used outside of top level. So anyone using your template is going to get an error like "Error: invalid pragma: async" when they never even used the async pragma. |
05:24:25 | cy1 | Or whatever stuff you needed imported. |
05:24:37 | FromGitter | <jrfondren> right. in that case the user has to also import async. |
05:24:52 | FromGitter | <jrfondren> there's no smart import or smart export |
05:25:06 | cy1 | Yeah, and just keep running the program repeatedly manually adding imports for each error. |
05:25:55 | cy1 | The language really could use smart import or export, or at least some way to bind imports to the template. |
05:26:31 | FromGitter | <jrfondren> you can even define a template that refers to identifiers that don't exist until after the module with the template is imported |
05:27:05 | cy1 | Or imports outside of top level. Those would be real nice too. Just import what you need inside the template code. |
05:30:58 | * | SHILL is now known as uptime |
05:36:30 | * | hoijui joined #nim |
05:41:04 | cy1 | When you create a generic procedure, that creates one procedure for each type, right? Like a template would? |
05:43:51 | leorize | cy1: there's a kind of symbol borrowing in the compiler iirc |
05:44:14 | leorize | since you don't have to export symbols for generic proc |
05:44:24 | leorize | you can always bind them explicitly via `bind` |
05:46:57 | cy1 | Oh, is that what bind is for...? |
05:46:59 | shashlick | @leorize: looking forward to your feedback on recent nimterop improvements |
05:47:15 | leorize | I'm taking a small break atm, so you'd have to wait |
05:47:44 | leorize | cy1: to force a symbol to be bound as early as possible |
05:48:14 | leorize | usually the compiler will bind symbols in template automatically (symbols taken at declaration site) |
05:48:30 | leorize | but sometimes it just doesn't do so, `bind` is to force that |
05:48:45 | shashlick | no rush, thanks in advance |
05:49:58 | cy1 | I'll mess with it, thanks leorize |
06:17:14 | * | traviss joined #nim |
06:20:51 | traviss | can anyone spot whats i'm doing wrong in this anonymous function from 'import sugar'? |
06:20:56 | traviss | echo @[(1, 2)].mapIt(((a, b)) => a+b) |
06:21:14 | cy1 | or I could refactor all the complicated logic into procedures like a smart person, and have simple templates that don't use imported symbols |
06:21:16 | traviss | Error: Incorrect procedure parameter list. |
06:22:32 | cy1 | traviss: doesn't mapIt have its own special mini-language, where you treat literally "it" as the item in the list? |
06:22:55 | cy1 | so like... @[(1,2)].mapIt(it[0] + it[1]) |
06:23:25 | traviss | oops, thanks. i forgot to switch back do map from mapit |
06:24:12 | cy1 | np |
06:24:41 | traviss | so there's no way to destructure the tuple like i was attempting? |
06:25:16 | traviss | i thought this would work but its not: echo @[(1, 2)].map(((a, b)) => a+b) |
06:27:22 | * | jasper_ joined #nim |
06:27:31 | cy1 | um... not sure. I don't know if Nim has a syntax for lambda sorts of things. |
06:28:16 | cy1 | proc (a,b: int) = and then newline is required |
06:30:05 | leorize | cy1: see sugar module |
06:30:34 | leorize | who needs special syntax when you have macros :P |
06:31:42 | traviss | i'm just messing around learning how to use sugar and destructuring |
06:32:12 | cy1 | ooh okay I've never used that |
06:32:52 | traviss | looks like the mapIt(it[0] + it[1]) is the easiest for this use case |
06:36:43 | * | zestyr quit (Ping timeout: 245 seconds) |
06:38:03 | * | PMunch joined #nim |
06:40:14 | * | zestyr joined #nim |
06:40:59 | narimiran | !eval import sugar; echo @[(1, 2)].map((a, b) => a+b) |
06:41:01 | NimBot | Compile failed: in.nim(1, 29) Error: attempting to call undeclared routine: 'map' |
06:41:12 | narimiran | !eval import sugar, sequtils; echo @[(1, 2)].map((a, b) => a+b) |
06:41:13 | NimBot | Compile failed: in.nim(1, 39) Error: type mismatch: got <seq[tuple of (int, int)], proc (a: GenericParam, b: GenericParam): untyped> |
06:56:52 | traviss | oh cool i didn't know nimbot could do that. this is what I was thinking might work, adding extra parens to indicate and destructure tuple |
06:57:02 | traviss | !eval import sugar; echo @[(1, 2)].map(((a, b)) => a+b) |
06:57:03 | NimBot | Compile failed: in.nim(1, 29) Error: attempting to call undeclared routine: 'map' |
06:57:31 | traviss | !eval import sugar, sequtils; echo @[(1, 2)].map(((a, b)) => a+b) |
06:57:32 | NimBot | Compile failed: ../nim/lib/pure/sugar.nim(87, 14) Error: Incorrect procedure parameter list. |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:05 | Araq | !eval import sugar, sequtils; echo @[(1, 2)].map((a, b)) => a+b) |
07:00:06 | NimBot | Compile failed: in.nim(1, 58) Error: invalid indentation |
07:00:13 | Araq | !eval import sugar, sequtils; echo @[(1, 2)].map((a, b) => a+b) |
07:00:15 | NimBot | Compile failed: in.nim(1, 39) Error: type mismatch: got <seq[tuple of (int, int)], proc (a: GenericParam, b: GenericParam): untyped> |
07:00:59 | Araq | ah you need tuple destructuring inside parameters |
07:01:00 | narimiran | traviss: hmm, i get errors even locally. i guess `mapIt` is after all your best option |
07:01:29 | Araq | !eval import sugar, sequtils; echo @[(1, 2)].map(a => a[0]+a[1]) |
07:01:31 | NimBot | @[3] |
07:01:57 | Araq | we could make => support destructuring... |
07:02:07 | traviss | yeah, i think parameter destructuring would be a great feature |
07:02:24 | narimiran | +1 |
07:02:26 | traviss | for the whole language |
07:02:43 | Araq | nah, it's a niche case but it would be fine for `=>` |
07:04:46 | * | gmpreussner joined #nim |
07:05:01 | narimiran | PMunch: is there any chance that Ctrl+/ could toggle comments on nim playground? |
07:06:40 | PMunch | Toggle comments? |
07:06:48 | PMunch | As in removing comments in the code? |
07:10:07 | narimiran | PMunch: `let a = 1`, ctrl+/, `# let a = 1`, ctrl+/, `let a = 1` |
07:10:38 | PMunch | Aah, for the editor |
07:14:50 | * | krux02 joined #nim |
07:15:47 | PMunch | Should be as easy as enabling Sublime keymap mode: https://codemirror.net/demo/sublime.html |
07:23:56 | * | hoijui quit (Ping timeout: 252 seconds) |
07:33:17 | * | solitudesf joined #nim |
07:39:15 | * | hoijui joined #nim |
07:43:57 | * | laaron quit (Remote host closed the connection) |
07:47:27 | * | laaron joined #nim |
07:54:57 | shashlick | @arnetheduck: just ran http://ix.io/1Itr/nim - llvm wrapper made with nimterop and got http://ix.io/1Itq/nim |
07:55:29 | shashlick | it compiles |
08:04:35 | * | cyberjpn quit (Ping timeout: 246 seconds) |
08:13:07 | FromGitter | <mratsim> wow awesome, I would need that in the future |
08:13:36 | FromGitter | <mratsim> Does LLVM C++ API compile as well? |
08:15:14 | * | Vladar joined #nim |
08:28:30 | * | krux02 quit (Remote host closed the connection) |
08:37:34 | * | NimBot joined #nim |
08:46:05 | WilhelmVonWeiner | so `rand` is considered to have side effects |
08:46:15 | WilhelmVonWeiner | which is quite annoying |
08:47:11 | * | dddddd joined #nim |
08:50:28 | narimiran | WilhelmVonWeiner: if that's in the context of "i can't have `func` if it has `rand` in it" - it is because `func` must always return the same output for the same input. that's not the case if it depends on `rand` |
08:51:05 | WilhelmVonWeiner | I get why, it's just kinda lame if reasonable |
08:51:08 | * | WilhelmVonWeiner shrugs |
08:52:23 | PMunch | It's not lame, it's correct.. |
08:52:56 | FromGitter | <mratsim> It doesn't have sde effect if you use initRand() and always pass the RNGState you just created |
08:53:19 | PMunch | Yeah, was just about to say |
08:53:28 | WilhelmVonWeiner | correct can totally be lame |
08:53:30 | PMunch | As long as the RNG state is passed in then it doesn't have side-effects |
08:54:35 | FromGitter | <mratsim> We call that law, lawyer and legal around here ;) |
08:56:10 | PMunch | https://play.nim-lang.org/index.html?ix=1ItC |
08:58:53 | FromGitter | <alehander42> I don't use func much |
08:59:26 | FromGitter | <alehander42> Is it possible for nim to somehow show me which procedures are pure anyway |
08:59:34 | FromGitter | <alehander42> Without trying to func them |
09:00:02 | FromGitter | <alehander42> So I can change them to func, something like atomic |
09:00:11 | FromGitter | <alehander42> Atomic |
09:00:16 | FromGitter | <alehander42> Autofix |
09:00:45 | FromGitter | <alehander42> Sorry |
09:02:44 | * | laaron quit (Remote host closed the connection) |
09:05:02 | WilhelmVonWeiner | well it does detect when {.noSideEffects.} is misapplied so it *could* |
09:05:11 | * | laaron joined #nim |
09:13:41 | * | stefanos82 joined #nim |
09:13:52 | * | jasper_ quit (Quit: Page closed) |
09:17:11 | * | cyberjpn joined #nim |
09:19:44 | * | clyybber joined #nim |
09:23:59 | * | theelous3_ joined #nim |
09:33:13 | FromGitter | <mratsim> @alehander42 I think the doc generator automatically tags it, along with "raises" |
09:33:18 | FromGitter | <mratsim> but I might be wrong |
09:50:17 | * | theelous3_ quit (Ping timeout: 246 seconds) |
09:51:30 | Mister_Magister | am i weird or telebot doesn't compile |
09:55:52 | * | cyberjpn quit (Ping timeout: 245 seconds) |
10:12:26 | * | JStoker quit (Ping timeout: 258 seconds) |
10:12:29 | Araq | https://docs.python.org/3/library/asyncio-task.html#generator-based-coroutines |
10:12:51 | Araq | oh look, Python got async slightly wrong and they deprecate something. |
10:14:46 | * | JStoker joined #nim |
10:16:29 | * | cyberjpn joined #nim |
10:20:26 | * | kapil____ joined #nim |
10:32:53 | clyybber | Araq: Now this is weird, I thought I just recently read how you really should use generators for async in python |
10:39:44 | FromGitter | <mratsim> I think it's more that they now have 2 ways of async and don't want to support 2 ways |
10:40:41 | FromGitter | <mratsim> since closure iterators in Nim can accept arguments while in the loop we could also implement an async lib on top. |
10:42:24 | Araq | huh? .async uses closure iterators |
10:43:57 | FromGitter | <alehander42> Arab do you see an actor library working with no gc |
10:44:10 | FromGitter | <alehander42> Just randomly asking not really on topic |
10:44:11 | Mister_Magister | can i update package with nimble? |
10:44:17 | Mister_Magister | or do i have to remove and reinstall it |
10:44:20 | FromGitter | <alehander42> But happened to.think about that these days |
10:45:29 | FromGitter | <alehander42> I feel like often actors can use a small constant part of memory which is then reused by new actors but maybe this isn't easy to automate |
10:46:14 | Araq | alehander42: I don't see any problems with it |
10:46:47 | Araq | you can have a container of all actors that "owns" the actors and when an actor dies, it unregisters from the container |
10:47:20 | Araq | maybe it doesn't win prizes in elegance but I don't see any major problems |
10:47:49 | clyybber | elegance is hiding everything in macros |
10:49:56 | narimiran | @mratsim: "Also while i < stop - IntSize: is cleaner" heh, i believed you there for a second ;) it is cleaner but it is "wronger" :D |
10:50:10 | solitudesf | Mister_Magister, just install it again, new version will get installed alongside |
10:50:59 | Mister_Magister | solitudesf: alongside but older will remain, useless garbage that only hold space right? |
10:51:18 | solitudesf | if you dont need it you can delete specific version |
10:51:37 | Mister_Magister | so uninstall and reinstall okay |
10:54:21 | FromGitter | <mratsim> @alehander42 this is basically an object pool |
10:54:47 | FromGitter | <mratsim> I think object pools should be in the standard lib btw |
10:56:06 | FromGitter | <mratsim> but when you use object pools you can't use {.noSideEffect.} anymore (or maybe Allocator would be an exception to that?) |
10:57:08 | * | cyberjpn quit (Ping timeout: 246 seconds) |
11:00:45 | clyybber | what syntax would you prefer for per-parameter bycopy/byref : |
11:00:46 | * | seni joined #nim |
11:00:51 | clyybber | proc monitorCecTraffic(a1: pointer, msg: cec_log_message {.bycopy.}): cint |
11:00:54 | clyybber | or: |
11:01:08 | clyybber | proc monitorCecTraffic(a1: pointer, msg {.bycopy.}: cec_log_message): cint = |
11:01:29 | clyybber | Araq: I guess the latter would be more consistent with the pragma after identifier rule? |
11:01:47 | Araq | mratsim: you can do {.noSideEffect.}: <stuff here> in devel |
11:02:26 | FromGitter | <mratsim> enven if it accesses a global var (the object pool?) |
11:02:39 | Araq | yeah, it's like a .gcsafe block |
11:02:55 | Araq | or like C++'s 'mutable' keyword |
11:03:36 | FromGitter | <mratsim> the {.myPragma.}: syntax always feel super weird but good |
11:07:33 | * | rnrwashere joined #nim |
11:12:27 | Araq | it's ugly by design |
11:12:37 | Araq | like 'cast', since it's an ugly thing to do |
11:12:40 | Mister_Magister | solitudesf: oh u answered in my issue. interesting |
11:12:59 | FromGitter | <mratsim> btw I'm re-reading the typedesc vs generics argument and stumbled upon that: https://github.com/nim-lang/RFCs/issues/40#issuecomment-381222385 ⏎ ⏎ > Bugs should not be taken as an argument unless the number of bugs justifies an argument like "these bugs indicate an overly complex design". ⏎ ⏎ While I don't think typedesc vs generics are at that breaking point, I think generics symbol early resolution is: |
11:12:59 | FromGitter | ... https://github.com/nim-lang/Nim/issues/8677. ... [https://gitter.im/nim-lang/Nim?at=5cd40b3bf251e60ffa4fdb74] |
11:13:04 | FromGitter | <mratsim> seems fair |
11:14:04 | FromGitter | <mratsim> I didn't try yet but I'm sure cooldome will have issue in his "reset" destructors PR: https://github.com/nim-lang/Nim/pull/11206#discussion_r282379786 |
11:15:24 | Araq | mratsim: I've read it and don't understand your point |
11:15:29 | FromGitter | <mratsim> Imo it can wait after 1.0, but it seems to be a daunting task to refactor the generics/static/typedesc semchecks |
11:16:03 | Araq | the problem with generics is that we don't type-check them. concepts would be our way out if they would be ... type-checked. |
11:16:40 | Araq | all the guesswork with symbol bindings etc comes from the fact that we don't typecheck generic procs. |
11:16:54 | FromGitter | <mratsim> The point is that all kind of things that work in normal procs, don't in generics (see {.this:.} the issues we had in strformat and several other linked issues |
11:17:24 | * | Araq shrugs |
11:17:47 | Araq | strformat is a heavy macro, macro systems always have composability problems |
11:18:16 | FromGitter | <mratsim> Async also has issues. |
11:18:43 | FromGitter | <mratsim> We shouldn't say "macro"/generics are second-class citizens |
11:19:31 | Araq | they are not, but they are intrinsically more complex than non-generic code |
11:19:57 | Araq | that's just the reality in every language that does offer generics |
11:20:46 | FromGitter | <mratsim> I agree. What I'm saying is that in the future, we will have more people stumbling on those. |
11:22:14 | FromGitter | <mratsim> Assuming we want macro to be a blessed way to expand the language (like async) instead of implementing things in the compiler, I think it's a important problem to solve. |
11:22:33 | Araq | well be my guest and come up with "better" rules for what defaults to a mixin/bind binding |
11:23:03 | Araq | krux02 is also thinking about this problem :P |
11:23:11 | FromGitter | <mratsim> Do you have a functional description of the rules? Can you addd them in the meta issue? |
11:23:24 | Araq | it's written down in the manual |
11:23:30 | FromGitter | <mratsim> I have nightmares about this problem :p |
11:24:01 | Araq | I was happy when my set rules seemed to worked better than C++'s while at the same time being less complex |
11:24:12 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
11:24:25 | Araq | :P |
11:24:35 | FromGitter | <mratsim> well give a hand and people ask for an arm |
11:25:59 | Araq | what we need to do: attach procs to types. typecheck generics. leave room for 'untyped' code so that I can use $ on my generic T that wasn't specified to offer $ so that I can debug generic code |
11:26:18 | * | kapil____ is now known as kapil_ |
11:26:26 | * | laaron joined #nim |
11:26:31 | Araq | that's not a design we can do for v1 |
11:26:58 | Araq | bbl |
11:27:32 | Araq | oh and let me be clear that "attach procs to types" requires no syntax change, relax, we don't need a 'class' keyword. |
11:28:55 | FromGitter | <mratsim> I agree that it should be for after v1 |
11:30:52 | * | vlad1777d_ quit (Ping timeout: 245 seconds) |
11:32:57 | Mister_Magister | when i'm trying to run "choosenim devel" i'm getting "Unable to extract. Error was 'Permission denied" |
11:34:50 | * | kapil_ is now known as kapilp |
11:36:27 | FromGitter | <mratsim> did you run choosenim as root initially? |
11:59:43 | * | Snircle joined #nim |
12:13:51 | * | sacredfrog joined #nim |
12:14:26 | * | sacredfrog quit (Client Quit) |
12:17:07 | * | cyberjpn joined #nim |
12:24:45 | * | sacredfrog joined #nim |
12:31:42 | * | abm joined #nim |
12:33:53 | * | sacredfrog quit (Quit: WeeChat 1.9.1) |
12:42:48 | * | sacredfrog joined #nim |
12:43:49 | * | sacredfrog quit (Client Quit) |
12:45:59 | * | sacredfrog joined #nim |
12:49:11 | * | rnrwashere quit (Remote host closed the connection) |
12:49:45 | * | laaron- joined #nim |
12:49:47 | * | laaron quit (Remote host closed the connection) |
12:53:09 | shashlick | @mratsim - about llvm wrapper, that's just the C wrapper, nimterop still doesn't know c++ |
12:54:53 | FromGitter | <mratsim> ok, very nice nonetheless |
12:54:56 | shashlick | But I really don't know since I just referred to the build script @arnetheduck has in his nlvm repo |
12:59:18 | Araq | shashlick: has the nimble regression been fixed that andreaferretti reported? |
13:02:18 | zestyr | Araq: did you have a look at the boehm issues on your Linux vm? |
13:03:03 | shashlick | Yes Araq, the issue with recursive calls is fixed |
13:17:41 | clyybber | Araq: I'm working on allowing per-parameter bycopy and byref pragmas. I cant add the tfByCopy/tfByRef flags to the type of the parameter though, or it will affect the type everywhere. Should I introduce new sym flags or can I somehow copy the type and add the tfByCopy/tfRef flags to the copy? |
13:18:49 | * | ng0 joined #nim |
13:19:13 | Araq | clyybber: the last thing we need is more tyAlias bullshit types with different flags so that you don't affect the existing types, as you noticed |
13:19:42 | Araq | however, per-parameter bycopy and byref pragmas cannot work for proc pointers |
13:22:52 | clyybber | Ok, I will try the sym flag method |
13:23:01 | clyybber | Why can it not work for proc pointers? |
13:23:38 | Araq | type Foo = proc (x: T) # compatible with proc f(x {.bycopy.}: T) ? |
13:23:55 | Araq | this feature is not thought-through, sorry. |
13:24:00 | clyybber | yeah, fair enough |
13:27:28 | Mister_Magister | are there symbols for and, is etc operators? and how to compare strings? |
13:28:44 | narimiran | Mister_Magister: "a" < "b" |
13:29:34 | Mister_Magister | narimiran: but how do i check if they are equal? |
13:29:47 | narimiran | Mister_Magister: "a" == "b" |
13:31:17 | Mister_Magister | narimiran: and is there character for and? like &&? |
13:31:25 | narimiran | nope, you use `and` |
13:31:34 | Mister_Magister | thanks! |
13:31:44 | Mister_Magister | can i cast type to string? |
13:33:01 | FromGitter | <jrfondren> just use `$` |
13:33:08 | Mister_Magister | $? |
13:33:22 | FromGitter | <jrfondren> the operator. `echo $int` f.e. |
13:33:47 | FromGitter | <jrfondren> if you want to get the type of something to then get the string of that type, the typetraits module has type() |
13:34:05 | FromGitter | <jrfondren> so `echo $type(42)` |
13:34:23 | narimiran | Mister_Magister: we could be more helpful if you tell us more precisely what are you trying to achieve |
13:34:25 | FromGitter | <jrfondren> (typetraits it also where I got the `int` from) |
13:35:11 | Mister_Magister | narimiran: just learning stuff i have unknown object with unknown type that i know is text and i want to check if there is "whatever" in it |
13:35:29 | FromGitter | <jrfondren> "unknown type that i know is text"? |
13:35:51 | Mister_Magister | ye ye it comes from telebot lib |
13:36:07 | FromGitter | <jrfondren> I have no idea what you mean. |
13:36:13 | narimiran | neither do i |
13:36:43 | narimiran | btw, you can do `"whatever" in myText` |
13:36:51 | Mister_Magister | can i? |
13:36:54 | Mister_Magister | thanks |
13:37:04 | Mister_Magister | rhanks also for type thingy, now i know it's string |
13:37:19 | Mister_Magister | sorry for being hard to understand |
13:37:19 | narimiran | see, that's why i told you to ask precisely. https://en.wikipedia.org/wiki/XY_problem |
13:37:41 | Mister_Magister | narimiran: i tried but u didn't understand "/ |
13:37:44 | Mister_Magister | :/ |
13:37:46 | FromGitter | <jrfondren> !eval "whatever" in "this string contains whatever" |
13:37:47 | NimBot | Compile failed: in.nim(1, 12) Error: type mismatch: got <string, string> |
13:38:02 | narimiran | !eval echo "whatever" in "this string contains whatever" |
13:38:03 | NimBot | Compile failed: in.nim(1, 17) Error: type mismatch: got <string, string> |
13:38:23 | FromGitter | <jrfondren> ah it's in strutils |
13:38:31 | Mister_Magister | narimiran: doesn't seem to be working :P |
13:38:43 | solitudesf | import strutils |
13:38:47 | narimiran | !eval import strutils; echo "whatever" in "this string contains whatever" |
13:38:49 | NimBot | true |
13:39:01 | narimiran | Mister_Magister: :P |
13:40:54 | Mister_Magister | thanks |
13:43:59 | Mister_Magister | what is Option type? |
13:45:00 | * | nsf quit (Quit: WeeChat 2.4) |
13:45:00 | narimiran | https://nim-lang.github.io/Nim/options.html "types which encapsulate an optional value" |
13:45:41 | Mister_Magister | ohhh thanks |
13:57:31 | * | banc quit (Ping timeout: 246 seconds) |
13:59:49 | * | PMunch quit (Remote host closed the connection) |
14:03:29 | * | banc joined #nim |
14:04:50 | Mister_Magister | hmm nim backtraces are so unreadable. i can't even read on which line there is problem |
14:04:53 | FromGitter | <mratsim> https://en.wikipedia.org/wiki/Option_type, also called Maybe in some languages |
14:05:18 | FromGitter | <liquid600pgm> they're as simple as it gets |
14:05:26 | FromGitter | <liquid600pgm> `file.nim(line) proc` |
14:05:27 | FromGitter | <mratsim> Really? what language are you coming from? I prefer nim stacktraces to Python or Java. |
14:06:01 | Mister_Magister | when i'm trying to just "echo "whatever"" i'm getting Can't obtain a value from a `none` |
14:06:48 | Mister_Magister | mratsim: from c/c++/php |
14:07:05 | FromGitter | <mratsim> !eval import options; echo Option() |
14:07:06 | NimBot | Compile failed: in.nim(1, 28) Error: object constructor needs an object type |
14:07:19 | FromGitter | <mratsim> !eval import options; echo Optionint () |
14:07:20 | NimBot | Compile failed: in.nim(1, 22) Error: undeclared identifier: 'Optionint' |
14:07:27 | FromGitter | <mratsim> !eval import options; echo Option\int\ () |
14:07:28 | NimBot | Compile failed: in.nim(1, 32) Error: undeclared identifier: '\' |
14:07:34 | Mister_Magister | !eval echo "whatever" |
14:07:36 | narimiran | mratsim, your brackets are eaten on irc |
14:07:36 | NimBot | whatever |
14:07:38 | FromGitter | <mratsim> well, can't use generics with GItter |
14:07:38 | FromGitter | <liquid600pgm> painful |
14:07:42 | Mister_Magister | hm |
14:08:13 | narimiran | Mister_Magister: " when i'm trying to just "echo "whatever"" i'm getting Can't obtain a value from a `none`" --> read the options module link i've sent you earlier |
14:08:20 | Mister_Magister | i'm doning something wrong that i don't even know what yet |
14:08:26 | Mister_Magister | oh okay |
14:08:44 | Mister_Magister | narimiran: if i had an line for "Can't obtain a value from a `none`"" that would be easier |
14:09:05 | narimiran | Mister_Magister: nah, you still wouldn't read provided links :P |
14:09:10 | FromGitter | <mratsim> from a none Option would be better |
14:09:21 | * | Mister_Magister blushes |
14:10:48 | * | cyberjpn quit (Ping timeout: 258 seconds) |
14:11:32 | * | Trustable joined #nim |
14:12:11 | FromGitter | <alehander42> hm |
14:12:40 | Mister_Magister | okay fixed, thanks everybody |
14:13:41 | clyybber | Araq: Can you merge https://github.com/nim-lang/Nim/pull/11210, I accidently did that on my devel branch, and don't want to retrigger the CI wastefully when rebasing |
14:14:38 | Araq | clyybber: I don't like this parser extension. what's so hard about using a single doc comment? |
14:15:30 | clyybber | ah, nothing, mratsim figured it should work so I just went with it |
14:22:16 | Araq | https://github.com/nim-lang/Nim/labels/Showstopper are important bugs that require your attention :-) |
14:28:52 | FromGitter | <mratsim> yeah I broke Github review system on your PR @narimiran |
14:29:22 | narimiran | @mratsim it's not your day, is it? :D first that wrong logic, now this.... :D :D |
14:29:42 | FromGitter | <mratsim> off by one are tricky to spot :P |
14:29:55 | narimiran | that's why you were off by two :D |
14:30:10 | clyybber | two wrongs make one right, ... right? |
14:31:09 | FromGitter | <mratsim> C+ was one wrong, C++ is 2 wrongs? So??? |
14:34:10 | * | PrimHelios_ quit (Quit: ZNC 1.7.3 - https://znc.in) |
14:34:32 | clyybber | C++ is always right, it can look into the void* |
14:34:40 | * | PrimHelios joined #nim |
14:36:42 | clyybber | mratsim: Good point there; https://github.com/nim-lang/Nim/pull/11203#pullrequestreview-235622993 |
14:37:08 | FromGitter | <mratsim> I can't delete it :/ |
14:37:16 | clyybber | :P |
14:45:24 | FromGitter | <jrfondren> if I define a $ for an object type, can I still access the default stringification of the object? I want to normally use a pretty representation, but have the option of seeing the 'raw' view |
14:47:28 | leorize | use repr() for that |
14:47:33 | clyybber | Araq: https://github.com/nim-lang/Nim/issues/9825 seems to be fixed |
14:47:43 | leorize | the default `$` for object is terrible |
14:47:55 | narimiran | clyybber: :D :D |
14:48:01 | Araq | jrfondren. you can call system.`$`(x) |
14:48:34 | FromGitter | <jrfondren> ah ty |
14:48:59 | Araq | clyybber: compile with -d:useSysAssert -d:useGcAssert |
14:49:07 | Araq | I bet it's still wrong |
14:49:11 | clyybber | ok, will do |
14:49:22 | leorize | Araq: repr doesn't seem to work with newruntime |
14:49:39 | Araq | leorize: it's not ported |
14:49:46 | * | rnrwashere joined #nim |
14:50:04 | Araq | and I won't port it either, repr sucks and we should focus on important things |
14:50:15 | Araq | like ... ensuring closures do work with --newruntime |
14:54:19 | * | rnrwashere quit (Ping timeout: 276 seconds) |
14:55:10 | clyybber | Araq: works with -d:useSysAssert -d:useGcAssert too. The only weird thing is that repr doesn't print a `@` on a seq which was converted from an array |
14:55:24 | narimiran | Araq: is https://github.com/nim-lang/Nim/issues/1286 still an open issue? i tried to reproduce it with some similar object and it compiles and runs both on stable and devel: https://play.nim-lang.org/index.html?ix=1IuX |
14:56:03 | Araq | narimiran: yes, it's still an issue |
14:56:48 | narimiran | then i over-simplified my example, i guess |
15:12:02 | clyybber | Araq: Fixing those out of order evaluations would require injecting temporaries in almost every case, as we can't anticipate the possible side effects of x = X(v: f(x.v)) |
15:12:27 | clyybber | I think the C compiler will optimize those away, just making sure that this is the intended way to fix it right? |
15:12:59 | * | Minimisthupper quit (Quit: Connection closed for inactivity) |
15:15:20 | FromDiscord_ | <hqm32> Hi! How do I parse a JSON string containing reserved words like `object` as keys and marshal it to a pretty data type? I need something like this: `jsonString.parseJson.to(MyResponseType)`. Thank you in advance! |
15:19:46 | shashlick | @narimiran I think the staticExec issue should be closed |
15:20:06 | narimiran | shashlick: me too, but i wanted to ask first |
15:20:19 | shashlick | Didn't someone add staticExecEx as well? |
15:20:21 | Araq | clyybber, no, the codgen should do an alias analysis check |
15:20:30 | shashlick | Synonym of gorgeEx |
15:20:40 | Araq | the temps are only required if there is a possible aliasing |
15:20:49 | Araq | we have code dealing with AA |
15:22:38 | narimiran | shashlick: it was an idea, but it isn't in index, so i guess gorgeEx is the only one |
15:22:56 | narimiran | (and IMO it is enough) |
15:23:18 | clyybber | Araq: Ok, does the alias analysis check also consider accessing globals as opposed to params? |
15:23:30 | clyybber | like: x = X(v: f) |
15:23:55 | clyybber | with: proc f():int = x.v |
15:28:27 | FromDiscord_ | <treeform> @hqm32 you can't use the .to() function and you have to do it manually by walking the json structure and populating your own data structure. |
15:29:11 | FromDiscord_ | <treeform> I wish to() had more features like key renaming and default key values but it does not. |
15:32:28 | shashlick | Agreed |
15:37:46 | Araq | clyybber, kind of, yes |
15:38:13 | * | PMunch joined #nim |
15:39:46 | * | PMunch_ joined #nim |
15:42:51 | * | PMunch quit (Ping timeout: 248 seconds) |
15:45:33 | * | seni quit (Quit: Leaving) |
15:45:45 | FromGitter | <alehander42> I wish I can map end |
15:45:50 | FromGitter | <alehander42> Ops |
15:45:52 | FromGitter | <alehander42> Nqma |
15:45:55 | FromGitter | <alehander42> Nqma |
15:51:35 | * | PMunch joined #nim |
15:53:35 | * | PMunch_ quit (Ping timeout: 246 seconds) |
15:56:16 | * | PMunch_ joined #nim |
15:57:40 | * | PMunch quit (Read error: Connection reset by peer) |
16:01:53 | * | laaron- quit (Remote host closed the connection) |
16:04:48 | * | laaron joined #nim |
16:06:53 | * | laaron quit (Remote host closed the connection) |
16:09:14 | FromGitter | <iffy> Is there an asyncnet equivalent to `recvFrom`? I want to make an async UDP server: https://nim-lang.org/docs/net.html#recvFrom%2CSocket%2Cstring%2Cint%2Cstring%2CPort%2Cint32 |
16:09:25 | * | laaron joined #nim |
16:10:19 | cy1 | iffy: check recvFromInto in asyncdispatch. Haven't looked to see if that's what you want, but... |
16:10:54 | FromGitter | <iffy> I think that might be it; let me try |
16:14:00 | FromGitter | <iffy> It wants me to provide an `AsyncFD` but I only have an `AsyncSocket`... |
16:14:16 | cy1 | asyncnet's kind of weird, since asyncdispatch is the real "asyncnet," and asyncnet is just some extra networking stuff that uses asyncdispatch. |
16:14:36 | * | laaron quit (Remote host closed the connection) |
16:14:39 | FromGitter | <iffy> so should I try to just use asyncdispatch? |
16:14:47 | cy1 | iffy: See newAsyncNativeSocket in asyncdispatch |
16:15:19 | cy1 | asyncnet has stuff like buffering, so it's not entirely useless. I haven't yet made use of it though... |
16:16:27 | cy1 | you can get the AsyncFD with asyncdispatch.newAsyncNativeSocket, then get an AsyncSocket for it with asyncnet.newAsyncSocket, if you need both. |
16:17:02 | FromGitter | <iffy> I'm just trying to make a echo UDP server |
16:17:08 | * | laaron joined #nim |
16:17:35 | cy1 | yeah I've never uh... done that |
16:17:45 | cy1 | so maybe asyncnet is useful |
16:17:57 | FromGitter | <iffy> I mean; a dummy UDP server (send it a string, it sends it back) |
16:18:05 | FromGitter | <iffy> a hello world |
16:19:25 | cy1 | in particular, asyncdispatch uses raw pointers, which don't increment any reference counters, so if you pass a buffer to asyncdispatch.send, then await on that, the buffer could get collected before anything gets sent, without using GC_ref to hold onto it. |
16:19:30 | euantor | IIRC, UDP isn't properly supported in asyncnet |
16:21:48 | cy1 | I dunno what "properly" is supposed to mean. UDP is basically... some funny socket options, not caring if the other side knows you're connected, and expecting anything you send to be potentially dropped and/or out of order. What needs to be done to support that? |
16:26:54 | euantor | I mean that there's no easy `sock.recvFromAsync` for an `AsyncSocket` |
16:27:22 | euantor | I'm not sure why it's not there, but it isn't. I also went looking for it in the past |
16:29:05 | * | nsf joined #nim |
16:31:48 | FromGitter | <arnetheduck> shashlick thats very cool! those llvm headers have plenty of nasty surprises lurking, specially the target-dependent stuff - for now, I've been dealing with it manually but editing that header file is somewhat annoying |
16:32:18 | BitPuffin | hmm can you somehow use nimscript as a library within nim? |
16:33:44 | leorize | yea |
16:33:54 | leorize | nimble used to do that until recently |
16:34:48 | FromGitter | <arnetheduck> re comment styles, it would be really nice to have something better for field comments - placing the comment on the same line is ugly (no room to write a *useful* comment), and the hack with `##\` is annoying |
16:35:21 | disruptek | here's a lib demonstrating UDP, but it's not async: https://github.com/treeform/netpipe/ |
16:35:24 | FromGitter | <arnetheduck> ```field: Type ⏎ ## comment``` ⏎ ⏎ feels pretty natural with the rest of the language (indent it) [https://gitter.im/nim-lang/Nim?at=5cd456cc56271260f9326ab8] |
16:38:31 | BitPuffin | leorize: that's good, I was just not finding it in the library reference or anything, but I guess you could still pull it in as a library even if it's not part of "standard" library :p |
16:40:32 | leorize | arnetheduck: I used that syntax for document const |
16:40:38 | leorize | it doesn't work for fields? |
16:42:12 | FromGitter | <arnetheduck> apparently not - https://nim-lang.org/docs/docgen.html#introduction-documentation-comments |
16:42:36 | FromGitter | <arnetheduck> it's quite annoying the way docs and comments are handled in the AST, leads to these quirks |
16:44:05 | * | PMunch joined #nim |
16:45:22 | dom96 | euantor: It's not there because I didn't need it, and for some reason no one yet was brave enough to try and implement it |
16:45:33 | dom96 | It should be just a low hanging fruit, I don't imagine it's too complex |
16:45:41 | FromGitter | <iffy> don't tempt me :) |
16:45:52 | * | PMunch_ quit (Ping timeout: 246 seconds) |
16:47:11 | dom96 | just follow the implementation of asyncnet.recv, you can't go far wrong with that approach :) |
16:48:33 | euantor | Not complaining @dom96. There used to be a future version of Asyncnet that I’m sure had it, but I can’t find it now |
16:49:09 | FromGitter | <iffy> @dom96 k, and should the remote address/port be string/Port (like net.recvFrom)? or SockAddr/SockLen (like asyncdispatch.recvFromInto)? |
16:49:34 | dom96 | asyncnet should mirror net |
16:49:37 | dom96 | so the former |
16:49:40 | FromGitter | <iffy> k |
16:49:48 | FromGitter | <iffy> I'll see what time I have today; thanks! |
16:50:02 | dom96 | SockAddr/SockLen is a low-level POSIX API thing |
16:50:13 | dom96 | using those would be a pain |
16:50:36 | dom96 | and that's precisely why you shouldn't use asyncdispatch directly :) |
16:53:02 | * | Vladar quit (Remote host closed the connection) |
16:55:47 | traviss | I want to submit a PR to godbolt.com compiler explorer to support nim. He says there is some uncertainty about which gcc version it would use and doesn't want to have to support compiling with many versions (plus many versions of nim). What should we do here? |
16:56:21 | traviss | Just pin to latest gcc? |
16:56:36 | narimiran | traviss: are you aware of https://github.com/mattgodbolt/compiler-explorer/issues/206 ? |
16:56:39 | traviss | sorry, godbolt.org |
16:57:19 | traviss | no, i should have looked first. thanks. |
16:57:50 | narimiran | but your question is still valid, i just wanted to give you some historical perspective, so to say |
16:57:54 | FromGitter | <jrfondren> latest gcc, latest g++, done. that's the kind of options Nim wants. |
16:58:09 | federico3 | iffy: string/Port or IpAddress/Port |
16:58:16 | narimiran | agreed with @jrfondren |
16:59:14 | traviss | ok, i will add to the issue letting them know |
16:59:42 | narimiran | traviss: if you can make a PR, that would be great |
17:00:40 | narimiran | btw, v0.19.6 and v0.20 are around the corner, so maybe wait until they are released so we have the latest and greatest right from the start? |
17:00:48 | traviss | Jeez, did i say PR. Oops i meant a feature request. I wouldn't know where to start... |
17:01:18 | narimiran | :) |
17:01:24 | FromGitter | <mratsim> I was going to say wooooooooohooooooo |
17:01:25 | FromGitter | <jrfondren> well like it says in the issue narimiran linked, he's wanting someone to contribute it rather than ask him to do it |
17:08:39 | * | rnrwashere joined #nim |
17:08:40 | traviss | I updated the issue. He is streaming now if anyone else wants to drop in: https://www.youtube.com/watch?v=TmNJ7aXBrDs |
17:09:56 | * | rnrwashere quit (Read error: Connection reset by peer) |
17:10:10 | * | rnrwashere joined #nim |
17:14:31 | * | rnrwashere quit (Ping timeout: 255 seconds) |
17:15:32 | * | xet7 quit (Quit: Leaving) |
17:22:03 | clyybber | Araq: Why did you drop https://github.com/nim-lang/Nim/commit/46b085d0918ebdd44fd0ecfa32494508aad8ea1a ? |
17:22:55 | * | PMunch_ joined #nim |
17:25:15 | * | PMunch quit (Ping timeout: 248 seconds) |
17:35:09 | * | theelous3_ joined #nim |
17:37:01 | shashlick | @arnetheduck do let me know how accurate the llvm wrapper turned out |
17:37:47 | shashlick | There is one bug with renaming symbols I found - removing the LLVM prefix causes issues with enums with expressions |
17:38:33 | shashlick | If enum2 = enum1 | something, if enum1 got renamed earlier, it isn't detected and fixed in the expressions |
17:38:49 | shashlick | For now I've removed the renaming that you have in your wrappers |
17:39:33 | shashlick | If we restrict the renaming to only procs, it might work but doubt that's how you have it |
17:49:20 | FromGitter | <arnetheduck> mm.. in the case of llvm, the enums should also not be enums, but simple int constants |
17:49:41 | shashlick | Ya that's how nimterop works with enums |
17:49:45 | FromGitter | <arnetheduck> I didn't bother to fix that in the c2nim generated code, instead just commented out the offenders because I happen not to use them |
17:49:47 | * | hoijui quit (Ping timeout: 248 seconds) |
17:49:53 | shashlick | No other reliable way to handle c enums |
17:51:39 | FromGitter | <arnetheduck> but yeah, stripping prefix should be done consistently, if done.. I'm of two minds about that - if I was aiming for a quality wrapper of that stuff, I'd leave the prefixes in the nimterop-generated code and would likely hand-write a nice nim-like interface on top without the prefixes, due to how nim dumps everyhing in the global namespace |
17:55:45 | * | Trustable quit (Remote host closed the connection) |
17:59:04 | PMunch_ | Hmm, has anyone done I2C on the RPi boards in Nim yet? |
18:12:06 | * | hoijui joined #nim |
18:12:22 | * | hoijui quit (Remote host closed the connection) |
18:21:42 | * | sacredfrog quit (Ping timeout: 245 seconds) |
18:23:55 | * | sacredfrog joined #nim |
18:31:18 | * | sacredfrog quit (Ping timeout: 245 seconds) |
18:32:55 | * | sacredfrog joined #nim |
18:36:12 | * | PrimHelios quit (Quit: ZNC 1.7.3 - https://znc.in) |
18:36:56 | * | PrimHelios joined #nim |
18:42:17 | * | sacredfrog quit (Ping timeout: 246 seconds) |
18:44:18 | shashlick | @arnetheduck ideally nimterop makes it easy to generate idiomatic Nim with some niceties |
18:44:43 | shashlick | How would you solve the global name space issue? |
18:45:07 | * | rnrwashere joined #nim |
18:46:32 | FromGitter | <liquid600pgm> what does this mean? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cd475870824230a770884e8] |
18:46:43 | FromGitter | <arnetheduck> I'd say that works well for nothing but the simplest of libraries - the whole point of using a different language is to exploit features you don't have in the first one, so sure, some of it can be automated, but the end result I believe will be much better if you spend some time on curation as well - it's easier with some libraries though, if they were created with interoperability in mind |
18:47:18 | * | sacredfrog joined #nim |
18:48:54 | FromGitter | <arnetheduck> I don't know - generally, I'm not a fan of anything that defaults to global due to how short-sighted it is to write code that way. |
18:49:11 | * | PrimHelios quit (Quit: ZNC 1.7.3 - https://znc.in) |
18:49:13 | FromGitter | <arnetheduck> it's a language issue above all,nim doesn't offer too much in the way of modules and libraries |
18:49:25 | * | rnrwashere quit (Ping timeout: 246 seconds) |
18:49:29 | * | sacredfrog quit (Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac) |
18:49:52 | * | sacredfrog joined #nim |
18:50:00 | * | PrimHelios joined #nim |
18:52:47 | shashlick | Well I think there's definitely space for some interop helper procs |
18:53:48 | shashlick | Make it easier to deal with pointers, arrays, etc |
19:00:05 | FromGitter | <arnetheduck> well, in llvm you have plenty of opportunities to experiment :) they do lots of stuff that takes some curation (like the way strings and memory allocations are handled), even though the C library specifically is designed for interop |
19:01:05 | FromGitter | <liquid600pgm> figured it out, turns out you can't have proc arguments like `(height: Natural, width = height)` |
19:01:14 | FromGitter | <liquid600pgm> that's kinda lame |
19:01:26 | FromGitter | <arnetheduck> I'd generally not recommend using C++, ever, for interop, unless it's some crippled C++ that only uses a bare minimum of actual C++ - much easier to write some C wrappers and export those, @mratsim - for example, that's what all of rust, zig etc do with llvm, and for good reason |
19:02:03 | Zevv | PMunch_: I did, not on the Pi though, but the interface is the same everywhere |
19:02:09 | FromGitter | <arnetheduck> ie the successful integration of two languages generally takes some work on both ends to be *nice* |
19:02:48 | Zevv | From userspace the common way is to open /dev/i2c-X and doing some ioctls |
19:02:58 | * | PrimHelios quit (Quit: ZNC - https://znc.in) |
19:03:21 | Zevv | i2c-dev.h has all you need |
19:06:18 | * | PrimHelios joined #nim |
19:07:10 | FromGitter | <felipetesc> Hello there. I created an app for windows using webview and I want to change the icon from the title bar , as well, the app icon. I'm using mys2/mingw64, and I want to know if there is a cmd or a convenient way to help me. I've Google it , bye the way. Places I found something: https://forum.nim-lang.org/t/1862 , https://khchen.github.io/winim/winim.html , https://nim-lang.org/docs/niminst.html |
19:09:22 | * | sacredfrog quit (Quit: WeeChat 1.9.1) |
19:10:31 | PMunch_ | Zevv, aah right |
19:10:50 | PMunch_ | For now I've just used Python, found some simple code that worked for what I needed |
19:11:52 | PMunch_ | I put an RPi with a speaker and an accelerometer on top of my robo-vacuum. When the accelerometer detects a hard stop ie. a crash, it plays quotes from Marvin the manically depressed robot from hitchhikers guide to the galaxy :D |
19:12:32 | * | rnrwashere joined #nim |
19:12:39 | Zevv | "this terrible pain in the diodes down my side" |
19:14:11 | Zevv | I do embedded for a living. I love and I loathe how people waste hundreds of MHzs and MBs on silly projects that could be donw with some discrete electronics or a $50 ARM :) |
19:14:23 | Zevv | $0.50 ARM, that is |
19:16:02 | clyybber | Araq: I fixed one of the showstoppers: https://github.com/nim-lang/Nim/pull/11216 |
19:16:55 | clyybber | but it doesn't account for the case that the proc might access something of the lefthandside object through a global or something |
19:17:08 | * | rnrwashere quit (Ping timeout: 245 seconds) |
19:18:46 | clyybber | liquid600pgm: Huh, really? I thought that was supposed to work :/ |
19:20:53 | clyybber | PMunch_: Haha, thats amazing. |
19:21:34 | PMunch_ | Zevv, yeah I know.. But I didn't have any Arduino sound boards lying around.. |
19:22:18 | PMunch_ | I literally threw in together in about an hour or so |
19:22:27 | Zevv | that's the fun of these cheapo boards |
19:22:49 | PMunch_ | If I'm going to make it a permanent solution I'll definitely be getting some hardware that's a bit more apt for this |
19:23:25 | clyybber | I remember a year ago or so, there was a robo-lawnmower in our city that somehow came off the lawn and went on the street through the whole city for a day |
19:23:42 | Zevv | The downside is that it takes a lot of the magic of my job away. It used to be voodoo to most people :) |
19:23:49 | PMunch_ | TBH I think a finished unit that just played random tracks from an SD card whenever it bumped into something would be quite popular on Kickstarter |
19:23:50 | clyybber | and then it died (or rather its batteries) |
19:24:06 | clyybber | Zevv: Do you do FPGAs? |
19:24:13 | Zevv | incidentally |
19:24:26 | clyybber | nice. those are *magic* to me |
19:24:48 | Zevv | basically just for interfacing stuff, but SOC's come with amazing programmable bus peripherals these days, so less common |
19:25:11 | Zevv | They always were like magic to me. Large part of the confusion comes from the opaque tooling. |
19:25:42 | Zevv | If you want to get down and dirty, open up the tools, extract the command line binaries and run everything by hand. |
19:26:15 | Zevv | It takes time, but it all makes sense once you get it running. Plus; I hate IDE's, so now I can do FPGA's with vi and Make |
19:26:32 | * | nsf quit (Quit: WeeChat 2.4) |
19:27:20 | * | xet7 joined #nim |
19:31:27 | clyybber | I remember reading some paper where they somehow leveraged interference on FPGA's to train a neural net or so |
19:32:31 | clyybber | damn it, I cant find it |
19:35:54 | Zevv | probably a good match. A lot of repetative simple circuits |
19:36:57 | Zevv | An FPGA is basically nothing then rewireable hardware. There's a lot of basic building blocks consisting of a handful of fets, and the bitstream defines the connections between those. |
19:37:30 | * | rnrwashere joined #nim |
19:37:43 | dom96 | @felipetesc: In general whatever works for other compiled languages should work for Nim too, the links you've found are good. I'm afraid I don't have any other pointers to give you |
19:41:47 | * | rnrwashere quit (Ping timeout: 248 seconds) |
19:42:26 | * | PMunch_ quit (Remote host closed the connection) |
19:43:00 | * | PMunch_ joined #nim |
19:46:09 | * | narimiran quit (Remote host closed the connection) |
19:46:43 | * | PMunch_ quit (Remote host closed the connection) |
19:48:33 | FromGitter | <mratsim> @felipetesc, when you say webview, do you mean this package? https://github.com/oskca/webview |
19:48:37 | shashlick | @arnetheduck are you suggesting I not bother adding c++ wrapping to nimterop and continue improving the C wrapping |
19:49:12 | FromGitter | <mratsim> @arnetheduck I would prefer the C bindings as well but I know that for the OrcJIT the C bindings are a bit behind in term of functionality |
19:50:01 | shashlick | If you have some good examples of generic Nim to c niceties, I'll be eager to add them into nimterop |
19:50:03 | FromGitter | <mratsim> I have the time though, apparently to do polyhedral compilation I have to first create a math/constraint solver in pure Nim |
19:50:06 | FromGitter | <arnetheduck> @mratsim yeah, the c bindings lag a bit sometimes - what I've found is that sometimes the other projects have "tentative" versions that they later upstream.. like debug info API was prototyped in `rust` then upstreamed to llvm |
19:50:39 | FromGitter | <arnetheduck> so I first copied them from rust to nlvm, and removed slowly as they got added upstream :) |
19:52:08 | cy1 | if you want to say a = b, where "a" and "b" are different types, is there... any way to write something to automatically convert the value, or do you always have to write something like a = convert(b)? |
19:52:58 | FromGitter | <mratsim> use converters |
19:53:01 | rayman22201 | https://nim-lang.github.io/Nim/manual.html#converters |
19:53:25 | cy1 | Of course. Thanks! |
19:58:54 | FromGitter | <arnetheduck> shashlick, C++ is a complex language with many features that nim simply doesn't have -> hard to interface with it decently, and lots of bugs and corner cases.. however, exporting c++ to c from within c++ is easy. depends what your goals and use-cases are though. I find it a bit of a fools errand to go in that direction because I wouldn't be satisfied with some half-assed support, though I know many nimmers disagree |
19:58:54 | FromGitter | ... because they managed to port / use some simple c++ code that exposes just a limited API based on some msvc6-compatible version of c++98.. |
19:59:52 | cy1 | plus then you're not encouraging people to keep using C++... |
20:00:46 | * | vivus joined #nim |
20:02:49 | vivus | hello all. Does anybody use the csvtools library? I am trying to run the basic example at the top of the file, but I am getting an error: file.nim(4) file ... system.nim(2918) sysFatal ... Error: unhandled exception: index out of bounds [IndexError] |
20:02:54 | clyybber | arnetheduck: I agree. I dislike most cpp APIs in general tho |
20:03:29 | clyybber | vivus: No, but I'd suggest simply writing a csv parser yourself. |
20:04:07 | vivus | clyybber: isn't that re-inventing the wheel? the lib already exists and I just need to extract data from the csv |
20:04:55 | clyybber | hmm, yeah. I like to roll my own solutions often because some libraries are kinda overkill |
20:04:58 | FromGitter | <arnetheduck> I like C++ - a lot actually - specially the more recent versions that allow you to write good code :) but that looks nothing like earlier stuff - gone is manual memory mgmt, the clunky struct functors, poor compromises in argument passing etc - modern C++ is surprisingly nice, if you take advantage of it |
20:05:55 | clyybber | arnetheduck: thats true. But with modern cpp I always end up in []{}()-hell |
20:07:26 | clyybber | arnetheduck: What is kinda sad, though, is that so many projects are not even using the once pragma, because they like to support gcc versions from aeons long past |
20:07:34 | FromGitter | <jrfondren> @vivus, that's that index error. probably the csv you're working with doesn't have 5 columns. |
20:07:52 | clyybber | s/once pragma/any convinient new cpp feature |
20:08:21 | cy1 | C++ is hard to compile, takes a ton of memory to do so, and a long time. |
20:08:37 | cy1 | The language itself is eh... yucky, but the compilation time really kills it for me. |
20:08:40 | FromGitter | <arnetheduck> well, technically `pragma once` is not part of the standard which is why some / many projects avoid it |
20:08:41 | FromGitter | <jrfondren> @vivus yeah that example works fine for me with a suitable myfile.csv |
20:09:18 | FromDiscord_ | <kodkuce> i alwies wanted to lern proper C++ but evry step is some doom and worst ghing there is no proper turtorial that says this is old stuff this is modern stuff |
20:09:30 | vivus | @jrfondren so the issue is with csvtools lib? |
20:09:51 | clyybber | cy1: ccache does wonders. |
20:09:54 | FromGitter | <jrfondren> @vivus no, the example assumes that you have a file with 5 columns |
20:10:12 | FromGitter | <jrfondren> @vivus if you have fewer columns, do something appropriate for your .csv |
20:10:23 | cy1 | clyybber: not the first time you compile it! |
20:10:38 | clyybber | yeah |
20:10:58 | clyybber | without ccache I would have gone mad compiling wine |
20:11:30 | FromGitter | <mratsim> don't compile chromium then ... |
20:11:42 | FromGitter | <arnetheduck> not that nim is much better - the only thing that saves it is that nim programs are small :) imagine openoffice or firefox in nim, and recompiling all code every time |
20:12:00 | FromGitter | <mratsim> My main grip with C++ is compilation and the utter lack of sane package management |
20:12:04 | cy1 | Yeah I'm not a big fan of Nim's lack of linking |
20:12:11 | FromDiscord_ | <kodkuce> i alwies wanted to lern proper C++ but evry step is some doom and worst ghing there is no proper turtorial that says this is old stuff this is modern stuff |
20:12:11 | FromDiscord_ | <kodkuce> anyway hopfully if i learn Nim i wont need C++ anymore |
20:12:36 | FromGitter | <mratsim> every time I want to try a C++ library I get into CMake issues, even mature packages like OpenCV |
20:12:54 | clyybber | mratsim: I'm glad I won't. happy waterfox/firefox user |
20:13:07 | FromGitter | <mratsim> firefox is also insane to compile |
20:13:31 | cy1 | arnetheduck: Imagine the time it would take to compile Firefox rewritten in rust! oh wait |
20:13:36 | FromGitter | <arnetheduck> kodkuce, to master the art, learn a few languages that are different along some important axes (static, dynamic, functional, OO etc).. each new one you learn will make you better at your "home" language as well, whichever that ends up being. |
20:13:52 | FromGitter | <mratsim> Yeah, go try Haskell |
20:13:53 | FromGitter | <arnetheduck> cy1 well at least they solved @mratsim 's gripe with tooling :) |
20:14:05 | FromGitter | <mratsim> the hardest thing for me in haskell when I started was reading a file |
20:14:12 | FromDiscord_ | <kodkuce> i learned first c# , then python , and i tryed little nim and basic C |
20:14:16 | FromDiscord_ | <kodkuce> i learned first c# , then python , and i tryed little nim and C |
20:14:26 | FromGitter | <arnetheduck> in haskell everything is equally hard :) |
20:14:29 | cy1 | yeah, rust has cargo which is okay. I forget if cargo does source packages or binary ones though. |
20:14:51 | FromGitter | <arnetheduck> source mainly.. I think you can do binary as well, with some hacking |
20:14:52 | clyybber | source |
20:15:00 | FromGitter | <mratsim> cargo is good, better than nimble at the moment to be honest |
20:15:35 | clyybber | when it comes down to it, gitsubmodules are the best :) |
20:15:49 | cy1 | Wish Scheme didn't have that nasty call/cc requirement, makes any implemenations of that language pretty tricky and slow. |
20:15:50 | clyybber | reproducible, non-buggy, portable |
20:15:50 | FromGitter | <mratsim> :thinking_face: |
20:16:08 | cy1 | I wonder how Racket's doing lately... |
20:16:14 | FromGitter | <mratsim> it's buggy when you collaborate because they work strangely in branches |
20:16:19 | clyybber | cy1: pretty great |
20:16:55 | cy1 | clyybber: they're still writing syntaxes of syntaxes of syntaxes of syntaxes? |
20:17:22 | clyybber | yeah. I wrote a roguelike in racket, and made my own small dsl for it. |
20:17:44 | clyybber | it really pushes you to write your own "language" |
20:17:51 | FromGitter | <mratsim> Oh, Spry lang website is back: http://sprylang.se |
20:18:45 | rayman22201 | They are rewriting the whole racket runtime in chez scheme, so yeah, more schems on schemes lol |
20:19:26 | cy1 | clyybber: I just wish they were better at keeping the intermediate representations clean. It's hard to understand code, when you have to compile syntax transformers in your mind to do so. |
20:20:48 | clyybber | yeah |
20:21:25 | cy1 | I seem to remember something like (expand-macro (some-simple-thing)) => (holy-crap-brain-anyeurism) |
20:22:30 | clyybber | mratsim: sadly they dont support precedence for those infix/prefix functions |
20:23:13 | vivus | @jrfondren " do something appropriate for your .csv" > what if the CSV file is like 5M lines? transforming it won't work |
20:23:38 | FromGitter | <jrfondren> @vivus, you don't need to transform it. you just need to not ask it for a fifth column if it doesn't have five columns. |
20:23:54 | FromGitter | <mratsim> @vivus, have you tried stdlib parsecsv? or Nimdata? |
20:24:06 | FromGitter | <jrfondren> @vivus, try that example with row[0] |
20:24:10 | * | shadowbane quit (Quit: Konversation terminated!) |
20:24:14 | clyybber | mratsim: hmm, never used submodules extensively in branches. I always had the submodules updated directly on the master branch |
20:24:42 | * | jjido joined #nim |
20:25:09 | FromGitter | <mratsim> We have submodules in our repo at Status and I always have to take care to not apply the latest one along my commits when I switch branches |
20:27:17 | clyybber | but why does the submodule always update on your clone? |
20:27:28 | clyybber | normally updating submodules is done manually. |
20:27:58 | * | shadowbane joined #nim |
20:29:08 | FromGitter | <mratsim> when you update a submodule, all branches see the update one, if you commit all you will commit the submodule update. |
20:29:10 | clyybber | unless you use --remote to update your submodules, because it then skips right past the commit hash specified in the root rep |
20:29:43 | clyybber | mratsim: oh, yeah. thats an issue. |
20:29:48 | FromGitter | <mratsim> no try it, create an empty repo, crate a branch, and add a submodule in the branch. switch to master, it doesn't disappear |
20:30:13 | shashlick | @arnetheduck I'm limiting nimterop to wrapping only and not outright conversion, with that in mind, what's wrong with wrapping c++ header files? |
20:30:15 | FromGitter | <arnetheduck> well, to get "correct" behaviour with submodules, you need to `git submodule update` on your main repo.. if you work with branches on the subrepos, you need to replicate those branches on main repo as well and it quickly creates a very messy workflow with lots of branches everywhere that few people understand well how to manage, specially when merging |
20:31:26 | FromGitter | <mratsim> @shashlick, nothing wrong but you will have to do more plumbing than C (which always works once wrapped) |
20:31:34 | FromGitter | <arnetheduck> shashlick there's nothing wrong, it's just that you'll never arrive at a working solution, beyond hello world and c++98 :) try it on.. an average boost library, and you'll see. |
20:32:17 | FromGitter | <mratsim> some example: https://github.com/status-im/nim-ttmath/issues/10, https://github.com/status-im/nim-ttmath/issues/14 |
20:32:53 | FromGitter | <mratsim> "flexible array member type", "Type has a non-trivial destructor" https://github.com/status-im/nim-ttmath/pull/15 |
20:33:43 | FromGitter | <mratsim> Every new guy onboarded had issues one way or another with ttmath which was a C++ header only library. |
20:34:14 | FromGitter | <alehander42> i am sorry that i started this ttmath thing :D :D |
20:34:28 | FromGitter | <alehander42> (ttmath-wrapper) maybe not a good idea in hindsight |
20:34:45 | FromGitter | <mratsim> lol |
20:35:12 | FromGitter | <mratsim> I think it was, it's used a lot on embedded device stuff like mbed, it's fast, and it has a good license |
20:35:26 | clyybber | mratsim: Yeah, I guess running git submodule update each time after switching a branch is kind of bothersome.. |
20:36:19 | FromGitter | <mratsim> The C alternatives would have been imath (often used as an alternative to GMP) or libtommath (used in libtomcrypt) I think |
20:36:48 | FromGitter | <mratsim> We do need a bigint lib in the stdlib |
20:36:55 | FromGitter | <dom96> Huh. I didn't realise submodules has such issues |
20:38:08 | FromGitter | <dom96> Surely there must some reasoning behind this behaviour. Anyone know what it is? |
20:38:16 | clyybber | dom96 probably because "back then" they thought it would be unreasonable to change the actual folder contents of the submodule each time you switch to a branch with a different version of the submodule |
20:38:30 | clyybber | because of disk space or something like that? |
20:38:48 | clyybber | dom96 I wonder how easy it is to contribute to git |
20:39:00 | clyybber | maybe add an option that changes that behaviour |
20:40:11 | FromGitter | <arnetheduck> submodules are generic, package managers are language-specific. you get the better ux because you cut down on genericity and make more implicit assumptions that work well when you're serving the "build" workflow |
20:43:33 | FromGitter | <dom96> I don't see disk space as a satisfactory explanation. The repo is already there |
20:45:37 | FromGitter | <arnetheduck> generally, if you switch branches in git it will only touch the changed files, meaning that with a decent build system, you will only rebuild the difference.. |
20:47:04 | clyybber | narimiran[m]: hey, you there? |
20:47:15 | dom96 | It appears that Git 1.8.2 allows submodules to track branches |
20:47:17 | FromGitter | <arnetheduck> depending on your workflow, you either want or do not want the submodule to follow.. for most modern toolchains, you mostly want the submodule to follow, but that's not obvious, and changing it now would break a lot of existing setups.. regardless, it's usually a pita, and most projects avoid submodules if they can, going for monorepo instead |
20:47:20 | dom96 | No idea if that's what is missing here |
20:47:27 | dom96 | but stackoverflow answers seem to be mention it |
20:47:57 | dom96 | Why don't you go for a monorepo? |
20:49:08 | clyybber | dom96 it means that you can track branches of the submodule. |
20:49:09 | FromGitter | <arnetheduck> poor tooling support in nim.. though we're moving in that direction now that we've dropped nimble |
20:49:33 | Araq | clyybber: please don't use [CI skip], it confuses me |
20:49:43 | Araq | now I have no clue what's been tested |
20:50:10 | clyybber | Araq: Sorry, you can click on the small red x next to the commit |
20:50:29 | clyybber | and a popup with the checks will appear |
20:50:56 | clyybber | Araq: next to the "Add testcase" commit |
20:50:59 | clyybber | the CI's did run |
20:51:14 | Araq | all Nimble packages green too? |
20:51:19 | dom96 | arnetheduck: I'm not sure it's worthwhile to support "local packages" in Nimble's dep list when you can easily just specify the path in your nim.cfg file |
20:51:42 | dom96 | and once you do that, yes, you don't really need Nimble |
20:51:48 | clyybber | Araq: github timed out while testing those, again. |
20:51:53 | FromGitter | <mratsim> Monorepo support is important, even Google is using a monorepo |
20:52:12 | FromGitter | <alehander42> monorepos make sense for bigger projects |
20:52:28 | clyybber | Araq: Thats why so many PRs are red, github has some serious issues with their servers apparently |
20:52:43 | dom96 | I should know, I work at a pretty big company that doesn't use Git because of the size of their monorepos... |
20:52:47 | FromGitter | <mratsim> Yeah, and Appveyor gives you green even if you have failures |
20:52:48 | FromGitter | <jrfondren> their servers were time-travelling the other day. |
20:53:28 | FromGitter | <mratsim> Rust is investigating new CI options by the way and have good experience with Azure Pipelines |
20:53:32 | clyybber | mratsim: Are you sure? https://ci.appveyor.com/project/Araq/nim/builds/24432914 is red |
20:53:34 | FromGitter | <arnetheduck> well, we wanted to be good nim community citizens and publish as much of our work as possible on nimble so it would be easy to reuse - that unfortunately cost us a lot of time and frustration - but you're right, we can get by without nimble too. |
20:53:55 | FromGitter | <mratsim> @clyybber, yes sure, we raised an issue directly with appveyor a day ago |
20:54:04 | clyybber | ah, ok |
20:54:27 | * | krux02 joined #nim |
20:54:40 | FromGitter | <mratsim> See for example: https://ci.appveyor.com/project/nimbus/nim-chronicles/builds/24391980/job/gylc2q52m91wms8h#L1378 |
20:54:53 | Araq | clyybber: so ... merge it? |
20:55:17 | Araq | https://github.com/nim-lang/Nim/pull/11216 I mean |
20:55:45 | dom96 | arnetheduck: I understand. Indeed, for this use case Nimble support would be useful |
20:56:09 | clyybber | Araq: Yeah, I guess so |
20:56:22 | dom96 | If you're up for it, hacking this into Nimble should be relatively trivial |
20:56:45 | FromGitter | <jrfondren> @arnetheduck so what would the ideal look like? you have a project .nimble that describes more than one project that live in different subdirectories, and someone can "nimble install" them individually without pulling in the other stuff? |
20:57:58 | FromGitter | <mratsim> My 3 pet peeves regarding nimble are: ⏎ ⏎ 1) task level dependencies ⏎ 2) please don't remove the src folder when doing nimble install, keep the src as it was on the dev box ⏎ 3) don't warn about incorrect structure for extra directories, that's scary to newcomers [https://gitter.im/nim-lang/Nim?at=5cd49456e7f42160fa601fb0] |
20:59:06 | FromGitter | <mratsim> And more fuzzy stuff about versioning vs head vs master, and also multiple nimble packages in one repo. |
20:59:24 | dom96 | @mratsim: you might not like 2&3, but what are the alternatives? We cannot allow people to install whatever they please. |
20:59:29 | krux02 | mratsim: I don't like that the recommended structure for nimble packages changed quite a few times. |
20:59:56 | krux02 | dom96, why not? |
21:00:06 | shashlick | @dom96 the whole problem is that all packages are added to the same namespace |
21:00:11 | FromGitter | <mratsim> 2 gives you hack like these: https://github.com/nim-lang/nimble/blob/v0.9.0/nimble.nimble#L4-L9 |
21:00:30 | krux02 | isn't that the point of package managers, to install whatever the people please to package? |
21:00:36 | FromGitter | <mratsim> When even nimble needs to hack around the fact that "src" disappears when installed, it's quite telling |
21:00:41 | shashlick | Instead of should have been pkgs/package-x.y.z/package |
21:00:59 | shashlick | That way importing packages would have been in their own package namespace |
21:01:17 | shashlick | They can do whatever in their subdirs |
21:01:27 | dom96 | So I install `src/nimblepkg/nimble.nim` to `pkgs/nimble-0.9.0/`, what then? |
21:01:31 | FromGitter | <mratsim> also this "src" hack probably doesn't even work with "nimble develop" |
21:01:39 | dom96 | I import it via `src/nimblepkg/nimble`? |
21:01:49 | dom96 | mratsim: it does |
21:01:50 | krux02 | installing a nimble package should just be a shallow git clone |
21:01:59 | FromGitter | <mratsim> agree with krux |
21:02:29 | * | rnrwashere joined #nim |
21:02:29 | Araq | clyybber: https://github.com/nim-lang/Nim/issues/11217 if you want to help... These are fun to work on, IMO, ymmv |
21:02:34 | dom96 | I think you are all making an assumption: that the Nim compiler reads the .nimble file |
21:02:49 | krux02 | no I don't |
21:03:01 | dom96 | Then how do you handle the problem I am describing? |
21:03:03 | Araq | mratsim: I want to give you module-specific .passC pragmas |
21:03:17 | FromGitter | <mratsim> nimble is free to add a .cfg file in the directory |
21:03:26 | krux02 | I would like to make the nimble file obsolete |
21:03:30 | FromGitter | <mratsim> @Araq, I need file-specific, not module specific |
21:03:35 | krux02 | at least for most use cases |
21:03:41 | shashlick | path should have been --path:~/.nimble/pkgs/package-x.y.z like it is today but all contents go into ~/.nimble/pkgs/package-x.y.z/package |
21:03:54 | shashlick | so all imports would have to be `import package/whatever` |
21:03:55 | FromGitter | <mratsim> otherwise when I compile with AVX for example it will produce wrong SSE code (not backward compatible) |
21:03:57 | Araq | mratsim: what's the difference? A module produces a c(pp) file |
21:04:07 | FromGitter | <mratsim> ah ok |
21:04:07 | clyybber | Araq: https://github.com/nim-lang/Nim/issues/9684 has been fixed too. |
21:04:15 | FromGitter | <mratsim> I had package in my head |
21:04:17 | dom96 | shashlick, okay, but then I cannot `import jester` anymore |
21:04:37 | Araq | clyybber: to close bugs, add a test case and use "closes #xx" instead of "fixes #xx" |
21:04:56 | Araq | dom96: yeah but that's about it. |
21:04:58 | FromGitter | <mratsim> @dom96 I think that is a tooling problem |
21:05:02 | shashlick | @dom96: yes that is right, but that's how it should have been |
21:05:06 | krux02 | Araq, what closes instead of fixes? |
21:05:14 | shashlick | `import jester/jester` or whatever |
21:05:17 | clyybber | Araq: yup will do. I didn't realize I fixed that issue too, it was more of an *accident* |
21:05:26 | krux02 | github doesn't care as far as I know and "fixes" seems to be already the convention |
21:05:35 | dom96 | This still wouldn't be a "shallow clone" though |
21:05:44 | Araq | no, the convention is fixes for fixes, closes for closes |
21:05:47 | dom96 | You wouldn't be able to put your files into a `src` folder |
21:06:21 | dom96 | But listen, for real, if you guys have a good thought in your head about how this should work please write an RFC |
21:06:23 | FromGitter | <mratsim> it's still a tooling problem. I think it's a bad idea to push tooling issues to devs |
21:06:38 | * | krux02 quit (Remote host closed the connection) |
21:06:47 | dom96 | Then we can clearly talk about the problems and the solutions |
21:06:55 | shashlick | put files wherever, that shouldn't be nimble's problem - nimble should be providing a way to get a package installed |
21:07:01 | dom96 | Each of you have a different concept of what you want and are missing problems from what I can tell |
21:07:05 | * | rnrwashere quit (Remote host closed the connection) |
21:07:12 | shashlick | if packager wants src, then `import jester/src/jester` |
21:07:12 | FromGitter | <mratsim> I'm pretty sure many who used the "src" way were puzzled by strange bug report because the library didn't work after nimble install |
21:07:16 | Araq | dom96: no, we all want the same |
21:07:38 | shashlick | if it is not stdlib, it should be in its own namespace so it doesn't interfere with others |
21:07:52 | FromGitter | <jrfondren> shashlick's wants are definitely out of step. |
21:07:59 | shashlick | if you want import jester, get it into the stdlib, convince the stdlib maintainer |
21:08:02 | dom96 | Araq, I seriously doubt that |
21:08:03 | Araq | don't butcher the directories, yes that might mean 'import jester / jester', you'll survive |
21:08:19 | FromGitter | <mratsim> What I don't want are these kinds of bug: https://github.com/mratsim/Arraymancer/issues/16 |
21:08:44 | FromGitter | <felipetesc> @mratsim Yes. Exactly. |
21:08:48 | FromGitter | <mratsim> and the RFC is there: https://github.com/nim-lang/Nim/issues/6700 |
21:08:56 | dom96 | mratsim: seriously, this is a hack, it was always a hack |
21:09:03 | dom96 | I didn't want this way of reading the version |
21:09:08 | dom96 | I'm perfectly happy to duplicate it |
21:09:24 | shashlick | one hack is to handle `import jester` as first looking for jester.nim as is, then when not found, in jester/jester.nim for backwards compatibility |
21:09:51 | shashlick | but perhaps complain that it will be deprecated eventually |
21:10:28 | FromGitter | <felipetesc> @FromIRC Thanks. |
21:11:06 | dom96 | Araq, you'll end up with repos that have all the .nim files in the root |
21:11:16 | FromGitter | <mratsim> the worse is that at the time I had Travis and Appveyor set up and it never cropped up into CI |
21:11:18 | noonien | what is a nim project? |
21:11:20 | dom96 | or having to import using `import jester/src/blah` |
21:11:59 | dom96 | mratsim: What was the problem? Was it that you used this in your .nimble file? |
21:11:59 | FromGitter | <mratsim> well many are avoiding the src structure and use project.nim and project/ because src is not reliable |
21:12:33 | noonien | can anyone link a well-structured nim project? preferably one that builds to multiple binaries |
21:12:40 | dom96 | mratsim: yeah, and do you really want to `import project/project/module`? |
21:12:54 | shashlick | what's wrong with having nim files in the root? |
21:12:57 | shashlick | if it is a library |
21:12:58 | FromGitter | <mratsim> As I said this is a tooling path/resolution problem |
21:13:12 | FromGitter | <arnetheduck> @jrfondren an minimally sane setup would start by not ever using or recommending `nimble install` - that's a fundamentally broken concept. it would support repro builds, so that when I give you a project, you successfully build it every time, again regardless of what you happen to have installed. it would be local to the project, so I can work on two projects concurrently and not worry. it would build what's |
21:13:12 | FromGitter | ... necessary/changed and no more so I don't have to waste time. it would promote good community behavior so that it's easy to perform socially beneficial tasks like sharing code asynchronously. it would sport good monorepo support with relative dependencies so that that I can give structure to a larger project but still mai ... [https://gitter.im/nim-lang/Nim?at=5cd497e85a1d435d4613e3d6] |
21:13:14 | FromGitter | <mratsim> it's not one or the other |
21:13:21 | FromGitter | <mratsim> @dom96 this was the issue: https://github.com/mratsim/Arraymancer/commit/1486d432f509270fc5ff14c3cea87f887e523c7d#diff-8f67a9879fcc256856a21ea81896516e |
21:13:25 | FromGitter | <mratsim> well the fix |
21:13:40 | dom96 | shashlick, it makes the repo messy |
21:14:08 | FromGitter | <mratsim> I think we should trust users to be grown up |
21:14:11 | shashlick | well only top level nim files will be in the root, everything else can be in subdirs and imported relatively |
21:14:20 | FromGitter | <jrfondren> sounds like another way to state the problem is: src exists in the devel environment and thereby allows people to refer to it in ways that break after installation. |
21:14:23 | dom96 | mratsim: You had arraymancer.nim outside the `src` dir? |
21:14:31 | FromGitter | <mratsim> yes |
21:14:44 | dom96 | Why did you expect that to work? |
21:14:59 | FromGitter | <mratsim> like many other projects, at the time I didn't know about the difference between arraymancer.nim and arraymancer/ or the src/ |
21:15:10 | FromGitter | <mratsim> because no documentation? |
21:15:19 | FromGitter | <jrfondren> @dom96 the problem is it did work :) |
21:15:32 | dom96 | jrfondren: what? It never did |
21:15:36 | Araq | remember that Nimble's design predates import dir / [a, b, c] and now that we have that, Nimble can be simplified |
21:15:52 | clyybber | Araq: Destructors for global vars should just be injected at the "end" of the program, right? |
21:16:00 | Araq | clyybber: yep |
21:16:01 | dom96 | oh, I guess you didn't have `srcDir= "src"` in your .nimble file? |
21:16:04 | FromGitter | <jrfondren> it worked until someone nimble installed. with no warnings from nimble about how things wouldn't work at that point. |
21:16:10 | FromGitter | <mratsim> I just looked into other projects mostly andrea linalg and it worked like that: https://github.com/unicredit/linear-algebra |
21:16:32 | FromGitter | <mratsim> it doesn't have srcDir as well |
21:16:40 | dom96 | yeah, and it works, doesn't it? |
21:16:43 | Araq | and whether 'src' ends up in my import statements is a non-issue if that's what it takes to make Nimble more reliable |
21:17:04 | FromGitter | <mratsim> well, I had 3 months or Nim at the time |
21:17:35 | FromGitter | <mratsim> That's the kind of friction you don't want on new people |
21:17:38 | Araq | and it would make Nimble more reliable because currently we have 2 different directory setups, nimble only copies 'src' over into $nimbledir |
21:18:23 | shashlick | okay then are we all saying that nimble should add --path:~/.nimble/pkgs/package-x.y.z to the search path like today and nimble will install everything into ~/.nimble/pkgs/package-x.y.z/package to keep unique namespaces but nim will translate `import package/file` to `import package/src/file` so that the repo is clean |
21:18:34 | Araq | and then in the Nimble tasks you can have lovely checks like "am I in the .nimbledir already or not..." |
21:19:07 | dom96 | yeah, because you run the Nimble tasks so often when the package is installed |
21:19:10 | shashlick | and package maintainer will put all files they want importable into src |
21:20:02 | clyybber | shashlick: sounds great |
21:20:46 | Araq | shashlick: still too complex for me, but I'm willing to make compromises if only we can solve this for good |
21:20:47 | dom96 | shashlick, honestly I would have no problems with this, you have to convince Araq to let you do this import stmt transformation though |
21:21:18 | dom96 | but let me just ask you: is this implicit transformation really less complex than what we have now? |
21:21:26 | dom96 | At least right now you can check what Nimble installs |
21:21:32 | noonien | are there any nim projects i can look to for inspiration for a project structure? my projects will be building several binaries |
21:21:32 | dom96 | There is no magic |
21:21:44 | dom96 | noonien, https://github.com/nim-lang/nimble#project-structure |
21:21:51 | FromGitter | <mratsim> for now I just want nimble not to delete the src in the path. |
21:22:08 | noonien | i also would prefer to have a way to get rid of imports such as `import "../foo"` |
21:22:16 | shashlick | @noonien - see nimterop/nimterop and genotrance/feud |
21:22:18 | dom96 | mratsim: why don't you just not have the `src` dir at all? |
21:22:36 | shashlick | i agree i don't like the magic but we are talking about cleaner repos so it is a compromise |
21:22:44 | FromGitter | <mratsim> Or why don't I just not use nimble/nim at all? |
21:22:45 | noonien | dom96, shashlick: thanks! |
21:22:57 | shashlick | honestly, it should be the package maintainer's option to figure out how they want to use the namespace |
21:23:14 | shashlick | ideally you have one nim file in the root dir that imports everything else |
21:23:29 | clyybber | what does nimble use atm? --path:~/.nimble/pkgs/somepackage/ and append the srcDir to that? |
21:23:31 | shashlick | i don't like the src magic |
21:23:31 | dom96 | mratsim: Ouch. I'm just trying to help you man |
21:23:33 | FromGitter | <mratsim> that's what i had in Arraymancer |
21:23:47 | FromGitter | <mratsim> one file at the root which imported everything |
21:23:48 | FromGitter | <jrfondren> @mratsim you want src/ because you referred to src/ once, then discovered that didn't work, then stopped referring to src. if it were made to work your code would have to refer to src again, and someone else would say "for now I just want nimble to delete the src in the path" |
21:24:01 | Araq | the package manager should do 'git clone' followed by a 'git checkout', nothing more, nothing less |
21:24:04 | FromGitter | <jrfondren> @mratsim I feel like the more fundamental problem is that you did it wrong once, and people shouldn't be steered down that path like you were |
21:24:55 | FromGitter | <mratsim> I actually still have src in Arraymancer, I just move the root file in the src dir but in exchange I have invalid package structure |
21:25:12 | FromGitter | <arnetheduck> shashlick, go to `cargo` for inspiration - the most significant magic they have is how well it works :) |
21:25:13 | FromGitter | <mratsim> my other packages don't use src anymore though |
21:25:35 | FromGitter | <jrfondren> and the 'steering' there is just that the installation environment differs from the devel environment and nimble doesn't complain when you depend on stuff that changes, and that maybe the docs aren't good enough. |
21:25:37 | clyybber | I don't get the problem, just use srcDir = "src" ? |
21:26:21 | FromGitter | <mratsim> @clyybber the problem is that unsuspecting package first author will get these reports: https://github.com/mratsim/Arraymancer/issues/16 |
21:26:22 | FromGitter | <jrfondren> @arnetheduck I thought you were thinking mainly of npm. maybe that's similar to cargo |
21:26:39 | Araq | the fact that the installation environment differs from the devel environment is Nimble's design bug number one. It's *begging* for bugs and problems |
21:26:43 | dom96 | Some of you guys are really making me sad |
21:27:05 | clyybber | mratsim: Ah, I see. |
21:27:38 | dom96 | Please keep in mind that Nimble is a result of almost a decade of (volunteer) work and that many compromises were made |
21:27:41 | FromGitter | <arnetheduck> dunno never used npm extensively - the thing I heard about it was that it was pretty broken, then `yarn` came along and did a decent job, then `npm` learned from `yarn` and fixed their own stuff |
21:27:48 | FromGitter | <jrfondren> isn't it just this one bug and problem? You could put that in a "CAVEATS section |
21:27:48 | FromGitter | <mratsim> So you have fancy CI, spend a lot in documentation, you announce v1 of your package, and then "nothing to install" |
21:28:24 | FromGitter | <mratsim> It's not one bug, it's plenty of workaround that lie in wait like this: https://github.com/nim-lang/nimble/blob/v0.9.0/nimble.nimble#L4-L9 |
21:28:49 | FromGitter | <jrfondren> @arnetheduck all I know about npm is that you have to pass it a flag to have it install stuff the way nimble does. the default is to install into a subdirectory of your project |
21:28:55 | FromGitter | <mratsim> `fileExists(thisModuleFile.parentDir / "src/nimblepkg/common.nim")` this is really a hack |
21:29:00 | clyybber | dom96: hey, I think most people here appreciate your work and nimble and thus want to have it be as best as possible |
21:29:07 | FromGitter | <arnetheduck> @jrfondren that's a good and sane default to have, indeed |
21:29:26 | FromGitter | <mratsim> @dom96, the goal is not too make you sad, it's to make nimble better and to reduce friction when developing for Nim |
21:29:53 | FromGitter | <mratsim> The things Nim lacks the most today besides devs are libraries |
21:30:04 | FromGitter | <mratsim> we want to make library development smooth |
21:30:44 | FromGitter | <arnetheduck> what comes first, devs or libraries? :) |
21:30:53 | FromGitter | <mratsim> In my Nim experience, this packaging issue stuck like a sore thumb, even after I understand all the issues behind |
21:31:30 | Araq | shashlick: I love your work btw. I hope I said it before. I didn't believe removing the Nim dependency from Nimble would work out. |
21:31:45 | FromGitter | <mratsim> But don't worry, you're not alone, @Araq is well aware of my gripe with Generics early symbols resolution and @zah was well aware of my issues with statics |
21:32:14 | Araq | :D but I'm not sad about it, sorry |
21:32:41 | Araq | I remember the days before we got the generic prepass, it was even more ridiculous |
21:33:09 | FromGitter | <mratsim> I mean I even complained to shashlick about wanting to see the proc signature nimgen generated |
21:33:39 | dom96 | I think things have improved. Nowadays Nimble creates a package structure for you via `nimble init` so there really isn't much room for problems |
21:34:08 | FromGitter | <jrfondren> yeah I haven't had any problems probably because I followed that |
21:34:23 | clyybber | With the nocompiler branch merged, is there a flag to specify which nim compiler nimble should use? |
21:34:25 | FromGitter | <mratsim> Still, I think we should improve things for v1. |
21:34:45 | Araq | dom96: it's time we apply some learned lessons, seriously. |
21:34:51 | FromGitter | <jrfondren> actually my main source of friction is "nim c examples/tool_under_construction" and then getting errors and having to "nimble install" and run "nim c" again |
21:35:03 | Araq | there is nothing to be ashamed of. |
21:35:04 | FromGitter | <jrfondren> where this is all in the project directory |
21:35:11 | shashlick | @Araq - thanks, definitely appreciate it 🙂 |
21:35:37 | dom96 | Araq, like I said, I'm more than happy for improvements. I'm skeptical whether what you are proposing are actual improvements though :P |
21:35:55 | FromGitter | <mratsim> yep you definetly deserve the kudos for the past half year @shashlick |
21:36:02 | Araq | ok, be skeptical, but consider this: |
21:36:14 | dom96 | Which is why I want one of you to write an RFC outlining what you have in mind |
21:36:19 | shashlick | @mratsim - nimgen is close to dead, it has been consumed by nimterop |
21:36:38 | dom96 | I think a lot of things get lost in IRC |
21:36:46 | Araq | how much of Nimble's design *really* is about being able to write 'import jester' instead of 'import jester / jester' or 'import jester / src / jester' |
21:36:48 | shashlick | @clyybber: it just uses the one in path |
21:37:08 | FromGitter | <arnetheduck> +1 shashlick :) |
21:37:32 | clyybber | shashlick: Ah, I guessed so. |
21:37:43 | Araq | IMHO quite of lot of Nimble's design comes down to 'import jester' |
21:38:14 | shashlick | @clyybber: but it means you can use the latest nimble with older nim's too which is cool |
21:38:24 | shashlick | thanks @arnetheduck 🙂 |
21:38:30 | FromGitter | <arnetheduck> re nimterop, shashlick, one of the things I'm hitting with `cDebug` and redirecting output is that sometimes during compiles there's other random stuff printed to stdout.. |
21:38:54 | Araq | and that's a bad reason to butcher the directory structure, sorry. |
21:39:08 | shashlick | ya i've commented them for now but plan on checking if tty and not print these messages if piped |
21:39:20 | Araq | and the code in nimble.nimble that mratsim pointed us to confirms this. |
21:39:25 | shashlick | there's also a request from mratsim to use cDebug to redirect to a file which will be cleaner |
21:40:09 | dom96 | Araq, that's fine. But I am not convinced that any of the proposals are sufficiently better to warrant changing this |
21:40:14 | FromGitter | <arnetheduck> well, if I compile `wrap.nim` in the sqlite repo, it will print `CC: xxx.c` as part of the compile process, and that ends up in my "generated" sqlite.nim.. that's in addition to the random debug output nimterop itself does |
21:40:30 | disruptek | i still don't really understand what nimble is for (sorry). i don't use it and don't miss it. |
21:40:42 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
21:40:55 | shashlick | Araq, dom96 - i'm also worried about backward compatibility - how do we keep both methods alive so that not every package gets broken suddenly |
21:40:58 | dom96 | Araq, this hack that mratsim points to is something that you really wanted, because you hated duplication of versions so much |
21:41:30 | Araq | no, the hack exists because we have two different directory structures at work here |
21:41:55 | Araq | but let's say you are right |
21:41:57 | shashlick | @arnetheduck - can you post a gist? not sure |
21:42:08 | Araq | and it's my fault for nimble.nimble and has a different reason |
21:42:12 | FromGitter | <jrfondren> so what breaks if compiler/modulepaths.nim looks for paths under src/ instead of under /pkgname/ ? |
21:42:23 | Araq | it's a pattern I've seen in other .nimble files too |
21:42:43 | clyybber | shashlick: Yeah, thats really cool, I guess an option to manually specify the nim path would be also useful, especially when developing using ./koch temp |
21:42:55 | Araq | and I've received some RFCs about system.thisPackageDir and stuff like that so that people can write compensation code for this problem |
21:43:03 | FromGitter | <mratsim> @arnetheduck @shashlick we talked about that 3 days ago: for now low-priority as we didn't know if it was useful to others but please cast your vote: https://github.com/nimterop/nimterop/issues/127 |
21:43:50 | dom96 | Araq, okay. I go back to challenging you (or someone else) to specify a proposal to improve this |
21:43:56 | shashlick | @clyybber: ya that's possible - i need to add support for $CC cause even gcc is hard-coded, can do the same for $NIM as well |
21:44:37 | FromGitter | <arnetheduck> shashlick, I hit it the other day just by running update.sh from the sqlite repo, I think with nim 0.19.. but I wasn't thinking about the exact repo then, will let you know later if I find the exact conditions for it to happen |
21:44:58 | dom96 | It will be nice to yank all this code that checks the package directory structures |
21:45:10 | dom96 | So please, just write an RFC already :) |
21:45:18 | Araq | now that's the spirit |
21:45:30 | Araq | I'm writing... |
21:45:38 | Araq | a fresh one? |
21:45:38 | FromGitter | <arnetheduck> also, I think the thing is that I don't consider this a "debug" feature - it's an actual useful thing for breaking dependencies, so using `cDebug` for it is a bit confusion :) |
21:46:11 | dom96 | bbl |
21:46:19 | FromGitter | <mratsim> We have a chain of RFC on package structure, this was the last: https://github.com/nim-lang/Nim/issues/7250 |
21:46:20 | FromGitter | <jrfondren> Nim already has to know to consider this .nimble/pkgs tree. It's not nimble that sets a configuration somewhere to tell Nim to do that. Rather than breaking every existing nimble-installable package and going with crazy talk like "import jester/jester" or "import jester/src/jester", if Nim looks for the src directory, then nimble can check nim's version and have some transition code for the repo structure |
21:46:23 | shashlick | @arnetheduck - i just tried it with the latest sqlite wrapper you have and the output is clean |
21:46:31 | FromGitter | <mratsim> and previous: https://github.com/nim-lang/Nim/issues/6700 |
21:46:51 | FromGitter | <jrfondren> that code seems to be in compiler/modulepaths.nim |
21:46:54 | FromGitter | <mratsim> each time sparked by IRC discussion and someone summarizing them ;) |
21:47:12 | shashlick | @arnetheduck - okay never mind, i see it |
21:47:26 | shashlick | i think that's a nim bug, instead of writing to stderr, it is going to stdout |
21:47:29 | FromGitter | <jrfondren> result: there's no longer a difference in the installed directory structure, but nothing else needs to change. AFAICT. |
21:48:00 | FromGitter | <arnetheduck> shashlick, ok cool. not sure when that happens. another random mistake I did was placing `cPlugin` after `cImport` - took a while to figure out why that didn't work |
21:48:11 | FromGitter | <jrfondren> and also the thing mratsim did will *still* break but you'll no longer be able to point at the directory structure as the cause of the breakage. |
21:48:35 | * | vivus quit (Remote host closed the connection) |
21:48:48 | FromGitter | <mratsim> my git clones passed CI, so I think it wouldn't break |
21:48:53 | FromGitter | <arnetheduck> well, or it's a nim bug that all the `[hint]` things go to `stderr` when nim is compiling, depending on what you view as nims responsiblity to print |
21:49:11 | shashlick | @arnetheduck - understood - i added a new template to help get started with nimterop wrappers - https://github.com/nimterop/nimterop/blob/master/nimterop/template.nim |
21:49:17 | shashlick | i'll add some to the docs |
21:49:58 | shashlick | @arnetheduck - it's interesting, CC: stuff doesn't come out when running or piping, only when redirecting to file |
21:50:00 | shashlick | makes no sense |
21:50:41 | Araq | jrfondren: I prefer to rethink problems from scratch and then think about backwards compatibility or a migration period |
21:50:49 | FromGitter | <arnetheduck> well, cc comes out when wrapper changes and nim has to call the c compiler in addition to itself compiling |
21:51:19 | Araq | in my experience backwards compat is rather easy to achieve, most of the time |
21:52:11 | FromGitter | <jrfondren> it's more that I don't want to ever type "import jester/jester" or "import jester/src/jester" than that I wouldn't want to update paths |
21:52:19 | shashlick | good point - looks like the CC: filename stuff goes to stdout instead of stderr like everything else |
21:53:50 | FromGitter | <jrfondren> meanwhile... `# 2nd attempt: try to use 'karax/karax'`, `# 3rd attempt: try to use 'karax/src/karax'` |
21:54:14 | shashlick | looks like we need an __init__.py deal going now |
21:54:17 | Araq | karax has no 'src' |
21:55:01 | Araq | "import jester/jester" is simply honest. |
21:55:04 | FromGitter | <jrfondren> well the code's of course `attempt(dir / pkg / f)` and then `attempt(dir / "src" / f)` respectively. |
21:55:13 | FromGitter | <jrfondren> and there's `attempt(dir / "src" / pkg / f)` |
21:56:33 | FromGitter | <mratsim> Well, like @arnetheduck if we look into package management, I think Rust does it quite right. I have lots of issues with Python package management, and it's telling that they had easy_install, now pip, and that the Anaconda devs are fighting against them because they feel like being stifled when they want to introduce new package management features (I think it was shipping prebuilt binaries better than the wheel .whl |
21:56:33 | FromGitter | ... system) |
21:56:44 | * | JappleAck left #nim (#nim) |
21:57:01 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:57:34 | FromGitter | <mratsim> but you're basically forced into cargo |
22:00:20 | FromGitter | <jrfondren> also everything I was talking about just now's under a `when false:` and I am blind. |
22:00:47 | FromGitter | <mratsim> when compiles ;) |
22:14:58 | * | vlad1777d_ joined #nim |
22:25:34 | * | theelous3_ quit (Ping timeout: 252 seconds) |
22:26:35 | * | xet7 quit (Remote host closed the connection) |
22:32:13 | cy1 | mratsim: I will contest that it's not without problem to have your package system include prebuilt binaries. People trying to write secure software will find those systems to be a minefield of gotchas. |
22:32:40 | cy1 | but python's package management system isn't all that great, it's true |
22:32:52 | * | cyberjpn joined #nim |
22:33:56 | FromDiscord_ | <!!Liam is Unlucky> This c library uses _Bool but nim doesn't seem to allow types with _ at start anyone know how I can do it |
22:33:56 | FromDiscord_ | <!!Liam is Unlucky> type _Bool = bool (wont work because of _) |
22:34:18 | FromDiscord_ | <!!Liam is Unlucky> for some reason the _ doesn appear |
22:34:24 | FromDiscord_ | <!!Liam is Unlucky> for some reason the _ doesnt appear |
22:34:30 | FromDiscord_ | <!!Liam is Unlucky> for some reason the _ doesnt appear in discord?? |
22:34:41 | FromDiscord_ | <!!Liam is Unlucky> This c library uses _Bool but nim doesn't seem to allow types with _ at start anyone know how I can do it |
22:34:41 | FromDiscord_ | <!!Liam is Unlucky> type \_Bool = bool (wont work because of _) |
22:34:47 | FromGitter | <jrfondren> it's used for italics |
22:35:03 | FromDiscord_ | <!!Liam is Unlucky> oh I just added \\ in anyway |
22:35:23 | FromDiscord_ | <!!Liam is Unlucky> This c library uses _Bool but nim doesn't seem to allow types with \_ at start anyone know how I can do it |
22:35:23 | FromDiscord_ | <!!Liam is Unlucky> type \_Bool = bool (wont work because of _) |
22:35:32 | FromDiscord_ | <!!Liam is Unlucky> This c library uses _Bool but nim doesn't seem to allow types with \_ at start anyone know how I can do it |
22:35:32 | FromDiscord_ | <!!Liam is Unlucky> type \_Bool = bool (wont work because of \_) |
22:35:49 | * | cy1 left #nim (#nim) |
22:35:51 | FromGitter | <jrfondren> also every time you edit a message in discord it's sent as a new message |
22:36:12 | FromDiscord_ | <!!Liam is Unlucky> oh, woops |
22:36:41 | FromGitter | <jrfondren> anyway you don't need `_Bool` to work in Nim. You just need to give C what values expects for that type--C doesn't care what Nim calls that type of values |
22:37:13 | FromGitter | <jrfondren> so I imagine you're doing something more specific that's failing, like nim2c or something? I've only used manual {.cimport.} kind of FFI |
22:38:02 | FromDiscord_ | <!!Liam is Unlucky> c2nim (nimgen but that just simplifies it) |
22:39:00 | Araq | type CBool {.importc: "_Bool".} = cint or something |
22:39:22 | Araq | the C name is irrelevant, for Nim it's within a string |
22:39:30 | Araq | https://github.com/nim-lang/nimble/issues/653 here you go, dom96 |
22:39:42 | FromDiscord_ | <!!Liam is Unlucky> thanks |
22:39:55 | clyybber | Araq: A global var always has skModule as an owner, is that correct? |
22:40:07 | Araq | or the sfGlobal flag |
22:40:22 | Araq | or it's a threadvar |
22:40:30 | clyybber | ah, ok. forgot about the {.global.} pragma |
22:40:52 | Araq | don't worry, we have a review process |
22:47:26 | clyybber | i know :D |
23:07:33 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:11:21 | dom96 | Araq, for simplicity's sake, and to not derail our discussions might be worth removing the clause about `git clone` |
23:11:28 | dom96 | that's a separate detail that's not relevant IMO |
23:11:49 | Araq | I wrote it this way |
23:11:59 | dom96 | Great write up though, thank you |
23:12:01 | Araq | you can add your remarks |
23:12:25 | shashlick | I see you put the src/ idea on there |
23:12:43 | shashlick | So you prefer having a clean repo as well |
23:17:34 | Araq | good night |
23:23:44 | clyybber | good night |
23:23:46 | * | clyybber quit (Quit: WeeChat 2.4) |
23:34:20 | * | leorize quit (Remote host closed the connection) |
23:34:58 | * | leorize joined #nim |
23:37:00 | * | jjido joined #nim |
23:37:19 | * | kapilp quit (Quit: Connection closed for inactivity) |
23:48:53 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:59:59 | * | cyberjpn quit (Ping timeout: 258 seconds) |