Geniune question about JS backend support

2021-12-19 Thread juancarlospaco
> Nim type behave like a ES6 class

Issues with proxy authentication

2021-12-19 Thread xioren
Yessir, already merged to devel.

Nim with curly brace and tab

2021-12-19 Thread Araq
> Productivity of virtually any human-computer UI is a much harder question to > pose/answer and usually just asserted/guessed. E.g., the people who freak out > about the offside rule mostly cite various code manipulation habits. Almost > all claims are quantitatively framed but very weakly stud

Nim with curly brace and tab

2021-12-19 Thread xioren
Context is important here. Certainly a keyboard first approach in a user environment designed for mouse interaction is going to be slower. But imo using a keyboard in an environment designed for keyboards (i3 wm) will almost always be faster than using a mouse in an environment designed for mice

Nim with curly brace and tab

2021-12-19 Thread Araq
> Mouse is better for 2D things like first person cameras or some menus, which > almost applies to code, but generally code is still 1D. Nah, it's really 2D and code navigation sucks with keyboards. It's not unlike browsing the web and nobody dreams of browsers without mouse or touchscreen supp

Geniune question about JS backend support

2021-12-19 Thread gcao
Thank you Araq. It's nice to hear that you have this vision of separating JS to its own repo and having its own release cycle. Will this be on the roadmap of Nim2 or the release after? If it does happen, I suppose it's a breaking change and require a lot of changes to documentation etc.

Geniune question about JS backend support

2021-12-19 Thread gcao
Thank you for your reply. I understand the JS backend is decent and there are web frameworks like Karax built on top of it. I'm curious how well it can hold in the long run. When people start to do all sorts of things, like integrate with React and JSX, or if people want a Nim type behave like a

Issues with proxy authentication

2021-12-19 Thread ZadaZorg
Ah, cool. looking at it looks like most schemes are named with the capital first letter. You have to create pull request to nim code :)

Geniune question about JS backend support

2021-12-19 Thread Araq
The JS backend is 3000 lines of code and it is reasonably stable and is not too expensive to support. It also does support pointers. In 5 years from now we might have extracted and moved it to its own git repository, `nim-lang/nimjs` and will come with its own libraries and release cycle.

Using C, C#, Java, Wasm, Ruby, Python NodeJS, TypeScript... libraries from Nim with MetaCall

2021-12-19 Thread reversem3
Do you have an example calling a C library from nim? Or maybe importing a C library in nim, then allowing nim to use the functions?

Wrapperless interop with C/C++

2021-12-19 Thread reversem3
Anyway you have time to get me started with diligent engine and nim?

Geniune question about JS backend support

2021-12-19 Thread gcao
Let me take this chance to wish everyone a happy holiday! I have this question lingering in my mind for some time and found time today to write them down. I hope it doesn't create anxiousness while you enjoy your days off. There is no urgent need to reply to me.

Geniune question about JS backend support

2021-12-19 Thread Yardanico
> I assume in order to enable people to use Nim-generated JS, we need to be > able to call from Nim to native JS code, and from JS to Nim code. You already can use JS functions/etc in Nim with `importjs` (also see , and export Nim code to JS as usual with

Geniune question about JS backend support

2021-12-19 Thread gcao
Hi, I've used Nim for over a year and really liked it. Prior to learning Nim, I spent a year learning Rust but gave up because it felt too complex and I kept fighting with the borrow checker and the compiler. My productivity was not good. So I tried Nim and was able to pick up easily and get a

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread mantielero
I think this is what makes me feel more confortable. Thank you eveybody for the sugestions.

Pythons None in Nim

2021-12-19 Thread kobi
I think it maps to either nil or Option none type. works better with option. also, u can type: some val (without parentheses) or val.some I personally think the options module should be in the Nim's prelude, receiving the blessing :-)

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread kobi
You can have setGrp, setWp, on System object. they can be saved in that type, and then you use the more flexible parameters... if I understood your usecase. I think that's the best way. other options are a singleton or an external json etc. just some ideas. i think the first solution is the most

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread enthus1ast
Why not create a new type that holds these objects and pass this to the procs?

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread planetis
You can use templates template fname: untyped = fname(sys, p1, p2) Run

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread ynfle
Either with default parameters or overloading the function definition. Check the manual () for these. My guess is you come from a dynamic language like python, ruby, javascript

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread mantielero
But it looks like `using` simplifies the definition of the functions. I am looking to simplify the way in which I use the functions.

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread mantielero
First sorry for the thread's subject, but I don't know how to explain it well. I have several functions that follow a pattern simular to this: proc fname(sys:var System; param1:P1; param2:P2; .; wp:Workplane; grp:Group):Whatever = Run But once known `

What approach can I use to fix a number of parameters in some functions?

2021-12-19 Thread aEverr
excerpt: using c: Context n: Node counter: int proc foo(c, n) = ... proc bar(c, n, counter) = ... proc baz(c, n) = ... proc mixedMode(c, n; x, y: int) =

Pythons None in Nim

2021-12-19 Thread Araq
Fwiw I find `int.low` so useless (as there is no positive equivalent) that using it as `None` is perfectly fine.

Pythons None in Nim

2021-12-19 Thread Jocker
Yea, that's what I did. Looks like it is the best solution

Pythons None in Nim

2021-12-19 Thread demotomohiro
You can use type class to pass int or nil. Unlike `std/options`, which type of value you pass must be determined at compile time. Please read this for more details: proc foo(x: int or typeof(nil); y: int or typeof(nil))

Nim 1.6.2 released

2021-12-19 Thread Omnomnim
Sweet. Happy holidays!

Pythons None in Nim

2021-12-19 Thread pietroppeter
and since I am just running into this example while writing Python code, another case where a None in Python can be replaced by something else in Nim, is the case where a None stands for a value that has a default in terms of previous parameters. For example: def constant(size=5, s

Pythons None in Nim

2021-12-19 Thread Jocker
Will probably go with that, always having to write some(value) Run is kinda annoying

Pythons None in Nim

2021-12-19 Thread Jocker
yea, I already did that for other procs but it doesn't really make sense in my case right now

A rant about Nim bugs

2021-12-19 Thread QMaster
I can add that features are added randomly without any real roadmap and as said by @konsumlamm without any proper testing and documenting. One is forced to dig into Nim sources to understand how the feature should work and might be used. Also I see that there's no understanding of the difference

A rant about Nim bugs

2021-12-19 Thread xigoi
A big problem is that if a language has n features, there are O(n²) interactions between them. And Nim has a lot of features.

A rant about Nim bugs

2021-12-19 Thread Hlaaftana
The compiler being hard to understand would not necessarily be fixed by documenting it. It just isn't always written in some mathematically perfect way. Ideally you would make things more straightforward over time but realistically only the original author can do that if it's so eldritch. The "i

Nim 1.6.2 released

2021-12-19 Thread JPLRouge
Hello, I am happy the follow-up is very well written because the translation is reliable as well as everyone who participated. So very enriching. Have a great end of year party