Code Monkey home page Code Monkey logo

riju's Introduction

Riju

Riju is a very fast online playground for every programming language. In less than a second, you can start playing with a Python interpreter or compiling INTERCAL code.

Check it out at https://riju.codes! Please note that Riju is only available on IPv6-enabled networks due to the higher financial cost of supporting legacy protocols. If your network does not support IPv6 then please consider asking your network administrator or service provider to do their part in supporting modern internet standards. You can consider accessing Riju through a VPN as a workaround.

Service uptime available at https://radian.statuspage.io/.

Is it free?

Riju will always be free for everyone. I pay for the hosting costs out of the business account of Radian LLC, which is funded by donations and my personal savings. If you would like to help keep Riju online and see more projects like it, there are a few donation methods available in the "Sponsor this project" sidebar on GitHub.

All financial records for Radian LLC are made publicly available.

Is it safe?

Riju does not collect your personal information.

  • Your code is deleted from the server as soon as you close Riju.
  • Your terminal input and output is never saved or logged anywhere.
  • Riju uses Fathom Analytics to measure traffic. Fathom collects very limited data and does not sell it to third parties, unlike Google Analytics.
  • Riju does not serve advertisements or share data with any third party aside from Fathom Analytics.

All of the above notwithstanding, any service that allows people to run code online is inherently risky. For this reason, I can't make any guarantees about the security or privacy of your data.

See also Reporting a security issue.

Are there rules?

Yes, there is one rule and it is "please be nice". Examples of not being nice include:

  • Trying to consume as many resources as possible. All this will do is prevent others from using Riju, which isn't nice.
  • Mining cryptocurrency. Since hosting Riju comes out of my paycheck community donations, this is exactly equivalent to stealing, which isn't nice.

Can I help? / Documentation

Absolutely, please see Contributing guide.

Similar projects

Acknowledgements

  • A big thank you to Mike Diarmid of Invertase for being an early sponsor of the project and helping out with hosting costs! Thanks to Mike's generous support I have the runway to get Riju stable enough for everyone to use.
  • Thank you to the maintainers of Monaco, node-pty, and Xterm.js! Without any one of these open-source libraries, version 1.0 of Riju could not have come to life!

riju's People

Contributors

crhallberg avatar dependabot[bot] avatar fbricon avatar jasonsteving99 avatar phuchptty avatar plondon avatar raxod502 avatar shaunakg avatar theredstoneradiant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

riju's Issues

Scala: prevent program output from trampling on REPL prompt

Currently, this is what it looks like if you run the example Scala program and then type something into the REPL:

Welcome to Scala 2.11.12 (OpenJDK 64-Bit Server VM, Java 11.0.8).
Type in expressions for evaluation. Or try :help.

scala> Hello, world!
1 + 1
res1: Int = 2

scala> 

Notice that the REPL prompt appears before the program has finished execution, and therefore the console output looks wrong. This should be fixed, if possible.

LSP support meta-issue

This issue tracks languages which could use LSP support.

Language Language server Blocker Branch
Ada Ada Language Server Fails to compile (see below)
crystal Scry Server hangs due to error (see below) wip/crystal-lsp
crystal Scry (with hotfix) Server returns error (see below) wip/crystal-lsp-hotfix
csharp OmniSharp Server returns no completions wip/csharp-lsp
fsharp FsAutoComplete Server returns error (see below) wip/fsharp-lsp
groovy Groovy Language Server Server returns no completions wip/groovy-lsp
javascript TypeScript Language Server Need to disable native Monaco completions
kotlin Kotlin Language Server Server returns various errors (see below) wip/kotlin-lsp
nim Nim Language Server Installation fails (see below) wip/nim-lsp
pascal Pascal Language Server Fails to compile (see below) wip/pascal-lsp
perl Perl-LanguageServer Server hangs due to error (see below) wip/perl-lsp
r languageserver Server emits malformed output wip/r-lsp
scala Metals Doesn't work with Scala scripts (see below) wip/scala-lsp
typescript TypeScript Language Server Need to disable native Monaco completions

Ada

