Why Nim allowing asm stmt at js ?

2024-01-02 Thread rel
The situation seems to be like "no difference between {.importcpp.} and {.importjs.}" for Js backend. If "{.importcpp.} == {.importjs.}" in js compiler it is confusing why eg. in "dom.nim" both pragmas are used.

Enhancing Nim vtable implementation vs subtype checking

2023-12-28 Thread rel
What is the advantage to have the C++ vtable implementation? Better interop with c++ or extention of the OO design?

Nim Tooling Roadmap

2023-12-28 Thread rel
`importjs` pragma requires the JavaScript target dom.nim(1780, 1): template/generic instantiation of `since` from here Run In VSCode I get this error for all {importjs} pragmas in eg. dom.nim in my project from the nimlangserver. What can I do? How can I config the project

Direct C/C++ interop without generating wrappers?

2023-12-19 Thread rel
Thanks for the hints. @PMunch > However these automatic wrappers will be very C-like, so if you want an > easier Nim experience then you would probably want to write a more Nim-like > interface to the C library which maps it to the automatic memory management, > converts types, and prettifies

Direct C/C++ interop without generating wrappers?

2023-12-18 Thread rel
V-lang is planing(?) for Version 0.5 like Carbon to implement "Direct C/C++ interop without generating wrappers". Would this be possible for Nim too? What would this mean for external C/C++ libs? Simple "import" eg. GLFW an use it?

Which VSCode plugin do you recommend?

2023-12-03 Thread rel
How can I install in VSCode? It's not available in the VSCode Marketplace.

NIR

2023-11-25 Thread rel
I mean with GC for WebAssembly was the time other GC-based languages started to bring their language to the browser intensively. I see your path but doesn't an IR in general offer the possibility to implement a new compiler target easier too? I did not find a roadmap 2024. Does a roadmap for 202

NIR

2023-11-25 Thread rel
Yes, that is known, but is a direct compiler to wasm - without C compiler tools - on the roadmap? Since the GC in the browsers is experimental many UI frameworks (Flutter Dart, Composer Kotlin, Blazor C#, Avalonia C#, ...) try to support WebAssembly in the browser. Most of the frameworks use We

NIR

2023-11-23 Thread rel
Could you share some ideas you have in mind? Is there a native WebAssembly compilation target too?

proc/func/method: syntax

2023-11-16 Thread rel
See my post obove ... it's now clear.

proc/func/method: syntax

2023-11-16 Thread rel
Good explenation.

proc/func/method: syntax

2023-11-15 Thread rel
proc f(): int = 3 Run How often is something like this used? Isn't that const? Considering blocks I see procs (handling indentation) in this category: const f: int = 3 ## block: indentation proc f(): int = 3 proc f() -> int: 3

proc/func/method: syntax

2023-11-15 Thread rel
It's not about transfering code from Python to Nim. Similar syntax to one of the most used prog langs would help to switch between Nim and Python. But this should not be the reason to adapt the syntax. As I wrote I think in this case the syntax ) -> ___: Run has a b

proc/func/method: syntax

2023-11-15 Thread rel
I see increasing readability and consistency not as minor. Migration path to a new Nim version ( 2.5 or 3.0). During this time both syntax variants could be allowed and the comiler prints a warning "deprecated ...". I think it should be even possible to use find/replace in the source code to ch

proc/func/method: syntax

2023-11-15 Thread rel
for 2: "... inconsistent with variable declaration" I don't see an inconsistency between proc declaration (split between header and body of a proc) and a variable declaration/assignment? I would say it's something different. It's a beginning of a block, similar to "try, case, if" construct.

proc/func/method: syntax

2023-11-15 Thread rel
Did/do you think about to chnage the syntax for proc slightly? 1. It seems to be better readable. What does the proc return? 2. Consistency with control flow statements. 3. Compatibility with Python (Type Hints). 4. Migration path ? ## FROM TO proc waitFor(socket: Sock

nimqt - bindings to Qt

2023-10-02 Thread rel
What is the diffrerence between binding in nimqml and nimqt? So far I have found in the docs. nimqml uses for the binding and creation of QObjects and compiles to c. Developer need to compile DOtherSide to a dynLib before you can use the fw. nimqt uses

Nim goto intermediate representation

2023-03-22 Thread rel
Is this IR (intermediate language) a first step to develop a standalone native compiler in near future? What does the IR mean at the moment? Nim-code => (Nim Compiler) => AST and IR => (Nim Copiler) => C/C++/JS => (GCC for C/C++) => Native Code

Why does Nim compiler allways depends on another's language compiler?

2023-03-14 Thread rel
Is Odin moving from LLVM to C? (C-Odin or Codin)

Difference {.importcpp.} vs {.importjs.}

2023-03-11 Thread rel
Yes, that is I wanted to try: newEvent*(name: cstring): Event {.importcpp: "new Event(@)", constructor.} Run in `dom.nim` compiles to JS: event_1124073573 = new Event(eventType_1124073566); Run and newEvent*(name: cstring): Event {.im

Nim in production: 350+ HTTP requests per second on a very modest VM

2023-02-22 Thread rel
Feature request: Coluld you please include a static file handler in Mummy.

Difference {.importcpp.} vs {.importjs.}

2023-02-21 Thread rel
I know {.importcpp.} is used for c++ backend and {.importjs.} should be used for js backend, but both pragmas are used in the js/dom.nim lib. The manual says: "ImportJs pragma Similar to the importcpp pragma for C++, the importjs pragma can be used to import Javascript methods or symbols in gen

JS compiler produces a large file (with -d:release) ?

2022-12-17 Thread rel
`src/nodejs/jsstrformat` would this lib work on server side rendering (no nodejs backend) too?

JS compiler produces a large file (with -d:release) ?

2022-12-16 Thread rel
`echo` is only debuging and can be replaced with `std/jsconsole`. I am not sure if I can use `std/strutils` instead of `std/strformat`. What I try to do is to use the declarativ way of html and need interpolation in the multiline string to include a page or component. Like template literals and

JS compiler produces a large file (with -d:release) ?

2022-12-16 Thread rel
Thank you the base information. My code: File: renlite_core.nim import dom type ListenerFunc = proc (e: Event) {.closure.} proc createEventBus*(eventName: cstring) {.exportc.} = document.appendChild(document.createComment(eventName)) proc eve

JS compiler produces a large file (with -d:release) ?

2022-12-15 Thread rel
Hello, could you please explain me, why is the js file after compilition with -d:release so big? Example: nim about 60 loc (2 kb) makes js of about 1.200 loc (75 kb). The compiler offers already static typing and the generation of one file (no npm tool), what is really helpful. A compiled types