}
.ui-theme {
- --terminal-background-color: #dddddd;
- --terminal-foreground-color: #000000;
+ --terminal-background-color: #303033;
+ --terminal-foreground-color: #ffffff;
--background-color: #f0f0f5;
--light-background-color: #e0e0e6;
font-size: 2rem;
}
+h3 {
+ font-size: 1.5rem;
+ margin-bottom: 8px;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+}
+
h1, h2, h3, h4, h5, h6 {
font-weight: 200;
}
background: var(--terminal-background-color);
color: var(--terminal-foreground-color);
border-radius: 4px;
+ padding: 2px;
}
}
main li {
- margin-top: 8px;
+ margin-top: 24px;
}
@media (min-width: 800px) {
-@media (prefers-color-scheme: light) {
+/* @media (prefers-color-scheme: light) {
/*
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
- */
.hljs {
background: white;
color: black;
.hljs-strong {
font-weight: bold;
}
-}
+} */
-@media (prefers-color-scheme: dark) {
/*
* Visual Studio 2015 dark style
* Author: Nicolas LLOBERA <nllobera@gmail.com>
*/
- .hljs {
- background: #1E1E1E;
- color: #DCDCDC;
- }
-
- .hljs-keyword,
- .hljs-literal,
- .hljs-symbol,
- .hljs-name {
- color: #569CD6;
- }
- .hljs-link {
- color: #569CD6;
- text-decoration: underline;
- }
+.hljs {
+ background: #1E1E1E;
+ color: #DCDCDC;
+}
- .hljs-built_in,
- .hljs-type {
- color: #4EC9B0;
- }
+.hljs-keyword,
+.hljs-literal,
+.hljs-symbol,
+.hljs-name {
+ color: #569CD6;
+}
+.hljs-link {
+ color: #569CD6;
+ text-decoration: underline;
+}
- .hljs-number,
- .hljs-class {
- color: #B8D7A3;
- }
+.hljs-built_in,
+.hljs-type {
+ color: #4EC9B0;
+}
- .hljs-string,
- .hljs-meta .hljs-string {
- color: #D69D85;
- }
+.hljs-number,
+.hljs-class {
+ color: #B8D7A3;
+}
- .hljs-regexp,
- .hljs-template-tag {
- color: #9A5334;
- }
+.hljs-string,
+.hljs-meta .hljs-string {
+ color: #D69D85;
+}
- .hljs-subst,
- .hljs-function,
- .hljs-title,
- .hljs-params,
- .hljs-formula {
- color: #DCDCDC;
- }
+.hljs-regexp,
+.hljs-template-tag {
+ color: #9A5334;
+}
- .hljs-comment,
- .hljs-quote {
- color: #57A64A;
- font-style: italic;
- }
+.hljs-subst,
+.hljs-function,
+.hljs-title,
+.hljs-params,
+.hljs-formula {
+ color: #DCDCDC;
+}
- .hljs-doctag {
- color: #608B4E;
- }
+.hljs-comment,
+.hljs-quote {
+ color: #57A64A;
+ font-style: italic;
+}
- .hljs-meta,
- .hljs-meta .hljs-keyword,
+.hljs-doctag {
+ color: #608B4E;
+}
- .hljs-tag {
- color: #9B9B9B;
- }
+.hljs-meta,
+.hljs-meta .hljs-keyword,
- .hljs-variable,
- .hljs-template-variable {
- color: #BD63C5;
- }
+.hljs-tag {
+ color: #9B9B9B;
+}
- .hljs-attr,
- .hljs-attribute {
- color: #9CDCFE;
- }
+.hljs-variable,
+.hljs-template-variable {
+ color: #BD63C5;
+}
- .hljs-section {
- color: gold;
- }
+.hljs-attr,
+.hljs-attribute {
+ color: #9CDCFE;
+}
- .hljs-emphasis {
- font-style: italic;
- }
+.hljs-section {
+ color: gold;
+}
- .hljs-strong {
- font-weight: bold;
- }
+.hljs-emphasis {
+ font-style: italic;
+}
- /*.hljs-code {
- font-family:'Monospace';
- }*/
+.hljs-strong {
+ font-weight: bold;
+}
- .hljs-bullet,
- .hljs-selector-tag,
- .hljs-selector-id,
- .hljs-selector-class,
- .hljs-selector-attr,
- .hljs-selector-pseudo {
- color: #D7BA7D;
- }
+/*.hljs-code {
+ font-family:'Monospace';
+}*/
+
+.hljs-bullet,
+.hljs-selector-tag,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #D7BA7D;
+}
- .hljs-addition {
- background-color: #144212;
- display: inline-block;
- width: 100%;
- }
+.hljs-addition {
+ background-color: #144212;
+ display: inline-block;
+ width: 100%;
+}
- .hljs-deletion {
- background-color: #600;
- display: inline-block;
- width: 100%;
- }
+.hljs-deletion {
+ background-color: #600;
+ display: inline-block;
+ width: 100%;
}
"break", "continue", "return", "defer", "fallthrough",
"cast", "sizeof", "alignof", "typeof"
],
- literal: "true false null null_proc null_str",
+ literal: "true false null null_proc null_str it",
type: "i8 u8 i16 u16 i32 u32 i64 u64 f32 f64 rawptr str cstr dyn_str i8x16 i16x8 i32x4 i64x2 f32x4 f64x2 v128 type_expr any",
built_in: "math map set array random iter list conv type_info",
},
hljs.registerLanguage(languageName, builtIns[key]);
}
+ (()=>{var e=(()=>{"use strict";return e=>{const s=e.regex,t={},n={begin:/\$\{/,
+end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{
+className:"variable",variants:[{
+begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={
+className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={
+begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,
+end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,
+contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(c);const o={begin:/\$?\(\(/,
+end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]
+},r=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10
+}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,
+contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{
+name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,
+keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],
+literal:["true","false"],
+built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]
+},contains:[r,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},c,{
+match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},t]}}})()
+;hljs.registerLanguage("bash",e)})();
+
+/*! `dos` grammar compiled for Highlight.js 11.9.0 */
+ (()=>{var e=(()=>{"use strict";return e=>{const r=e.COMMENT(/^\s*@?rem\b/,/$/,{
+ relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],
+ case_insensitive:!0,illegal:/\/\*/,keywords:{
+ keyword:["if","else","goto","for","in","do","call","exit","not","exist","errorlevel","defined","equ","neq","lss","leq","gtr","geq"],
+ built_in:["prn","nul","lpt3","lpt2","lpt1","con","com4","com3","com2","com1","aux","shift","cd","dir","echo","setlocal","endlocal","set","pause","copy","append","assoc","at","attrib","break","cacls","cd","chcp","chdir","chkdsk","chkntfs","cls","cmd","color","comp","compact","convert","date","dir","diskcomp","diskcopy","doskey","erase","fs","find","findstr","format","ftype","graftabl","help","keyb","label","md","mkdir","mode","more","move","path","pause","print","popd","pushd","promt","rd","recover","rem","rename","replace","restore","rmdir","shift","sort","start","subst","time","title","tree","type","ver","verify","vol","ping","net","ipconfig","taskkill","xcopy","ren","del"]
+ },contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{
+ className:"function",begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",
+ end:"goto:eof",contains:[e.inherit(e.TITLE_MODE,{
+ begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),r]},{
+ className:"number",begin:"\\b\\d+",relevance:0},r]}}})()
+ ;hljs.registerLanguage("dos",e)})();
+/*! `lua` grammar compiled for Highlight.js 11.9.0 */
+(()=>{var e=(()=>{"use strict";return e=>{const t="\\[=*\\[",a="\\]=*\\]",n={
+ begin:t,end:a,contains:["self"]
+ },o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[n],relevance:10
+ })];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,
+ literal:"true false nil",
+ keyword:"and break do else elseif end for goto if in local not or repeat return then until while",
+ built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"
+ },contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",
+ contains:[e.inherit(e.TITLE_MODE,{
+ begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",
+ begin:"\\(",endsWithParent:!0,contains:o}].concat(o)
+ },e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",
+ begin:t,end:a,contains:[n],relevance:5}])}}})();hljs.registerLanguage("lua",e)
+ })();
+ /*! `json` grammar compiled for Highlight.js 11.9.0 */
+(()=>{var e=(()=>{"use strict";return e=>{const a=["true","false","null"],n={
+ scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",keywords:{
+ literal:a},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,
+ relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0
+ },e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],
+ illegal:"\\S"}}})();hljs.registerLanguage("json",e)})();
+
return hljs;
})();
<h1>Installing Onyx</h1>
<p>
<a class="link-button" href="#online">Online</a>
- <a class="link-button" href="#linux">Linux</a>
+ <a class="link-button" href="#linux-macos">Linux</a>
+ <a class="link-button" href="#linux-macos">MacOS</a>
<a class="link-button" href="#windows">Windows</a>
- <a class="link-button" href="#macos">MacOS</a>
+ <a class="link-button" href="#source">From Source</a>
</p>
</div>
<div class="container light" id="online">
<h2>Try Online</h2>
+</div>
+<div class="container">
<p>
- Onyx is available to try online for free in <a href="/playground/">Onyx Playground</a>.
+ Onyx is available to try online for free in the Onyx Playground.
It allows you learn the syntax from examples, without installing the language onto your system.
</p>
+ <p>
+ <a class="link-button" href="/playground">Go to Playground</a>
+ </p>
</div>
-<div class="container" id="linux">
- <h2>Linux</h2>
- <div>
- <h3>From Source</h3>
- <p>
- The easiest way to install Onyx on a Linux system is to clone the repository from GitHub, and then compile from source.
- This is relatively simple, since Onyx does not use any fancy things in its source tree. Only C code and shell scripts.
-
- <ol>
- <li>
- Clone the respository at <a href="https://github.com/onyx-lang/onyx">onyx-lang/onyx</a>.
- <pre class="hljs"><code class="language-sh">git clone https://github.com/onyx-lang/onyx --depth 1</code></pre>
- </li>
- <li>
- Navigate into the new "onyx" directory.
- <pre class="hljs"><code class="language-sh">cd onyx</code></pre>
- </li>
- <li>
- Configure the <code>settings.sh</code> file to suit your system needs.
- If everything looks good, (or if you don't know what you are looking at), you should be good to go.
- </li>
- <li>
- Run <code>./build.sh</code>.
- This will compile and install Onyx onto your system.
- By default, the "onyx" binary will be placed in "/usr/bin", and the necessary libraries/core packages/tooling will be installed at "/usr/share/onyx".
- </li>
- <li>
- Try running the "onyx help" command. You should see something like this.
- <pre class="hljs"><code class="language-sh">$ onyx help
-Onyx toolchain version v0.1.0
-
-The toolchain for the Onyx programming language, created by Brendan Hansen.
-
-Usage:
- onyx <subcommand>
+<div class="container light" id="linux-macos">
+ <h2>Linux / MacOS</h2>
+</div>
+<div class="container">
+ <p>
+ The easiest way to install Onyx on a Linux or MacOS system is to use the installation script you can find at <a href="https://get.onyxlang.io">get.onyxlang.io</a>.
+ You can download and run the script in one bash command.
+ You will be asked to pick a WebAssembly runtime for your installation. See the <a href="#">compatibility and feature chart</a> to help you decide.
+ </p>
-Subcommands:
- help Shows this help message. Use "onyx help <subcommand>".
- build Compiles an Onyx program into an executable.
- run Compiles and runs an Onyx program, all at once.
- check Checks syntax and types of an Onyx program.
- watch Continuously rebuilds an Onyx program on file changes.
- package Package manager</code></pre>
- </li>
- </ol>
- </p>
+ <pre class="hljs"><code class="language-sh">sh <(curl https://get.onyxlang.io -sSfL)</code></pre>
- <h3>Future Plans</h3>
- <p>
- In the future, Onyx may ship a ".deb" file for Debian-based distros to easily install.
- While this is planned, it is not a priority at the moment.
- </p>
- </div>
</div>
<div class="container light" id="windows">
<h2>Windows</h2>
+</div>
+<div class="container">
<p>
<ol>
- <li>Download the latest Windows release folder from the <a>Releases</a> on GitHub.</li>
+ <li>Download the latest Windows release from the <a href="https://github.com/onyx-lang/onyx/releases/latest">Releases</a> on GitHub.</li>
<li>Extract the zip file to a permanent location.</li>
<li>Modify system environment variables.</li>
<ul>
- <li>Add the extracted folder to your system or user's PATH variable.</li>
- <li>Make a new variable called "ONYX_PATH", and set it equal to the extracted folder path.</li>
+ <li><p>Make a new variable called <code>ONYX_PATH</code>, and set it equal to the extracted folder path.</p></li>
+ <li><p>Add the extracted folder to your user's <code>PATH</code> variable.</p></li>
</ul>
- <li>Log out and log back in to let system environment variable update.</li>
- <li>Open a Command Prompt or Powershell instance, and try running "onyx help".</li>
+ <li>Log out and log back in to let system environment variables update.</li>
+ <li><p>Open a Command Prompt or Powershell instance, and try running <code>onyx</code>.</p></li>
</ol>
</p>
</div>
-<div class="container" id="macos">
- <h2>MacOS</h2>
+<div class="container light" id="source">
+ <h2>From Source</h2>
+</div>
+
+<div class="container">
<p>
- MacOS support is not being actively worked on at the moment. In theory, if the compiler would work on MacOS, WebAssembly binaries would have no problem running using Wasmer, Wasmtime, or a similar runtime. Onyx is always open for contributions from others on its <a href="https://github.com/onyx-lang/onyx/pulls">pull requests</a>.
+ Building Onyx from source is easy. If you want to use the Wasmer runtime, you will need to have Wasmer installed. See their <a href="https://docs.wasmer.io/install">installation instructions</a> for details.
</p>
+
+ <p>To build on Linux or MacOS, run the following commands.</p>
+ <pre class="hljs"><code class="language-sh"># Download Onyx.
+git clone https://github.com/onyx-lang/onyx --depth 1
+cd onyx
+# Load settings used for compilation. Change these settings if you would like.
+source settings.sh
+# Compile and install Onyx.
+./build.sh compile install</code></pre>
+
+ <p>To build on Windows, run the following commands.</p>
+ <pre class="hljs"><code class="language-dos">REM Ensure cl.exe is able to run in the current prompt.
+REM Download Onyx.
+git clone https://github.com/onyx-lang/onyx --depth 1
+cd onyx
+REM Run the build script. The Onyx executable will be in the current directory.
+build.bat</code></pre>
</div>
<p>The following sections will help set up an environment for you to program Onyx effectively.</p>
<p>
- <a class="link-button" href="#lsp">LSP</a>
- <a class="link-button" href="#vim">Vim / Neovim</a>
<a class="link-button" href="#vscode">VS Code</a>
+ <a class="link-button" href="#vim">Vim / Neovim</a>
<a class="link-button" href="#sublime-text">Sublime text</a>
<a class="link-button" href="#emacs">Emacs</a>
+ <a class="link-button" href="#lsp">Language Server</a>
</p>
<p style="opacity: 0.5; font-size: 0.75em">
</p>
</div>
-<div class="container light" id="lsp">
- <h2>Language Server</h2>
+
+<div class="container light" id="vscode">
+ <h2>Visual Studio Code</h2>
+</div>
+<div class="container">
<p>
- If you are unfamiliar, a <em>Language Server</em> abstracts the tooling and language specific functionality out of editors and into a reusable component.
- This way, it is easier to develop in-editor functionality across multiple editors, as the same work does not need to be replicated for each supported editor.
+ <a class="link-button" href="https://marketplace.visualstudio.com/items?itemName=onyxlang.onyxlang">VS Code Extension</a>
</p>
<p>
- At the time of writing, the language server for onyx (<code>onyx-lsp</code>), is only supported on Linux.
- This will be addressed soon.
+ Onyx has an official published extension on the Visual Studio Marketplace.
+ Search "Onyx Programming Language" in the extensions panel or install from the marketplace.
</p>
- <h3>Installing the Language Server</h3>
+ <p>Alternatively, you can follow these steps to install the extension from the VSIX file included in the Onyx distribution.</p>
<ol>
- <li>On Linux or Windows Subsystem for Linux, clone the <a href="https://github.com/onyx-lang/onyx-lsp">onyx-lsp</a> repository.</li>
- <li>Go into the <code>run_tree</code> folder.</li>
- <li>Run <code>chmod +x onyx-lsp install</code>, then <code>./install</code>.</li>
- <li>Test the installation by running <code>onyx-lsp</code>. If the command is found and running, you're good to go.</li>
+ <li>Hit "Control+Shift+P" on Windows/Linux, or "Command+Shift+P" on MacOS.</li>
+ <li>Search for and select "Extensions: Install from VSIX".</li>
+ <li><p>Go to your <code>ONYX_PATH</code> and select the <code>.vsix</code> file in the <code>misc</code> folder.</p></li>
+ <li>Restart VS Code.</li>
</ol>
+ <p>This extension does have support for the <code>onyx lsp</code>, assuming that is <a href="#lsp">setup</a>.
+</div>
+
+<div class="container light" id="vim">
+ <h2>Vim / Neovim</h2>
+</div>
+<div class="container">
+ <p>
+ <a class="link-button" href="https://github.com/onyx-lang/onyx.vim">Vim Plugin</a>
+ </p>
+
+ <p>
+ Follow the instructions on the <a href="https://github.com/onyx-lang/onyx.vim">onyx.vim</a> GitHub repo.
+ </p>
+
+ <p>
+ Note, that this extension currently does not setup the LSP.
+ That must be done separately.
+ </p>
+</div>
+
+
+<div class="container light" id="sublime-text">
+ <h2>Sublime Text</h2>
+</div>
+<div class="container">
+ <p>
+ Currently, Onyx does not have a published package on Sublime Text's Package Control, but like VS Code, you are able to install it manually.
+ </p>
+ <p>
+ In the <code>misc</code> folder of your installation, there is a file called <code>onyx.sublime-syntax</code>. Simply copy this into the <code>Packages/User</code> folder for Sublime Text. See more details <a href="https://www.sublimetext.com/docs/packages.html">here</a>.
+ </p>
+</div>
+
+<div class="container light" id="emacs">
+ <h2>Emacs</h2>
+</div>
+<div class="container">
+ <p>
+ Currently, Onyx does not have a published package for Emacs.
+ </p>
+
+ <p>
+ However, in the <code>misc</code> folder, there is an Emacs Lisp file that provides an <code>onyx-mode</code>.
+ You should be able to load it into your Emacs config and enable <code>onyx-mode</code> to get syntax highlighting.
+ </p>
+</div>
+
+<div class="container light" id="lsp">
+ <h2>Language Server</h2>
+</div>
+<div class="container">
+ <p>
+ If you are unfamiliar, a <em>Language Server</em> abstracts the tooling and language specific functionality out of editors and into a reusable component.
+ This way, it is easier to develop in-editor functionality across multiple editors, as the same work does not need to be replicated for each supported editor.
+ </p>
+
+ <h3>Installing the Language Server</h3>
+ <p>On Linux, MacOS, or the Windows Subsystem for Linux, run the following commands.</p>
+ <pre class="hljs"><code class="language-sh"># Clone the Onyx Language Server
+git clone https://github.com/onyx-lang/onyx-lsp
+cd onyx-lsp/run_tree
+# Make the install script executable
+chmod +x ./install
+# Install the LSP
+./install</code></pre>
+
+ <h3>Visual Studio Code</h3>
+ <p>Installing the extension automatically enables the language server in VS Code.</p>
+
<h3>Neovim</h3>
<p>To use the language server in NeoVim, you need to have <a href="https://github.com/neovim/nvim-lspconfig">the NeoVim lspconfig package</a> installed.</p>
<p>Then, you need the following in your NeoVim configuration somewhere:</p>
configs.onyx = {
default_config = {
- cmd = { "onyx-lsp" },
+ cmd = { "onyx", "lsp" },
filetypes = { "onyx" },
root_dir = function(filename)
local utils = require "lspconfig.util"
end
}</code></pre>
- <h3>Visual Studio Code</h3>
- <p>Installing the extension automatically enables the language server in VS Code.</p>
-
<h3>Sublime Text</h3>
<p>
Install the <code>LSP</code> package, and add the following custom configuration.
"clients": {
"onyx": {
"enabled": true,
- "command": ["onyx-lsp"],
+ "command": ["onyx", "lsp"],
"selector": "source.onyx"
}
}
}</pre></code>
</div>
-<div class="container " id="vim">
- <h2>Vim / Neovim</h2>
- <p>
- Follow the instructions on the <a href="https://github.com/onyx-lang/onyx.vim">onyx.vim</a> GitHub repo.
- </p>
-
- <p>
- Note, that this extension currently does not setup the LSP, and that must be done separately.
- </p>
-</div>
-
-<div class="container light" id="vscode">
- <h2>Visual Studio Code</h2>
- <p>
- Currently, Onyx does not have a published extension for Visual Studio Code, but you are able to install it manually. In your downloaded or cloned copy of Onyx, there is a <code>misc/vscode</code> folder, which contains multiple versions of the Onyx extension.
- </p>
-
- <p>To install the extension in VS Code,</p>
- <ol>
- <li>Hit "Control+Shift+P" on Windows/Linux, or "Command+Shift+P" on MacOS.</li>
- <li>Search for and select "Extensions: Install from VSIX".</li>
- <li>Go to the downloaded copy of Onyx and select the newest version of the Onyx extension in <code>misc/vscode</code>.
- <li>Restart VS Code.</li>
- </ol>
-
- <p>This extension does have support for the <code>onyx-lsp</code>, assuming that is setup.
-</div>
-
-<div class="container " id="sublime-text">
- <h2>Sublime Text</h2>
- <p>
- Currently, Onyx does not have a published package on Sublime Text's Package Control, but like VS Code, you are able to install it manually. In the <code>misc</code> folder, there is a file called <code>onyx.sublime-syntax</code>. Simply copy this into the <code>Packages/User</code> folder for Sublime Text. See more details <a href="https://www.sublimetext.com/docs/packages.html">here</a>.
- </p>
-</div>
-
-<div class="container light" id="emacs">
- <h2>Emacs</h2>
- <p>
- Currently, Onyx does not have a published package for Emacs. In the <code>misc</code> folder, there is an Emacs Lisp file that provides an <code>onyx-mode</code>. You should be able to load it into your Emacs config and enable <code>onyx-mode</code> to get syntax highlighting.
- </p>
-</div>
-
-
{{ endblock }}
{{ extends "pages/normal_page" }}
{{ block "title" }}
- The Onyx Programming Language
+ Onyx Programming Language
{{ endblock }}
{{ let navbar_page = "home" }}
</div>
</div>
+<!-- <div class="container light">
+ <h2 style="margin-bottom: 8px">Get Started</h2>
+</div> -->
<div class="container">
<div style="text-align: center;">
<div style="margin-bottom: 26px">
- Run the following command in your favorite shell on <strong>Linux or MacOS</strong> and get started with Onyx.
+ Install in one command, or build <a href="/docs/install">from source</a>.
</div>
<div>
<span style="font-size: 16pt; font-family: monospace; padding: 20px; color: var(--header-text); background: var(--header-color); border-radius: 8px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)">
</span>
</div>
<div style="margin-top: 40px">
- Or try Onyx online and read the docs!
+ Alternatively, try Onyx online and read the docs!
</div>
<div style="margin-top: 26px; display: flex; flex-direction: row; gap: 40px;">
- <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; background: var(--header-color); color: var(--header-text); box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/playground">TRY ONLINE</a>
- <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; background: var(--header-color); color: var(--header-text); box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/docs">READ THE DOCS</a>
+ <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; border: 1px solid var(--header-color); border-radius: 8px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/playground">TRY ONLINE</a>
+ <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; border: 1px solid var(--header-color); border-radius: 8px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/docs">READ THE DOCS</a>
</div>
</div>
</div>
{% partial "partials/news_listing" %}
<div class="container light">
- <h2>Overview</h2>
+ <h2>Language Overview</h2>
</div>
<div class="container">
</div>
-<div class="container light">
+<div class="container">
<div>
<h2>Type Safety</h2>
<br />
<div class="container">
<div>
- <h2>Compilation</h2>
+ <h2>Fast Compilation</h2>
<br />
<p>Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in <b>49 milliseconds</b>.</p>
</div>
</code></pre>
</div>
-<div class="container light">
+<div class="container">
<div>
<h2>WebAssembly</h2>
<br />
- <p>Onyx compiles solely to <a href="https://webassembly.org">WebAssembly</a>. You can use the builtin WebAssembly runtime using <code>onyx run</code>, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.</p>
+ <p>Onyx compiles solely to <a href="https://webassembly.org">WebAssembly</a>. You can use a builtin WebAssembly runtime using <code>onyx run</code>, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.</p>
</div>
<pre class="hljs"><code># Compile and run directly.
</div>
</div>
-<!-- <div class="container light">
- <h2 style="margin-bottom: 8px">Features</h2>
-
- <div class="panel-container">
- <div>
- <h3>Portable</h3>
- <p>By targetting WASM, Onyx can be used in the browser, or natively with a <a href="/news/ovmwasm">custom runtime</a>.</p>
- </div>
- <div>
- <h3>Data-Oriented</h3>
- <p>Ditch complicated classes and inheritance. Just focus on modeling the data for your application.</p>
- </div>
- <div>
- <h3>Extensible</h3>
- <p>With a C binding generation library, a useful C library is just one-step away.</p>
- </div>
- <div>
- <h3>Fun and Safe</h3>
- <p>Onyx enables programmer expressiveness, while making it easy to write bug-free code.</p>
- </div>
- </div>
-</div> -->
-
-
-
{{endblock}}
{{extends "pages/normal_page"}}
</div>
<div style="flex-grow: 1">
- <h3>Resources</h3>
+ <span style="font-size: 1.5rem; font-weight: 200;">Resources</span>
<a href="/docs">Docs</a>
<a href="/news">News</a>
</div>
<div style="flex-grow: 1">
- <h3>Contribute</h3>
+ <span style="font-size: 1.5rem; font-weight: 200;">Contribute</span>
<a href="https://github.com/onyx-lang/onyx/issues">GitHub Issues</a>
<a href="https://www.buymeacoffee.com/onyxlang">Donate</a>
</div>
{{ foreach $article in $articles }}
<div class="container">
- <div style="background: var(--light-background-color); padding: 32px; border-radius: 6px; box-shadow: 0px 1px 6px 1px rgba(0, 0, 0, 0.2)">
- <a href="/news/{% $article.path %}" style="color: var(--foreground-color)">
- <h2 style="float: left; margin: 0;">{% $article.name %}</h2>
- <p style="float: right"><em>{% $article.date %}</em></p>
- <br>
- <p style="clear:both;">
- {% $article.description %}
- </p>
- </a>
+ <div style="padding: 32px 0">
+ <h2 style="float: left; margin: 0; margin-bottom: 8px;">
+ <a href="/news/{% $article.path %}" style="color: var(--foreground-color)">
+ <span style="border-bottom: 1px solid rgba(0,0,0,0.2)">{% $article.name %}</span>
+ </a>
+ </h2>
+ <p style="float: right; line-height: 1.5rem;"><em>{% $article.date %}</em></p>
+ <br>
+ <p style="clear:both;">
+ {% $article.description %}
+ </p>
</div>
</div>
{{ endforeach }}