enum Value = Id | Int | String | Bytes
Statement = (Id, Id, Value)
Ligature = Map[DatasetName, Set[Statement]]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIMP Palette | |
Name: Progress Pride Flag | |
# | |
228 3 3 #E40303 Red | |
255 140 0 #FF8C00 Orange | |
255 237 0 #FFED00 Yellow | |
0 128 38 #008026 Green | |
36 64 142 #24408E Indigo | |
115 41 130 #732982 Violet | |
255 255 255 #FFFFFF While |
- I'm only interested in using the output of wasm-pack after it has been deployed to npm (or used locally as an npm dep).
- I ended up using
vite-plugin-wasm-pack
, I also triedvite-plugin-wasm
but ran into issues. - Make sure you build your wasm-pack project with
wasm-pack build --target web
- Make sure that all the names used to build and deploy your project are the same (at first I was building
x-wasm
and then naming the npm depx
switching tox-wasm
worked). - In the package.json for the generated wasm-pack output you'll need to add
"type": "module"
and"main": x_wasm.js
.- 📝
TODO
I need to look into how to do this automatically.
- 📝
- In
vite.config.js
add the following pluginwasmPack([], ['x-wasm'])
- Below are two examples of using wasm code from js
Regular js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
public static void main(String []args){ | |
final var x = 5; | |
// You can do something like this in Kotlin/Scala etc but not Java | |
// final var t = if (x == 0) { | |
// "zero"; | |
// } else if (x > 0) { | |
// "pos"; | |
// } else { | |
// "neg"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jetbrains.exodus.env.Environment | |
import jetbrains.exodus.env.EnvironmentConfig | |
import java.nio.file.Path | |
import jetbrains.exodus.io.inMemory.MemoryDataWriter | |
import jetbrains.exodus.io.inMemory.MemoryDataReader | |
import jetbrains.exodus.io.inMemory.Memory | |
import jetbrains.exodus.log.LogConfig | |
import jetbrains.exodus.env.Environments | |
import org.libraryweasel.ligature.LigatureStore | |
import org.libraryweasel.ligature.ReadTx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
package org.libraryweasel.pack | |
import org.jgroups.* | |
import java.io.Serializable | |
import java.lang.Exception | |
import java.lang.RuntimeException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val config = Config() | |
config.networkConfig.join.multicastConfig.isEnabled = false | |
config.networkConfig.join.tcpIpConfig.isEnabled = true | |
config.networkConfig.publicAddress = "127.0.0.1" | |
val instance = Hazelcast.newHazelcastInstance(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scratchpad.jgroups | |
import org.jgroups.* | |
import java.io.Serializable | |
fun createWithReceiver(receiver: Receiver): JChannel { | |
val ch = JChannel() | |
ch.receiver = receiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r . | |
git checkout HEAD~3 . | |
git commit |
NewerOlder