How does QCode work?
First, I think it is good not to use “$” for local variables and the language seems to be more consistenst than 4D-Lang.
- I suppose the code runs only on the server. Is the code compiled or just interpreted on the 4D-server?
- Maybe there exist some functions/cleint actions that are traspiled to JS on the client?
- A technical overview of QodlyScript would be interesting.
- Which JS-Framework(React) do you use for the QodlyStudio?
Thanks for your remarks. QodlyScript differs from 4D Language but both have their benefits.
QodlyScript only runs server side, currently it runs interpreted.
QodlyScript is never “transpiled” to JS on the client.
You can refer to Data Model Objects | Qodly Developer Center and QodlyScript | Qodly Developer Center to get an idea. We’re open to suggestions in case you think something is missing.
Main frameworks we use are React and Tailwind CSS, it would be long to list the whole stack.
I looked at the docs in dev center, some remarks:
The “new” keyword to create an instance of a class is not used in modern programming languages very often. It’s easier and shorter to create an instance, eg. pers = cs.Person(“firstName”, “Lastname”) without the “new” keyword.
Declaring and assigning data to a variable in one line would be helpful.
eg. var myVar : string = “hello” or with type inference eg. myVar := “hello”
Some instances (File) from the 4D.libs are created without and others (HTTPRequest) with the “.new()” keyword. What is the idea in this case?
Is Qodly runtime a lightweight subset of the 4d-Lang without all the legency commands?
What is the size of the Qodly runtime compared eg. with Python?
Thanks for sharing your ideas! it is always useful!
BTW Some of them may arrive sooner than you think.
About QodlyScript, you’re right saying that it does not support 4D’s classic commands. You can refer to 4D documentation to know the differences.
I tried the WebFormItem.hide() method and like you mentioned it is executed on the server. I think to start a request to the server for a task that happens only on the client is an unnecessary roundtrip. Manipulation on the UI that don’t need to send an upload to the server can be executed by the JS framework.
The developer could decide where to call the function (client/server). So QodlyStudio could offer a function-type (eg. Client, UI) in the menu for only WebFormClient and WebFormItemClient methods. These classes will call the mapped JS classes/methods.
We agree and will be improving this area for sure. Stay tuned!
For this kind of suggestions, don’t hesitate to write a post in the Ideas - Qodly Community category!