es4x icon indicating copy to clipboard operation
es4x copied to clipboard

Discuss: Will Deno be good for es4x?

Open luboslives opened this issue 5 years ago • 8 comments

It's beyond me to contribute to this conversation, but I'm curious. Deno is getting a big media push lately as it released V1.0 recently. Briefly looking at this project, I notice a lot of the issues people have with es4x revolve around not being able to use their Node servers without having to refactor a ton of stuff (... the native Node modules problem I keep seeing mentioned).

Should the rise of Deno be considered a fresh start for es4x? Could you develop the project alongside Deno to make the transition to es4x a lot smoother than it would be coming over from Node? For example, #262

Or does Deno only scratch the surface of the entire infrastructure that lays underneath? Again, these topics are way beyond me - I'm just interested in speed optimizations and found out about this project yesterday - but I'd be interested to read some input and try to make sense of it.

luboslives avatar May 17 '20 12:05 luboslives

Hi, this is a very interesting topic. I've followed deno since its announce 2y ago at jsconf. There are a couple of things I like (using module standards for example) and offering a secure runtime.

I've been thinking how to get some of the these into es4x. For security I believe we can do the same or better with the jvm security policy. For modules, you can see that some work is there to support esm for more than 1y.

How to proceed here is now the question. If I say we follow deno deps.ts then it might be easy to implement a "compatible" runtime I guess. No need to reimplement all the hacks node does, plus the default deno standard lib is smaller.

Like you said, now that deno is 1.0 maybe es4x niche username is deno users which require better performance.

pmlopes avatar May 17 '20 17:05 pmlopes

@luboslives I just spent a few minutes looking into java security policies, trying to remember the days of the applets ;-)

So I did a quick experiment:

First create a policy to allow everything:

grant codeBase "file:node_modules/.lib/*" {
    permission java.security.AllPermission;
};

Then figure out the launch command:

java -Djava.security.debug=access -Djava.security.manager -Djava.security.policy=security.policy -jar node_modules/.bin/es4x-launcher.jar run index.js

And this is crazy, you get the following output for a simple hello world:

