Adding a Programming Language Using NixOS

Question:
So I am trying to add the programming language Whitespace as a template and I am using NixOS to do so. I can’t seem to get it working.

Repl link:
https://replit.com/@SalladShooter/Whitespace

.replit

run = ["whitespace", "main.ws"]

entrypoint = "main.ws"

[nix]
channel = "stable-22_11"

[deployment]
run = ["whitespace", "main.ws"]

[languages]

[languages.whitespace]
pattern = "**/{*.ws,*.whitespace}"

[languages.whitespace.languageServer]
start = "whitespace-language-server start"
deploymentTarget = "cloudrun" 

replit.nix

{ pkgs }: {
  deps = [
    pkgs.bashInteractive
    pkgs.nodePackages.bash-language-server
    pkgs.man
  ];
  environment.systemPackages = [
    pkgs.haskellPackages.whitespace
  ];
} 

main.ws

S S S T	S S T	S S S L:Push_+1001000=72='H'_onto_the_stack
T	L
S S :Output_'H';_S S S T	T	S S T	S T	L:Push_+1100101=101='e'_onto_the_stack
T	L
S S :Output_'e';_S S S T	T	S T	T	S S L:+1101100=108='l'
T	L
S S S S S T	T	S T	T	S S L:+1101100=108='l'
T	L
S S S S S T	T	S T	T	T	T	L:+1101111=111='o'
T	L
S S S S S T	S T	T	S S L:+101100=44=','
T	L
S S S S S T	S S S S S L:+100000=32=Space
T	L
S S S S S T	T	T	S T	T	T	L:+1110111=119='w'
T	L
S S S S S T	T	S T	T	T	T	L:+1101111=111='o'
T	L
S S S S S T	T	T	S S T	S L:+1110010=114='r'
T	L
S S S S S T	T	S T	T	S S L:+1101100=108='l'
T	L
S S S S S T	T	S S T	S S L=+1100100=100='d'
T	L
S S S S S T	S S S S T	L:+100001=33='!'
T	L
S S :Output_'!';_L
L
L:End_the_program

I would try replacing run = ["whitespace", "main.ws"] in .replit with run = "whatever_command main.ws. I cannot however find the command to run a whitespace file anywhere on the internet. Given that the official site for this language is the Internet Archive, I’m thinking it’s dead and it may not work anymore. I tried running whitespace main.ws in Shell but the command whitespace was not found.

3 Likes

@anon40284853 do you have any ideas of some random language I could add using NixOS that works, that isn’t apart of Replit?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.