/usr/bin/ld: /src/build/lang/ada/src/ada_language_server/libadalang_21.0.0_955d2554/alire/cache/dependencies/gnatcoll_21.0.0_6c0439a3/obj/gnatcoll/relocatable/gnatcoll_support.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC

Crystal

can't find file 'prelude'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

See crystal-lang-tools/scry#173.

{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": -32001,
    "message": "Couldn't parse (LSP::Protocol::NotificationMessage | LSP::Protocol::RequestMessage) from {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"textDocument/completion\",\"params\":{\"textDocument\":{\"uri\":\"file:///tmp/riju/05eb4d59-c495-4877-bc33-79e8e4d8f7f6/main.cr\"},\"position\":{\"line\":1,\"character\":1},\"context\":{\"triggerKind\":1}}} at 1:1",
    "data": [
      "../../../usr/share/crystal/src/json/from_json.cr:291:3 in 'start'",
      "../../scry/src/scry.cr:40:1 in '__crystal_main'",
      "../../../usr/share/crystal/src/crystal/main.cr:105:5 in 'main'",
      "__libc_start_main",
      "_start",
      "???"
    ]
  }
}

F#

/tmp/riju/3240f700-2ff7-48c0-ab3c-ecb593f0e251/main.fsx (1,1)-(1,1) parse error Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
  Code: -32603

Kotlin

No script runtime was found in the classpath: class
'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found.
Please add kotlin-script-runtime.jar to the module
dependencies. kotlin(MISSING_SCRIPT_STANDARD_TEMPLATE)
Internal error.
  Code: -32603
java.util.concurrent.CompletionException: java.lang.RuntimeException: Reached end of file before reaching char 1
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Reached end of file before reaching char 1
	at org.javacs.kt.position.PositionKt.offset(Position.kt:54)
	at org.javacs.kt.KotlinTextDocumentService.recover(KotlinTextDocumentService.kt:77)
	at org.javacs.kt.KotlinTextDocumentService.access$recover(KotlinTextDocumentService.kt:36)
	at org.javacs.kt.KotlinTextDocumentService$completion$1.invoke(KotlinTextDocumentService.kt:158)
	at org.javacs.kt.KotlinTextDocumentService$completion$1.invoke(KotlinTextDocumentService.kt:36)
	at org.javacs.kt.util.AsyncExecutorKt$sam$java_util_function_Supplier$0.get(AsyncExecutor.kt)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 3 more

Nim

     Error: Build failed for package: nimlsp
        ... Details:
        ... Execution failed with exit code 1
        ... Command: "/usr/bin/nim" c --noNimblePath -d:NimblePkgVersion=0.2.4 -d:release --path:"/root/.nimble/pkgs/ast_pattern_matching-1.0.0"  --path:"/root/.nimble/pkgs/jsonschema-0.2.1"  --path:"/root/.nimble/pkgs/ast_pattern_matching-1.0.0"  -o:"/tmp/nimble_36088/githubcom_PMunchnimlsp_#head/nimlsp" "/tmp/nimble_36088/githubcom_PMunchnimlsp_#head/src/nimlsp.nim"
        ... Output: Hint: used config file '/etc/nim/nim.cfg' [Conf]
        ... /tmp/nimble_36088/githubcom_PMunchnimlsp_#head/src/nimlsppkg/utfmapping.nim(1, 8) Warning: imported and not used: 'tables' [UnusedImport]
        ... /tmp/nimble_36088/githubcom_PMunchnimlsp_#head/src/nimlsppkg/suggestlib.nim(11, 8) template/generic instantiation of `mImport` from here
        ... /opt/nim/nimsuggest/nimsuggest.nim(19, 17) Error: cannot open file: compiler/options

Pascal

Free Pascal Compiler version 3.0.4+dfsg-23 [2019/11/25] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling pasls.lpr
(3104) Compiling lsp.pas
(3104) Compiling basic.pas
/tmp/pascal-language-server/lsp.pas(219,29) Error: (4001) Incompatible types: got "<class method type of procedure(TObject;TObject;PPropInfo;TJSONObject;UTF8String;var TObject) of object;Register>" expected "<procedure variable type of procedure(TObject;TObject;PPropInfo;TJSONObject;UTF8String;var TObject);Register>"
/tmp/pascal-language-server/lsp.pas(239,12) Error: (5000) Identifier not found "specialize"
/tmp/pascal-language-server/lsp.pas(239,23) Fatal: (2003) Syntax error, ";" expected but "identifier TLSPSTREAMING" found
Fatal: (1018) Compilation aborted