access: access allowed ("java.io.FilePermission" "/dev/random" "read")
access: access allowed ("java.io.FilePermission" "/dev/urandom" "read")
access: access allowed ("java.io.FilePermission" "/etc/hosts" "read")
access: access allowed ("java.io.FilePermission" "/etc/os-release" "read")
access: access allowed ("java.io.FilePermission" "/etc/resolv.conf" "read")
access: access allowed ("java.io.FilePermission" "/etc/resolver" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.bin/es4x-launcher.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/chromeinspector-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/es4x-0.11.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/graal-sdk-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/js-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/netty-common-4.1.48.Final.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/netty-resolver-4.1.48.Final.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/netty-resolver-dns-4.1.48.Final.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/netty-transport-4.1.48.Final.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/profiler-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/regex-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/truffle-api-20.0.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/vertx-core-3.9.0.jar" "read")
access: access allowed ("java.io.FilePermission" "/home/paulo/Projects/reactiverse/es4x/examples/simple/node_modules/.lib/vertx-unit-3.9.0.jar" "read")
access: access allowed ("java.io.FilePermission" "index.js" "read")
access: access allowed ("java.io.FilePermission" "/proc/self/status" "read")
access: access allowed ("java.io.FilePermission" "/proc/sys/net/core/somaxconn" "read")
access: access allowed ("java.io.FilePermission" "/tmp" "read")
access: access allowed ("java.io.FilePermission" "/tmp/vertx-cache/file-cache-ace7fb99-69fb-48fa-a306-04094be72443" "delete")
access: access allowed ("java.io.FilePermission" "/tmp/vertx-cache/file-cache-ace7fb99-69fb-48fa-a306-04094be72443" "read")
access: access allowed ("java.io.FilePermission" "/tmp/vertx-cache/file-cache-ace7fb99-69fb-48fa-a306-04094be72443" "write")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/jre" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libmanagement.so" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnet.so" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libnio.so" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/cldrdata.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/dnsns.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/icedtea-sound.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jaccess.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/java-atk-wrapper.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/localedata.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/nashorn.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunec.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunjce_provider.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunpkcs11.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/zipfs.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jndi.properties" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/logging.properties" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/jre" "read")
access: access allowed ("java.io.FilePermission" "/usr/lib/jvm/java-8-openjdk-amd64/release" "read")
access: access allowed ("java.lang.reflect.ReflectPermission" "newProxyInPackage.io.netty.channel")
access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")
access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.management")
access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.ch")
access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.reflect")
access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.provider")
access: access allowed ("java.lang.RuntimePermission" "accessDeclaredMembers")
access: access allowed ("java.lang.RuntimePermission" "closeClassLoader")
access: access allowed ("java.lang.RuntimePermission" "createClassLoader")
access: access allowed ("java.lang.RuntimePermission" "fileSystemProvider")
access: access allowed ("java.lang.RuntimePermission" "getClassLoader")
access: access allowed ("java.lang.RuntimePermission" "getenv.*")
access: access allowed ("java.lang.RuntimePermission" "getenv.ES4XHOSTCLASSFILTER")
access: access allowed ("java.lang.RuntimePermission" "getenv.VERBOSE_GRAALVM_LOCATOR")
access: access allowed ("java.lang.RuntimePermission" "getProtectionDomain")
access: access allowed ("java.lang.RuntimePermission" "loadLibrary.management")
access: access allowed ("java.lang.RuntimePermission" "loadLibrary.net")
access: access allowed ("java.lang.RuntimePermission" "loadLibrary.nio")
access: access allowed ("java.lang.RuntimePermission" "modifyThread")
access: access allowed ("java.lang.RuntimePermission" "selectorProvider")
access: access allowed ("java.lang.RuntimePermission" "setContextClassLoader")
access: access allowed ("java.lang.RuntimePermission" "shutdownHooks")
access: access allowed ("java.net.NetPermission" "getNetworkInformation")
access: access allowed ("java.net.SocketPermission" "[0:0:0:0:0:0:0:0]" "resolve")
access: access allowed ("java.net.SocketPermission" "127.0.0.53:53" "connect,resolve")
access: access allowed ("java.net.SocketPermission" "fedorento" "resolve")
access: access allowed ("java.net.SocketPermission" "localhost:8080" "listen,resolve")
access: access allowed ("java.security.SecurityPermission" "getProperty.networkaddress.cache.negative.ttl")
access: access allowed ("java.security.SecurityPermission" "getProperty.networkaddress.cache.ttl")
access: access allowed ("java.security.SecurityPermission" "getProperty.securerandom.source")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.1")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.10")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.2")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.3")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.4")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.5")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.6")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.7")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.8")
access: access allowed ("java.security.SecurityPermission" "getProperty.security.provider.9")
access: access allowed ("java.security.SecurityPermission" "putProviderProperty.SUN")
access: access allowed ("java.util.logging.LoggingPermission" "control")
access: access allowed ("java.util.PropertyPermission" "com.oracle.graalvm.isaot" "read")
access: access allowed ("java.util.PropertyPermission" "com.oracle.graalvm.locator.verbose" "read")
access: access allowed ("java.util.PropertyPermission" "com.sun.jndi.ldap.object.trustURLCodebase" "read")
access: access allowed ("java.util.PropertyPermission" "com.sun.sdp.conf" "read")
access: access allowed ("java.util.PropertyPermission" "es4x.host.class.filter" "read")
access: access allowed ("java.util.PropertyPermission" "es4x.polyglot" "read")
access: access allowed ("java.util.PropertyPermission" "es4x.prefix" "read")
access: access allowed ("java.util.PropertyPermission" "file.separator" "read")
access: access allowed ("java.util.PropertyPermission" "graalvm.ForcePolyglotInvalid" "read")
access: access allowed ("java.util.PropertyPermission" "impl.prefix" "read")
access: access allowed ("java.util.PropertyPermission" "inspect-brk" "read")
access: access allowed ("java.util.PropertyPermission" "inspect" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocation.cacheTrimIntervalMillis" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.cacheTrimIntervalMillis" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.cacheTrimInterval" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.directMemoryCacheAlignment" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.maxCachedBufferCapacity" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.maxCachedByteBuffersPerChunk" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.maxOrder" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.normalCacheSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.numDirectArenas" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.numHeapArenas" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.pageSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.smallCacheSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.tinyCacheSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.type" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.allocator.useCacheForAllThreads" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.availableProcessors" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.bitMode" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.buffer.bytebuf.checkAccessible" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.buffer.checkAccessible" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.buffer.checkBounds" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.customResourceLeakDetector" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.defaultPromise.maxListenerStackDepth" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.eventexecutor.maxPendingTasks" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.eventLoop.maxPendingTasks" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.eventLoopThreads" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.leakDetection.level" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.leakDetectionLevel" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.leakDetection.samplingInterval" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.leakDetection.targetRecords" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.machineId" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.maxDirectMemory" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.maxThreadLocalCharBufferSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.noJdkZlibDecoder" "write")
access: access allowed ("java.util.PropertyPermission" "io.netty.noKeySetOptimization" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.noPreferDirect" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.noResourceLeakDetection" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.noUnsafe" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.processId" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.selectorAutoRebuildThreshold" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.threadLocalDirectBufferSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.threadLocalMap.stringBuilder.initialSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.threadLocalMap.stringBuilder.maxSize" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.tmpdir" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.transport.outboundBufferEntrySizeOverhead" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.tryReflectionSetAccessible" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.tryUnsafe" "read")
access: access allowed ("java.util.PropertyPermission" "io.netty.uninitializedArrayAllocationThreshold" "read")
access: access allowed ("java.util.PropertyPermission" "java.home" "read")
access: access allowed ("java.util.PropertyPermission" "java.io.tmpdir" "read")
access: access allowed ("java.util.PropertyPermission" "java.net.preferIPv4Stack" "read")
access: access allowed ("java.util.PropertyPermission" "java.net.preferIPv6Addresses" "read")
access: access allowed ("java.util.PropertyPermission" "java.nio.channels.spi.SelectorProvider" "read")
access: access allowed ("java.util.PropertyPermission" "java.nio.file.spi.DefaultFileSystemProvider" "read")
access: access allowed ("java.util.PropertyPermission" "java.security.egd" "read")
access: access allowed ("java.util.PropertyPermission" "java.specification.version" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.Arrays.useLegacyMergeSort" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.logging.config.class" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.logging.config.file" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.logging.manager" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.logging.SimpleFormatter.format" "read")
access: access allowed ("java.util.PropertyPermission" "java.util.secureRandomSeed" "read")
access: access allowed ("java.util.PropertyPermission" "java.version" "read")
access: access allowed ("java.util.PropertyPermission" "java.vm.name" "read")
access: access allowed ("java.util.PropertyPermission" "jdk.internal.lambda.dumpProxyClasses" "read")
access: access allowed ("java.util.PropertyPermission" "jdk.net.useFastTcpLoopback" "read")
access: access allowed ("java.util.PropertyPermission" "jdk.nio.maxCachedBufferSize" "read")
access: access allowed ("java.util.PropertyPermission" "jdk.security.legacyDSAKeyPairGenerator" "read")
access: access allowed ("java.util.PropertyPermission" "js.ecmascript-version" "read")
access: access allowed ("java.util.PropertyPermission" "js.home" "read")
access: access allowed ("java.util.PropertyPermission" "line.separator" "read")
access: access allowed ("java.util.PropertyPermission" "org.graalvm.launcher.home" "read")
access: access allowed ("java.util.PropertyPermission" "org.graalvm.launcher.relative.home" "read")
access: access allowed ("java.util.PropertyPermission" "org.graalvm.nativeimage.imagecode" "read")
access: access allowed ("java.util.PropertyPermission" "org.graalvm.version" "read")
access: access allowed ("java.util.PropertyPermission" "org.jboss.netty.tryUnsafe" "read")
access: access allowed ("java.util.PropertyPermission" "os.arch" "read")
access: access allowed ("java.util.PropertyPermission" "os.name" "read")
access: access allowed ("java.util.PropertyPermission" "path.separator" "read")
access: access allowed ("java.util.PropertyPermission" "polyglot.image-build-time.DisablePrivileges" "read")
access: access allowed ("java.util.PropertyPermission" "polyglotimpl.DebugMissingClose" "read")
access: access allowed ("java.util.PropertyPermission" "polyglot" "read")
access: access allowed ("java.util.PropertyPermission" "prefix" "read")
access: access allowed ("java.util.PropertyPermission" "*" "read,write")
access: access allowed ("java.util.PropertyPermission" "regex.home" "read")
access: access allowed ("java.util.PropertyPermission" "sun.arch.data.model" "read")
access: access allowed ("java.util.PropertyPermission" "sun.misc.ProxyGenerator.saveGeneratedFiles" "read")
access: access allowed ("java.util.PropertyPermission" "sun.net.inetaddr.ttl" "read")
access: access allowed ("java.util.PropertyPermission" "sun.net.maxDatagramSockets" "read")
access: access allowed ("java.util.PropertyPermission" "sun.net.spi.nameservice.provider.1" "read")
access: access allowed ("java.util.PropertyPermission" "sun.nio.ch.bugLevel" "read")
access: access allowed ("java.util.PropertyPermission" "sun.nio.ch.bugLevel" "write")
access: access allowed ("java.util.PropertyPermission" "sun.nio.ch.maxUpdateArraySize" "read")
access: access allowed ("java.util.PropertyPermission" "sun.nio.fs.chdirAllowed" "read")
access: access allowed ("java.util.PropertyPermission" "sun.util.logging.disableCallerCheck" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.DetailedRewriteReasons" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.instrumentation.trace" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.lexer.xmlliterals" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.arrow.function" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.async.function" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.class.fields" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.class" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.computed.property.name" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.default.parameter" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.destructuring" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.for.await.of" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.for.of" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.generator.function" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.new.target" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.optional.catch.binding" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.profiling.print" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.profiling" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.rest.parameter" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.rest.spread.property" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.spread.argument" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.spread.array" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.js.parser.trailing.comma" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.BooleanLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DebugCounters" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DoubleLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DumpDebugCounters" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DumpShapesDOT" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DumpShapesIGV" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DumpShapesJSON" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.DumpShapesPath" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.InObjectFields" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.IntegerLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.LongLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.PrimitiveLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.Profile" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.ProfileTopResults" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.TraceReshape" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.TriePropertyMap" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.object.TypedObjectLocations" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TraceRewritesFilterClass" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TraceRewritesFilterFromCost" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TraceRewritesFilterToCost" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TraceRewrites" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TruffleRuntime" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.TrustAllTruffleRuntimeProviders" "read")
access: access allowed ("java.util.PropertyPermission" "truffle.unsafe" "read")
access: access allowed ("java.util.PropertyPermission" "user.country.format" "read")
access: access allowed ("java.util.PropertyPermission" "user.dir" "read")
access: access allowed ("java.util.PropertyPermission" "user.home" "read")
access: access allowed ("java.util.PropertyPermission" "user.language.format" "read")
access: access allowed ("java.util.PropertyPermission" "user.name" "read")
access: access allowed ("java.util.PropertyPermission" "user.script.format" "read")
access: access allowed ("java.util.PropertyPermission" "user.variant.format" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.cacheDirBase" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.cwd" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableContextTimings" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableDnsResolver" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableFileCaching" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableFileCPResolving" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableH2c" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableTCCL" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.disableWebsockets" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.flashPolicyHandler" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.logger-delegate-factory-class-name" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.nettyIORatio" "read")
access: access allowed ("java.util.PropertyPermission" "vertx.threadChecks" "read")

This means we can have much fine grained security than deno with all or nothing for IO/Net.

pmlopes avatar May 18 '20 12:05 pmlopes

A full control can be achieved with a strong policy:

grant codeBase "file:node_modules/.lib/*" {
    permission java.io.FilePermission "<<ALL FILES>>", "read";
    permission java.io.FilePermission "/tmp/-", "read,write,delete";
    permission java.lang.reflect.ReflectPermission "newProxyInPackage.io.netty.channel";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission java.lang.RuntimePermission "*";
    permission java.net.NetPermission "getNetworkInformation";
    permission java.security.SecurityPermission "*";
    permission java.util.logging.LoggingPermission "control";
    permission java.util.PropertyPermission "*", "read,write";
    permission java.net.SocketPermission "*", "accept,connect,listen,resolve";
};

With this, all is open, so you can now start adding blocks

pmlopes avatar May 18 '20 14:05 pmlopes

@luboslives this commit introduces a small extra command security-manager that creates a secure security.policy file in your project.

https://github.com/reactiverse/es4x/commit/c9e64d4c55a497ab67be1fff9038982428900915

If the file is present, launching the application, the launchers, will then run the VM in secure mode by default.

This will give you a similar experience to deno but in reverse, by default it's open, only if you have the policy it's safe. I think we can start testing this in a new build

pmlopes avatar May 20 '20 15:05 pmlopes

I've published a new build with this feature in, see the tweet:

https://twitter.com/es4x_ftw/status/1263811612726738944?s=20

The missing feature from deno is the download of remote modules. There are a couple of issues here. First we need it to be secure (which is tricky as users want to download files from the internet) the second is that current vertx modules on npm are hybrid. They are a bit if js on npm and a jar file on maven central.

By using downloadable modules there's no way to bind any js module to a jar module. This is fine if the requires jars are already available or someone thinks of a way to do this.

We can easily achieve this by declaring the jars locally in the mvnDependencies array and then just refer to the online modules

pmlopes avatar May 22 '20 12:05 pmlopes

deno is not usefull for this project it is already partial supported by the way by this project as deno uses internal only parcel bundler to run the projects and then throws that into v8

so if some one would get parcel bundler running on es4x you can in general run deno apps there is not much shiming needed as deno has no real standard lib it is up to the user to supply http and other modules. so vertx is a good fit once it runs well.

frank-dspeed avatar Sep 22 '20 08:09 frank-dspeed

I was just thinking about this, I can now download esm modules from the web, say for example, that we use unpkg.io, when fetching a mod.js (a similar name like deno), we could have an agreement that this specific file could have a special comment just like vscode, for example:

/// @maven(io.vertx:vertx-web:3.9.3)

With this line (and just on a new download of course), the maven bits could be resolved too and the application restarts automatically (because the java dependencies have changed).

With this in mind, a user could (if so wish) use es4x without npm at all.

pmlopes avatar Sep 23 '20 12:09 pmlopes

@pmlopes we should simply put that into userland

class es4x{
  static void mavenInstall()
  static void npmInstall()
}

and npm install can already install from remote. then we could expand on that with installIfMissing

but again i say we should expose that as simple call able additional function

this way a es4x module can install it self what it needs it could also already do that via a postinstall hook inside the package.json.

frank-dspeed avatar Oct 01 '20 16:10 frank-dspeed