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

Use this library again in JOSM? Depends on Java support. #340

Open
ypid opened this issue Sep 1, 2020 · 2 comments
Open

Use this library again in JOSM? Depends on Java support. #340

ypid opened this issue Sep 1, 2020 · 2 comments
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. type: feature Introduction of new functionality.

Comments

@ypid
Copy link
Member

ypid commented Sep 1, 2020

A user asked if I am working on a way to run this library on newer versions of Java again to maybe reintroduce it into JOSM where it was removed because of Oracles further directions of Java. For transparency, I am moving this thread to the official bug tracker of the project because this could also be interesting for others.

Personally, I am not working on getting it working on newer versions Java. Neither would I be a good person for contract work to do this (nor am I currently available for this). But I am very interested in having the best support for opening_hours in JOSM there is, be it this library or another one.

I of course have some ideas what could be done, but they are more long-term. #136 is about rewriting the library in a more suitable language. Then I played with calling this library on Android some time ago, see https://github.com/ypid/ComplexAlarm.

Ref: https://josm.openstreetmap.de/ticket/18140

So something similar would be my proposal. Find some way to wrap this library and call it from your favorite language. In #136, there was also another way presented by using NodeJS. Depending on your use case, you can also use the https://github.com/opening-hours/opening_hours_server.js which is still up and running.

There is also https://github.com/simonpoole/OpeningHoursParser of course, but it’s feature set is limited.

This issue can be used to exchange what works and what does not.

@ypid ypid added this to the world conquest milestone Sep 1, 2020
@ypid ypid added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. label Sep 1, 2020
@ypid ypid changed the title Using this library from other programming languages (especially newer Java versions) Use this library again in JOSM? Depends on Java support. Jan 2, 2021
@ypid ypid added the type: feature Introduction of new functionality. label Jan 2, 2021
@Artoria2e5
Copy link

Artoria2e5 commented Aug 11, 2021

I have misread the "rewrite in something else and call from NodeJS" thing as "let other languages call NodeJS", which is weird but certainly doable, and might takes less time to "work". The thing to look for is the N-API and napi_call_function. The module system is unavailable, which is a big bummer, but probably still acceptable if you start with the web version. (For JVM you would want to use a different engine. Anything with some sort of run_script and call_function should work.)

The wrapper code is going to need to, uh, collapse the world of JS types into more rigid structs or classess for the outside world. Judging from types/index.d.ts, it would need some way to express tagged unions and date types.


Ahh that's what your project does! sdfhjkajgfdas

@ypid
Copy link
Member Author

ypid commented Aug 14, 2021

Thanks for the tip with using N-API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation. type: feature Introduction of new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants