Uncatchable JsonParsingError when encountered in a macro

2022-12-25 Thread wilsonywx2
Re: "who wants the compilation to continue after illformed JSon that you try to eval at compile time?" What I was trying to do is use staticExec to run some other process, then parse the output string. The compilation definitely should fail when the parse fails, but I thought it would be nice t

Uncatchable JsonParsingError when encountered in a macro

2022-12-24 Thread Araq
Which of these alternatives run at compile time? And at comparable compile time speed? I know it's unfair but what is linked into the VM as native code runs much faster.

Uncatchable JsonParsingError when encountered in a macro

2022-12-24 Thread planetis
Why not deprecate/remove marshal for v2? A ton of alternatives exist.

Uncatchable JsonParsingError when encountered in a macro

2022-12-24 Thread Araq
compiler/vmops.nim: registerCallback c, "stdlib.marshal.toVM", proc(a: VmArgs) = let typ = a.getNode(0).typ case typ.kind of tyInt..tyInt64, tyUInt..tyUInt64: setResult(a, loadAny(a.getString(1), typ, c.cache, c.config, c.idgen).intVal) of ty

Uncatchable JsonParsingError when encountered in a macro

2022-12-24 Thread wilsonywx2
Ok, to get started, any pointers to where in the compiler source to look to figure out why it's doing this?

Uncatchable JsonParsingError when encountered in a macro

2022-12-23 Thread wilsonywx2
I came across an unintuitive behavior when writing a macro, where a JsonParsingError thrown by `marshal.to` was not catchable, even though it was placed in a try...except block. Code import marshal macro caught() = try: raise newException(Exception, "bl