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

Review and plan the library sharing discussion #7955

Open
3 tasks done
jdunkerley opened this issue Oct 3, 2023 · 6 comments
Open
3 tasks done

Review and plan the library sharing discussion #7955

jdunkerley opened this issue Oct 3, 2023 · 6 comments

Comments

@jdunkerley
Copy link
Member

jdunkerley commented Oct 3, 2023

Pick up the design from @radeusgd: https://github.com/orgs/enso-org/discussions/7692

Aim of this ticket is to agree the design and add follow tickets for implementation as needed.

Tasks

Preview Give feedback
@jdunkerley jdunkerley converted this from a draft issue Oct 3, 2023
@jdunkerley jdunkerley moved this from 📤 Backlog to ⚙️ Design in Issues Board Oct 10, 2023
@JaroslavTulach
Copy link
Member

JaroslavTulach commented Oct 16, 2023

I have created a small project with a Rand type. Now I will turn it into a library:

from Standard.Base import all

polyglot java import java.util.Random as R

type Rand
    Value value:Float ~next:Rand

    new : (Integer|Nothing) -> Rand
    new seed=Nothing =
        next generator = Rand.Value generator.nextDouble (next generator)

        init s =
            g = if s.is_nothing then R.new else R.new s
            next g

        init seed

    take : Integer -> Vector Float
    take self n = Vector.collect self .value .next n

main =
    r = Rand.new
    [ r.value, r.next.value, r.next.next.value ]

btw. the generator is completely private field in the atom inaccessible from outside of Rand.new. By using lazy atom field any implementation detail can be hidden behind them. Similar trick to private JavaScript that hides private stuff in local closures.

@JaroslavTulach
Copy link
Member

JaroslavTulach commented Oct 16, 2023

Upload Sample Library

There is a Simple Library Server written by @radeusgd. Run the server as:

enso/tools/simple-library-server$ ./main.js --port 1273 --upload no-auth --root ~/enso/repository/

then upload here in provided Library_Rand library with enso-engine-*/enso-*/bin/enso using following command:

$ enso --upload http://localhost:1273/upload --in-project Library_Rand

the server will print:

Uploading library [local.Library_Rand:0.0.1].
Upload complete.

the uploaded files will appear as:

~/enso/repository$ find libraries/
libraries/
libraries/Jaroslav
libraries/Jaroslav/Library_Rand
libraries/Jaroslav/Library_Rand/0.0.1
libraries/Jaroslav/Library_Rand/0.0.1/manifest.yaml
libraries/Jaroslav/Library_Rand/0.0.1/package.yaml
libraries/Jaroslav/Library_Rand/0.0.1/main.tgz

Define Edition

Now it is time to register this library as part of demo-oct-2023.yaml edition. Following the instructions describing editions, let's create two files in the editions subdirectory of the server:

~/enso/repository$ find editions/
editions/
editions/demo-oct-2023.yaml
editions/manifest.yaml
~/enso/repository$ cat editions/manifest.yaml
editions:
  - "demo-oct-2023"
~/enso/repository$ cat editions/demo-oct-2023.yaml
extends: 0.0.0-dev
repositories:
  - name: demo-oct-2023
    url: http://localhost:1273/libraries
libraries:
  - name: Jaroslav.Library_Rand
    version: 0.0.1
    repository: demo-oct-2023

the engine-version and extends may not be 0.0.0-dev in your case. Depends what's your engine version!

Use it!

Define pointer to your editions server in global-config.yaml (located in ENSO_CONFIG_DIRECTORY which defaults to $HOME/.config/enso on Linux) with following content:

edition-providers:
  - http://localhost:1273/editions/

Extract Use_Rand.zip and just execute with enso-engine-*/enso-*/bin/enso using following command:

$ enso --run Use_Rand
[0.775797284541735, 0.9978377545435057, 0.10628009155666762, 0.6415067077162341, 0.8467575391411488]

vector with five random floating numbers from zero to one shall be printed.

Troubleshooting

You may want to delete $HOME/.local/share/enso/editions when they download something corrupted.

@JaroslavTulach JaroslavTulach moved this from ⚙️ Design to 🌟 Q/A review in Issues Board Oct 16, 2023
@enso-bot
Copy link

enso-bot bot commented Oct 17, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-10-16):

Progress: - #7955: using package library tutorial: #7955 (comment)

Next Day: runtime parser in browser, prepare presentation for GeeCON

@jdunkerley jdunkerley moved this from 🌟 Q/A review to ⚙️ Design in Issues Board Oct 17, 2023
@enso-bot
Copy link

enso-bot bot commented Oct 18, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-10-17):

Progress: - simplify code PR: #8092

Next Day: start faster, prepare presentation for GeeCON

@enso-bot
Copy link

enso-bot bot commented Oct 19, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-10-18):

Progress: - using Kaz's WASM parser: #8094 (comment)

Next Day: Lo/No Code presentation at GeeCON

@enso-bot
Copy link

enso-bot bot commented Oct 20, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-10-19):

Progress: - towards GeeCON...

Next Day: GeeCON & bugfixing

GitHub
https://openjdk.org/projects/code-tools/jcstress. Contribute to openjdk/jcstress development by creating an account on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⚙️ Design
Development

No branches or pull requests

3 participants