257 Members
METACALL is a library that allows calling functions, methods or procedures between programming languages. With METACALL you can transparently execute code from / to any programming language, for example, call a Python function from NodeJS.2 Servers

Load older messages

22 Jun 2021
@_discord_550395604098875417:t2bot.ioviferga in our case, all our languages we support don't have that facility, you usually have to create a new function if you want to mutate the signature 15:48:01
@_discord_550395604098875417:t2bot.ioviferga this changes with classes, we are doubting how to implement them right now, at the moment we aren't tracking the signatures of the methods due to this behavior 15:48:48
@_discord_550395604098875417:t2bot.ioviferga but this is problematic with Java, and I'm still doubting how to solve this 15:49:03
@_discord_790128907554783245:t2bot.iodarabi But for JS, you said that there is no type inference, so the loader cannot know the type of the return value. 15:51:05
@_discord_790128907554783245:t2bot.iodarabi Or did I get something wrong? 15:51:09
@_discord_550395604098875417:t2bot.ioviferga ah, well, you can change the number of arguments for example 15:51:10
@_discord_550395604098875417:t2bot.ioviferga you have to create a new function 15:51:10
@_discord_790128907554783245:t2bot.iodarabi I see. 15:51:11
@_discord_550395604098875417:t2bot.ioviferga but let's say, typescript, it would be the same 15:51:11
@_discord_790128907554783245:t2bot.iodarabi I'm just struggling to convert the result of metacallv to something useful in my host language 15:51:11
@_discord_790128907554783245:t2bot.iodarabi And metacall_value_id gives me enough information to do the conversion dynamically 15:51:28
@_discord_550395604098875417:t2bot.ioviferga that's right, you can get the type of a returned value with that 15:52:00
@_discord_790128907554783245:t2bot.iodarabi For node and a returned double, I get METACALL_DOUBLE.
But for py and a returned String, I get METACALL_INVALID. Does that mean that something went wrong calling the function?
@_discord_550395604098875417:t2bot.ioviferga probably 15:55:36
@_discord_550395604098875417:t2bot.ioviferga you can enable debug logs to see more info 15:55:57
@_discord_790128907554783245:t2bot.iodarabi I have already 15:56:04
@_discord_550395604098875417:t2bot.ioviferga mmmm, what happens if you return a double from python? like 3.9 15:57:54
@_discord_790128907554783245:t2bot.iodarabi https://pastebin.com/kK40PKRX 15:58:00
@_discord_790128907554783245:t2bot.iodarabi Loading test.py seems to work without problems. I also load sum.js with node. 15:58:58
@_discord_790128907554783245:t2bot.iodarabi Calling sum from sum.js leaves a trace in the log, but calling py_test from test.py doesn't. 15:59:35
@_discord_550395604098875417:t2bot.ioviferga [Tue Jun 22 15:21:34] #47 [ 679 | loader_impl_load_from_file | /usr/local/metacall/source/loader/source/loader_impl.c ] @Debug : Loader interface: 0x7f233c24b5c0; Loader handle: (nil) 15:59:56
@_discord_550395604098875417:t2bot.ioviferga seems like the handle is NULL 16:00:02
@_discord_790128907554783245:t2bot.iodarabi When loading several node scripts, I can always pass NULL. When I load another language for the first time, I have to use the handle which I received from the first call? 16:02:44
@_discord_550395604098875417:t2bot.ioviferga you can pass NULL too 16:03:09
@_discord_550395604098875417:t2bot.ioviferga well, it would be better if you show me your code 16:03:24
@_discord_550395604098875417:t2bot.ioviferga otherwise I don't have a detailed idea of what you mean 16:03:45
@telegram_1671359833:t2bot.io.. changed their display name from PΛЯSλ RTX to ...16:58:44
@telegram_779034206:t2bot.ioJoan Valuo Desarrollo joined the room.21:19:01
23 Jun 2021
@telegram_1816586591:t2bot.ioLuis P. Clark joined the room.01:34:14

There are no newer messages yet.

Back to Room List