Perl

LS: apply_all_roles (Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x564877f99460), Perl::LanguageServer::Methods::textDocument, Perl/LanguageServer/Methods/textDocument.pm)
LS: apply_all_roles (Moose::Meta::Class::__ANON__::SERIAL::2=HASH(0x564877f99460), Perl::LanguageServer::Methods::workspace, Perl/LanguageServer/Methods/workspace.pm)
LS: ERROR: encountered object 'Coro=HASH(0x5648780701e0)', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /usr/local/share/perl/5.30.0/Perl/LanguageServer.pm line 260.

background_parser folders = {
  "file:///tmp/riju/b85393ce-8216-4d4b-a8fe-949d29d5b0c0" => "/tmp/riju/b85393ce-8216-4d4b-a8fe-949d29d5b0c0",
}
state_dir = /tmp/riju/b85393ce-8216-4d4b-a8fe-949d29d5b0c0/.vscode/perl-lang
initial parsing done, loaded  files, parsed 1 files, 1 files

Scala

expected class or object definition

Prevent conflicts between different services

Currently, running multiple Riju-related processes inside the container can cause interference. For example, if you have yarn dev running, then modifying the server source code will result in any active yarn sandbox sessions being killed. We could work around this problem by making the setup script less aggressive, or implement some kind of shared governance over the /tmp/riju directory. We could also avoid processes getting killed unnecessarily by subdividing the available UID space into blocks of 1000 and using a different block for each service, or something like that.

Containerize runtime environment

CI currently takes about 5 hours even when only one language has been modified. To solve this problem, I propose the following steps:

  • For each language, build and publish a separate Docker image.
  • Run each user session inside a separate Docker container based on the relevant per-language image.
  • Migrate per-language APT repositories to per-language images rather than the base runtime image.
  • Completely rewrite dependency calculator plan-publish.js.
  • Completely rewrite production deployment infrastructure to incrementally update all per-language images during a deployment and cut over traffic using an internal load balancer.

Add more LSP tests

Currently, we skip most of the LSP tests. This should be disabled and instead we should properly test LSP for as many languages as is feasible.

Update console size on backend

Currently, the tty size is hardcoded to 80x24, which looks bad for Emacs and Vim among other languages. This should be fixed. We will need to capture window resize events on the frontend (perhaps xterm.js provides a way to translate these into width/height tuples) and then feed them to the pty on the Node.js side.

ReasonML: rtop REPL

imported comment by @kwshi

Riju currently says ReasonML has no REPL. That's not fully true--technically, ReasonML does have a REPL named rtop. What is true is that BuckleScript, the OCaml-to-JS transpiler that is most often used in conjunction with ReasonML, doesn't provide an interactive/REPL interface, so ReasonML/OCaml in the JS runtime has no REPL (see #48 for a more thorough discussion of the various runtimes for ReasonML/OCaml). So rtop only runs via the native runtime and does not provide any access to the JS bindings provided by Bucklescript.

Here are three options to setting it up (there may be more):

  • Via OCaml's official package manager opam. OPAM needs to be first initialized with opam init before anything is installed, as you're probably aware; after that, running opam install rtop will install the rtop executable to <opam_switch>/bin/rtop (where <opam_switch> is most commonly ~/.opam/default).
  • Via NPM, the reason-cli npm package.
  • Via Esy, which, as far as I can tell, is geared towards the native ReasonML runtime and therefore comparable to OPAM but provides a more npm-esque tooling interface and adds access to NPM-hosted OCaml native packages. It itself needs to be first installed via npm install -g esy; then, rtop can be installed via either esy add reason-cli (alias to NPM package) or esy add @opam/rtop (alias to OPAM package). I'm not sure whether using Esy adds much value to the Riju use case, but I'm putting this approach here as reference anyway.

Delete src, pkg dirs before running tests in CI

I've discovered a pretty bad safety failure for the build system. Some languages, when built, store hardcoded paths to the ${src} or ${pkg} directories. This should cause the build to fail. However, since we don't clear out the build artifacts in between building the language and testing it, these cases can slip by until the composite image is built. We should address this issue.

JSF***: add repl support

Currently we only have noninteractive mode for JSF***. We could add a wrapper repl script pretty easily, like for languages like Befunge.

Test coverage meta-issue

This issue tracks languages which have broken tests that are currently skipped by CI.

  • lsp
    • c
    • c++
    • clojure
    • dart
    • elixir
    • elm
    • erlang
    • fortran
    • go
    • haskell
    • java
    • julia
    • lua
    • mariadb
    • mysql
    • objectivec
    • ocaml
    • php
    • postgresql
    • powershell
    • reasonml
    • ruby
    • rust
    • sqlite
    • swift
    • tex
    • vim
  • repl/runrepl/scope
    • powershell
    • ruby
  • scope
    • a+

Most of the LSP tests have simply not been attempted yet, although a few have encountered blockers whereby the language server fails to return any completions in the test environment even though it works interactively. The repl/runrepl/scope tests generally fail due to some unexpected interaction between the language REPL and the pty interface which causes the REPL to ignore all input sent to it by the test framework.

For the A+ scope test, see #40.

Add ability to install packages

I would like to add integration with language-specific package managers to the greatest extent possible. Riju already has a proposed interface for package manager configuration:

pkg?: {
  install: string;
  uninstall?: string;
  all?: string;
  search?: string;
};

Here is the sample code for Python:

pkg: {
  install: "pip3 install --user NAME",
  uninstall: "pip3 uninstall NAME",
  search: `python3 -c 'import json; from xmlrpc import client; print(json.dumps(client.ServerProxy("https://pypi.org/pypi").search({"name": "NAME"})))' | jq -r 'map(.name) | .[]'`,
},

We can add new websocket messages to control package management, and expose the package manager as a service similar to lsp and formatter. The frontend will need to gain several new user interface elements. I envision a new button similar to the "Prettify" button that will open a modal with package management controls. We will provide an input field for the package to install, with asynchronous autocompletion candidates. There should also be an embedded terminal in the modal so that output from the package manager can be seen by the user.

See also UPM, another attempt to put language-specific package managers behind a common interface. None of that work can be reused, however, because Riju has significantly different requirements from the common interface than Repl.it.

Add ability to share programs

It would be nice if it were possible to click a button and get a link that would show someone else the same code that you had written. Two options:

  • server-side persistent database with link shortening functionality hooked up to it
  • fully client-side where the program text is base64 encoded or similar

Move Docker builds to CircleCI

Currently we run CI via CircleCI but not on CircleCI. The actual build runs on a bespoke DigitalOcean instance that I configured for Riju, in fact the same instance that runs the production server. This is problematic because if the webserver uses too much memory then it causes CI builds to fail. This is the kind of thing that should be ruled out by the design of the system.

Originally I'd wanted to build and run on the same instance in order to save on network transmission time for the very large Docker image. But now that build times are creeping up towards two hours I think that part of the process is not a very large fraction. Let's offload to CircleCI for free compute. This will also allow us to build pull requests and other branches.

Unlambda: display evaluation results

Currently, the Unlambda REPL just lets you run an entire program, which must explicitly produce output in order for you to see a result. We should surface the SKI-formatted evaluation result as well, since this will improve developer experience for Unlambda.

Notify user when process terminates

Currently, if the repl or run process terminates unexpectedly, there is no user interface indication that this has happened, other than a debugging message sent over the websocket. We should surface this information, most likely by printing to the console directly on the frontend.

Go: Monaco should use tabs

Currently, Monaco is configured to use spaces for indentation in all languages. This should be adjusted so that Go (and perhaps other similar languages) uses tabs.

Show compilation errors during development

Currently, if there is a compilation error in any of the application code of Riju, the only indication when using yarn dev is that the code stops being updated. This is often difficult to notice. Instead, the server should serve an error page, making it impossible to ignore compilation errors. The solution should cover errors in tsc, webpack, and clang.

Some sessions are apparently not cleaned up

When I access the production instance of Riju and inspect the process table, it seems that some sessions are not cleaned up properly and bloat the memory usage, causing CI to fail. We need to identify under what circumstances this happens and close the gap.

Finish documenting JSON Schema

Syntax highlighting for more languages

Currently, we have syntax highlighting only for the languages listed in monaco-languages. However, this is a small subset of the total number of languages that are supported. We should investigate whether third-party syntax highlighters exist for less popular languages, and integrate them into Riju if so.

Make better use of Docker cache during CI

Currently, if a build fails then all intermediate layers are thrown away before the next job starts. We can't keep around intermediate layers for very long due to disk space constraints, but ideally we could tag the last successfully built layer. This would yield a maximum disk usage of about 22 GB × 3 = 66 GB, for the last successful build, the last failed build, and the current build. Perhaps the Docker command-line interface provides a way to retrieve the most recently created image, and we can tag that on a failed build. (And remove the tag on a successful build.)

Maintain undo history on reconnect

Currently, the undo history of Monaco is lost whenever the client reconnects to the server. This is unlikely to happen often, but it's still a bug. See microsoft/monaco-editor#926; the issue occurs because we must update the "model URI" when the backend working directory is changed, which occurs on a reconnect event.

Objective-C: spurious warning from LSP

For Objective-C, LSP reports the following diagnostic on the first line of the file, even though compilation succeeds and autocompletions appear to be available:

In included file: 'objc/objc.h' file not found

This should be fixed.

Automatically cancel prior jobs on CI

Currently, if two jobs start on CI around the same time, it's nondeterministic which one will "win". In fact, it's entirely possible for the earlier job to cause the later one to get canceled, which has happened before. Instead, as soon as a deploy starts it should cancel any previous ones. This can probably be handled straightforwardly with a kill command added to deploy-phase2.py.

Restrict access to process table

We should use cgroup features to prevent one user from seeing the processes run by other users. Unfortunately, it's not possible to use the hidepid kernel option for this, as it requires --privileged mode to work under Docker. Nevertheless it should be possible to replicate the feature manually.

Document debugging techniques

I have a number of useful tips for how to test changes to this project easily, which will improve the contribution process. If you would like to contribute, let me know and I will prioritize writing this documentation.

Package third-party software as .debs

The linear and lengthy nature of Riju's Docker build is a significant pain point currently. One way that we could ameliorate the problem is by sharding the installation in order to create a separate .deb for each language, which would declare the necessary Ubuntu dependencies and then directly package any other files, perhaps built from source. These .debs could be built and published independently, which would make it easy and foolproof to build the Riju image (and to shard Riju's languages amongst multiple images).

Language support meta-issue

This issue tracks new languages which could be added to Riju. If your favorite language isn't supported, add a comment below and (provided it meets the criteria for inclusion) I'll put it in the list 📈

You can also feel free to file a separate issue, which is handy in case there is discussion about how to get the language working on Riju. I'll add the language to this list nonetheless.

Proposed

Blocked

Language Blocker Branch
AutoIt Runtime errors (see below) wip/autoit
Cobra Installation fails (see below) wip/cobra
Couchbase Does not support UNIX sockets wip/couchbase
Koka Excessive memory usage (see below) wip/koka
Maxima Does not support Docker (see below) wip/maxima
Mustache Runtime errors (see below) wip/mustache
Nemerle Compiler crashes (see below) wip/nemerle
Neo4j Does not support UNIX sockets wip/neo4j
Nix Does not support Docker (see below) wip/nix
POP-11 Installation fails (see below) wip/pop11
Q Does not support custom HOME (see below) wip/q

Rejected

Language Rejected because...
ABAP No free implementation
BrightScript No free implementation
Lingo No free implementation
Linotte Requires graphical environment
Logo Requires graphical environment
Processing Requires graphical environment
Svelte Requires browser environment

I've already added everything appropriate from the Quine Relay language list.

Diagnostics on blocked languages

AutoIt

wine client error:240: partial write 12288

This is when running ConsoleWrite("Hello, world" & @CRLF) with wine install/AutoIt3.exe with the ZIP from the official site.

Cobra

BackEndJvm/JvmType.cobra(109): error: The left expression ('`') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmType.cobra(244): error: The left expression (r'[') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmJarSig.cobra(239): error: The left expression ('`') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmJarSig.cobra(713): error: The left expression ('.') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmJarSig.cobra(771): error: The left expression ('.') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmJarSig.cobra(809): error: The left expression ('`') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JvmJarSig.cobra(834): error: The left expression ('Object') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JavaCompilationMessage.cobra(14): error: The left expression ('.java:') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JavaCompilationMessage.cobra(9): error: The left expression ('hello.cobra') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
BackEndJvm/JavaCompilationMessage.cobra(10): error: The left expression ('package Foo does not exist') cannot be "in" the right-hand expression because the left type is "String" and the right-hand expression contains type "char".
Compilation failed - 79 errors, 1 warning

Koka

See koka-lang/koka#34.

Maxima

See https://sourceforge.net/p/maxima/mailman/maxima-discuss/thread/CALHpz2Hu8Os_kdngazXy6w37F7S7Z42RgVD5xTtAfv0Ndfdu8Q%40mail.gmail.com/.

Mustache

See mustache/mustache#262.

Nemerle

* Assertion at sre-encode.c:290, condition `count > 0' not met

See mono/mono#18970.

Nix

error: the build users group 'nixbld' has no members

See NixOS/nix#697. Why this is so difficult for the Nix folks to straighten out I cannot quite fathom.

POP-11

WARNING: Couldn't re-execute Poplog with the proper personality flags (maybe /proc isn't mounted?). Trying to continue anyway.

<<<<<<< Access Violation: PC = 0000000001C11060, Addr = 0000000001C11060,
        Code = 2 >>>>>>>


;;; MISHAP - serr: MEMORY ACCESS VIOLATION (attempt to alter non-writeable
;;;     system structure?)
;;; PRINT DOING
;;; DOING    :  null nextitem pop_setpop_compiler

Q

'/home/riju2000/q/q.k. OS reports: No such file or directory
0::

Unfortunately, HOME, USER, USERNAME, and LOGNAME all seem to be totally ignored. That said, Q appears to be rather distastefully proprietary anyway, so perhaps it's for the best that it doesn't work.

Cmd: race conditions and missing cleanup

Currently, we don't do a great job with Wine. There are various race conditions and missing cleanup actions relating to wineserver and winedevice.exe. These should be fixed.

A+: special characters seemingly not supported

I get an error when I try to use any non-ASCII character in A+:

     A+
     Copyright (c) 1990-2008 Morgan Stanley.  All rights reserved.
     This version is Release 4.22
     123 × 234
[token]:  undefined

A consequence of this is that I have not been able to implement the scope test for A+ since this requires variable assignment, which is done with a non-ASCII character.

I suspect, based on the appearance of the official A+ documentation online, that this is a character encoding problem:

image

Then again, I don't have the recommended "Netscape Navigator 4.0 or equivalent"...

PureScript: spurious recompilation

We intentionally copy cached files out of a system directory for PureScript to avoid recompilation on dependencies when running the sample program. However, this appears to be broken, so that dependencies are recompiled the first time the REPL is run as well as the first time the sample program is run.

Show timing information when running tests

Currently, it's difficult to tell exactly what has happened in a test run because it's unclear when each message was produced. We should timestamp each line with the duration since the beginning of the test.

Gracefully handle errors during setup

Currently, if an error occurs during the setup command of a language, the session is closed and re-opened repeatedly with no information communicated to the user. This situation should be improved so that an error is surfaced and the session is not automatically reopened.

Clean up /tmp

Whenever new languages are added, cruft tends to accumulate in /tmp. We should take care of it:

drwxr-xr-x 3 root   root        4096 Aug 23 18:11 .rdmd-0
-rw-r--r-- 1 root   root     1147295 Feb  4  2018 boo-latest.zip
-rwxr-xr-x 1 root   root     2005877 Aug 23 18:12 camlobj27deaa.cds
drwxrwxr-x 2 docker docker      4096 Aug 23 18:05 mariadb-10.5.5-linux-x86_64
-rw-r--r-- 1 root   root   341278328 Aug  7 20:29 mariadb.tar.gz
drwx------ 2 root   root        4096 Aug 23 18:19 node-purescript-h0OMxe
drwxr-xr-x 3 root   root        4096 Aug 23 18:11 npm-458-71e8e882
drwxr-xr-x 2 root   root        4096 Aug 23 18:06 rls-linux
-rw-r--r-- 1 root   root      844210 Jul  9  2009 setlbin.tgz
drwx------ 2 mysql  mysql       4096 Aug 23 17:58 tmp.65cgd4eOUl
drwx------ 2 docker docker      4096 Aug 23 19:38 tmux-1000
drwxr-xr-x 3 root   root        4096 Aug 23 18:38 v8-compile-cache-0
drwxr-xr-x 1 docker docker      4096 Aug 23 18:39 v8-compile-cache-1000
drwx------ 3    999 users       4096 Aug 23 18:35 wine-HxEHVm
drwxr-xr-x 2 root   root        4096 Aug 23 18:38 yarn--1598207933068-0.6390044982785936
drwxr-xr-x 2 docker docker      4096 Aug 23 18:39 yarn--1598207979808-0.171870432589313
drwxr-xr-x 2 docker docker      4096 Aug 23 18:40 yarn--1598208016459-0.6098553198422587
drwxr-xr-x 2 docker docker      4096 Aug 23 18:42 yarn--1598208146044-0.3585365954441231
drwxr-xr-x 2 docker docker      4096 Aug 23 18:42 yarn--1598208159077-0.0838287424559121
drwxr-xr-x 2 docker docker      4096 Aug 23 19:39 yarn--1598211545322-0.44991550652070766

Provide full instructions and automation for self-hosting Riju

Historically, Riju has been deployed on a custom-provisioned DigitalOcean instance. We should be able to automate most of the provisioning process via Packer, and provide instructions to fill in the rest of the gaps. It should not require any insider knowledge to fully deploy your own instance of Riju on DigitalOcean.

I've started setting this up, but it's not fully working and tested yet.

Flaky tests meta-issue

The following languages have tests that have failed for me but have succeeded on being re-run, without any code changes:

  • cmd
  • qsharp
  • red

Add language metadata and sort/filter options

I would like to add additional metadata to each language which can be used to make languages of interest more discoverable. Here are some sample pieces of metadata:

  • Description
  • Year created
  • Maintenance status
  • Categories (compiled, interpreted, markup, lisp, c-like, jvm, assembly, esoteric, general-purpose, etc.)
  • Web links
    • Homepage
    • Documentation
    • Source code
    • Getting started / tutorial
    • Rosetta Code / Esolangs entry
  • Support for LSP, code formatting, package management

Once metadata has been added, the home page should allow users to filter and sort by any of these fields.

ReasonML: run natively, not just via BuckleScript

imported comment by @kwshi

Summary

ReasonML's core language is essentially identical to OCaml, just with a different syntactic presentation. Riju currently runs ReasonML via bs-platform (BuckleScript), which is a OCaml-subset-to-Javascript transpiler, supplemented with a collection of JS-standard-library bindings (e.g. Js.log -> console.log).

Doing so restricts support for OCaml's own built-in primitives (e.g. Sys.readdir) and also makes the code run slower (since it is now running via JS, instead of native compiled code--though that's a relatively minor concern). I propose that Riju support running ReasonML natively, perhaps in addition to via BS. Doing so allows ReasonML to be powered by the latest-version OCaml runtime and gives full support for built-in primitives.

Background

At its core, ReasonML is just an alternative syntax for the OCaml language. The underlying type system, syntactic constructs, standard library, etc. are all identical; the only differences are keyword/punctuation choices. (This claim is not 100% true; recently added to ReasonML are a select few additions meant to make it resemble JS(X) even more. Nevertheless, it is still true that there is an almost perfect one-to-one correspondence between ReasonML code and OCaml code.) From the ReasonML website:

Note: Reason can be translated back and forth to OCaml using refmt. Anything possible in Reason is also possible with OCaml and vice versa.

In fact, the Try ReasonML tool demonstrates these one-to-one conversions between ReasonML and OCaml.

BuckleScript and friends

Despite its OCaml core, ReasonML's primary target audience is web-development folks who really like JS. As such, ReasonML is almost always advertised as a standalone language meant to be run via bs-platform (BuckleScript), which is an OCaml-to-JS compiler supplemented with bindings to the JS standard library. However, running OCaml/Reason via a JS transpiler reduces support for OCaml's own built-in primitives.

For instance, the Sys.readdir function (which lists children of a directory) is accessible via ReasonML but fails to run when transpiled via BS--giving a compile-time warning

Warning 106: BuckleScript warning: Unimplemented primitive used:caml_sys_read_directory

and run-time error

  /tmp/riju/02bd35ee-7ee0-46f1-84f0-9e65ea1fb112/node_modules/bs-platform/lib/js/caml_external_polyfill.js:16
    throw new Error(s + " not polyfilled by BuckleScript yet\n")
    ^

Error: caml_sys_read_directory not polyfilled by BuckleScript yet

Even though it is technically valid ReasonML. This behavior makes some sense, since JS makes a client-side/server-side distinction, and primitives such as filesystem access are only available on the server-side via NodeJS-provided libraries such as fs, os, path, etc. As such, Reason-BS users are advised to manually add external bindings to corresponding NodeJS libraries, or rely on community-provided NodeJS binding declarations, to get proper access to "server-side" primitives.

This restriction is not inherently wrong or undesirable, since ReasonML's most common use case is transpiling to JS and executing in a JS runtime. But considering that ReasonML is the same core language as OCaml, there are situations where one might prefer to run ReasonML in the native OCaml runtime instead (it is, after all, fully capable of doing so).

How to?

There are, to my knowledge, two ways to run ReasonML as native OCaml:

  1. Use refmt to convert ReasonML syntax to OCaml syntax, then just call ocaml on the produced source file.

  2. Use bsb-native, which, based on what I can tell, pretty much does the same thing as above.

    (Yes, the naming is really confusing to me too, in case you're wondering--it calls itself "bucklescript", even though "bucklescript", at least originally, referred to the OCaml-to-JS transpiler--to me, "bucklescript native" is a total oxymoron. I think the names are the way they are because people like to conceptualize ReasonML as a standalone language with a standalone compiler, rather than as a dialect of OCaml. Because, you know, all the hip kids dig JS, not a functional programming language most known for its ubiquity in French computer-science academia.)

My proposal is to add running natively as an option for ReasonML. Certainly, some people may still want to test BuckleScript's JS interop behavior or fiddle with Bucklescript's Belt/Js standard libraries, which are not available outside of BS. So I think it's probably best to have both options available, somehow.

Random considerations

  • The README says that Riju aspires "to support more languages than any reasonable person could conceivably think is reasonable." In the case of ReasonML/OCaml/Bucklescript/JS, many things could constitute a "language":

    • Runtime (native OCaml vs. NodeJS)
    • Syntax (ReasonML vs. OCaml)
    • Libraries (native OCaml vs. BS standard library + JS bindings)

    And in fact, not much stops us from mixing-and-matching these parts--e.g., I'm pretty sure nothing stops me from writing code in plain OCaml syntax, then transpiling it (via BS) to JS. I'd be writing OCaml code but running it in an archetypally ReasonML environment. At what point should something be considered a different language (and added in Riju as such), vs. a "dialect"? If it makes sense to support native ReasonML on Riju, does it also make sense to support the vice versa, JS-run OCaml? What about OCaml's bytecode-to-JS compiler js_of_ocaml (as opposed to BS, which operates on OCaml source code rather than precompiled bytecode)?

  • Similarly, what are your thoughts on Deno, the hip new runtime for TS/JS? It runs the same language as TS/JS, but conceivably has different runtime behavior. Should it be available as a separate language option, or selectable somehow in Riju? In one were to support Deno, should TS/JS even be considered separate languages, or just different configuration profiles on the same runtime?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.