503
مشترکین
+124 ساعت
+37 روز
+8130 روز
آرشیو پست ها
503
The automatic translation of java.lang.String has been re-enabled.
The issue was not related to String translation itself. The real problem was in java.call() dispatch logic.
Current java.call() target handling
// Target | Meaning | Dispatch // Class<?> | static call | Class.method // Object instance | instance call | obj.methodI removed support for treating a raw String as a class name target. That means java.call() no longer tries to resolve a String value as a class path. Instead, it correctly distinguishes between: - Class<?> for static method calls - Java object instances for instance method calls This fixes the case where a java.lang.String object was being misinterpreted as a class name, which caused class resolution errors and method invocation failures. Now java.call() works with the correct dispatch behavior and avoids this confusion.
503
Repost from N/a
TODO: I must stop auto-converting Java String objects into Saynaa String class.
Bug:
strt = java.new("java.lang.String", "Hello OUT\n")
bytes = java.call(strt, "getBytes")
The variable strt is a Saynaa String instead of a JavaObject, so calling getBytes() fails.
It incorrectly behaves like:
bytes = java.call("Hello OUT\n", "getBytes")503
🔨 1 new commit to SaynaaIDE:main:
73c1e09: fix(java-bridge): preserve java.lang.String objects and avoid implicit SaynaaString conversion
Java String instances returned from constructors and method calls are
now kept as JavaObject values instead of being automatically converted
to SaynaaString. This allows Java methods such as getBytes() to be
called correctly on String instances.
by Mohammed Abdifitaax (Mahdiware)
503
🔨 1 new commit to SaynaaIDE:main:
d429973: build(deps): add R8 library for D8 dex compiler support
- added com.android.tools:r8 dependency
- enables Java .class to .dex compilation inside IDE by Mohammed Abdifitaax (Mahdiware)
503
🔨 1 new commit to SaynaaIDE:main:
e3bd4ef: chore(storage): add MANAGE_EXTERNAL_STORAGE for testing phase
Temporary full file access enabled for development.
Will be replaced with SAF (DocumentFile) based workspace system. by Mohammed Abdifitaax (Mahdiware)
503
🔨 1 new commit to SaynaaIDE:main:
3a8c607: refactor: remove duplicate callStatic usage and simplify JNI bridge
- replaced java.callStatic with java.call where appropriate
- removed unused jmethodID entries from JNI layer
- moved methods from JavaBridge into reflection package by Mohammed Abdifitaax (Mahdiware)
503
🔨 1 new commit to SaynaaIDE:main:
292c82e: added org.eclipse.jdt dependence, and storage permission by Mohammed Abdifitaax (Mahdiware)
503
🔨 2 new commits to SaynaaIDE:main:
976d613: feat(reflection): introduce reflection engine and improve JavaBridge + JNI integration by Mohammed Abdifitaax (Mahdiware)
b617cb9: chore: bump version to 2.0.1 (versionCode 201) by Mohammed Abdifitaax (Mahdiware)
503
Refactored JNI layer to be lightweight by removing duplicate and unnecessary overhead code.
and left some i will fix later.
503
```java
SaynaaModule module = state.newModule(module_name);
state.moduleSetGlobal(module, "context", state.getContext());
state.moduleSetGlobal(module, "saynaadir", state.getSaynaaDir());
state.moduleSetGlobal(module, "bindClass", JavaBridge.class, "findClass");
state.moduleSetGlobal(module, "new", this, "newJavaObject");
state.moduleSetGlobal(module, "getField", JavaBridge.class, "getFieldValue");
state.moduleSetGlobal(module, "setField", JavaBridge.class, "setFieldValue");
state.moduleSetGlobal(module, "tostring", JavaBridge.class, "javaToString");
state.moduleSetGlobal(module, "instanceof", JavaBridge.class, "instanceOf");
state.moduleSetGlobal(module, "callStatic", JavaBridge.class, "callStaticJavaMethod");
state.moduleSetGlobal(module, "length", JavaBridge.class, "lengthOf");
state.moduleSetGlobal(module, "testing", this, "testing");
state.registerModule(module);
503
🔨 1 new commit to SaynaaIDE:main:
f871305: moved 'java' module form c/c++ to java by Mohammed Abdifitaax (Mahdiware)
503
🔌 New pull request saynaa-lang#43 Refactor native API and add CLI for Saynaa
by: @Mahdiware
- Updated native API to remove auto-detect functions and introduced LoadScript function.
- Modified nativeapi.h to reflect changes in function signatures and added LoadScriptResult struct.
- Created a new Makefile for CLI to compile and link Saynaa code.
- Implemented main.c for CLI to load and run scripts, handling bytecode and source files.
- Added example scripts (test1.sa and test2.sa) for testing the CLI functionality.
Reply to this message to post a comment on GitHub.
503
🔨 1 new commit to SaynaaIDE:main:
b150ef9: Refactor Saynaa module and improve bytecode handling
- Removed SaynaaOnClickListener class as it was no longer needed.
- Updated FileUtil to increment asset copy version from 12 to 13.
- Enhanced saynaa_compiler.c with new functions for constant folding and improved binary operation handling.
- Added checksum validation to bytecode writing in saynaa_bytecode.c.
- Introduced global variable preservation and restoration in saynaa_module.c to maintain state across module executions.
- Improved error handling and code readability across various files. by Mohammed Abdifitaax (Mahdiware)
503
🔨 2 new commits to saynaa-lang:fix/compiler:
69e925d: Implement constant folding for binary operations in the compiler by Mohammed Abdifitaax (Mahdiware)
7a99c57: Implement constant folding for binary operations in the compiler by Mohammed Abdifitaax (Mahdiware)
503
🔨 1 new commit to saynaa-os:main:
49f5170: Add scanf and related functions to libc, enhance terminal handling, and implement window manager features
- Implemented scanf, vscanf, sscanf, and vsscanf functions in libc for formatted input.
- Added termios.h for terminal I/O control, including struct termios and related constants.
- Enhanced terminal input handling in the shell to support echoing characters based on terminal settings.
- Updated clear command in userspace to use sys_write instead of syscall1 for better compatibility.
- Created a new startwm program to initialize the window manager and background processes.
- Refactored terminal.c to improve input handling and output rendering, including support for PTY.
- Added keyboard mode setting in the window manager to manage input correctly.
- Introduced a scanfdemo program to demonstrate the usage of scanf for user input. by Mohammed Abdifitaax (Mahdiware)
