Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust.eo:29-33: Complete implementation of this object in... #1326

Closed
0pdd opened this issue Oct 9, 2022 · 8 comments · Fixed by #1992
Closed

rust.eo:29-33: Complete implementation of this object in... #1326

0pdd opened this issue Oct 9, 2022 · 8 comments · Fixed by #1992
Assignees

Comments

@0pdd
Copy link

0pdd commented Oct 9, 2022

The puzzle 1161-bdee702e from #1161 has to be resolved:

# @todo #1161:30min Complete implementation of this
# object in Java. This object should load and
# execute *.so file. Only one function is stored
# in *.so file. The signature will be always the
# same.

The puzzle was created by rultor on 09-Oct-22.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

@levBagryansky
Copy link
Member

levBagryansky commented Nov 14, 2022

@Graur I have a problem with testing of this task. Shared lib is supposed to be in target/classes/eo-binaries directory. So I need to take the rust file from tests, compile it to lib and put the lib in this path somehow within installing project. Is it ok to create new mojo which is not a part of compilation (I mean transformation eo objects to java objects)?

@levBagryansky
Copy link
Member

levBagryansky commented Dec 29, 2022

Now we are going to create new method every time we meet a new insert in runtime stage. According to
https://stackoverflow.com/questions/6680674/can-a-java-class-add-a-method-to-itself-at-runtime
we can't just create a new method. Instead, we have to recreate and reload the class with methods every time we encounter a new rust insert for which a function has not yet been generated. Howewer it seems Javassist can still change bytecode I suppose there is an option not to do it.
I guess we can generate this class only once, at the compilation stage. since we know all the rust inserts before runtime, which means we can generate a new java class, just as we generate them from eo objects. So I suggest generating "EOrust.java" somewhere at the parsing stage, where other java files are generated. Before the runtime stage, EOrust java will be generated with all the necessary native methods. This would make it possible to lighten the load in runtime due to compilation.
@yegor256 @Graur WDYT?
I want to check the mechanism on my prototype.

@yegor256
Copy link
Member

@yegor256 I didn't understand the question. If you submit a prototype in a PR, it will be easier to review it.

@volodya-lombrozo
Copy link
Member

@levBagryansky Is that issue solved? Do we need to continue here?

@levBagryansky
Copy link
Member

@volodya-lombrozo yes, it relates to rust inserts

levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 13, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 14, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 14, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 14, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 14, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 14, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 18, 2023
levBagryansky added a commit to levBagryansky/eo that referenced this issue Apr 18, 2023
@0pdd
Copy link
Author

0pdd commented Apr 28, 2023

@0pdd 3 puzzles #2031, #2032, #2033 are still not solved.

@0pdd
Copy link
Author

0pdd commented Jun 2, 2023

@0pdd 2 puzzles #2032, #2033 are still not solved; solved: #2031.

@0pdd
Copy link
Author

0pdd commented Jul 3, 2023

@0pdd the puzzle #2033 is still not solved; solved: #2031, #2032.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants