GithubHelp home page GithubHelp logo

vyxal.github.io's Introduction

Vyxal 3 - Better than Ever

Note that there is a version 3.5 in the works at the moment. It's going to have a slightly different codepage, less monograph modifiers, more monograph elements, and less Error-prone lexers. If you're interested in checking out Vyxal 3, keep in mind that there'll be a somewhat major breaking change release coming out hopefully some time in March 3.5 development is temporarily paused, as is most new feature development. The main developer is taking a development hiatus for a while. Bug fixes will still be made where needed.

If you are looking for version 2 of Vyxal, you can find it here

Vyxal is an stack-based esoteric array language that is dedicated to dominating competition in code golf challenges. This means that it strips away all need for boilerplate, long function names and impractical source layouts. However, it also has a more traditional and familiar way of expressing itself if needed. Vyxal 3 is the third major iteration of the language that drives home this key design goal. Here's how.

What's the Same as Version 2?

Vyxal 3 is still a stack based programming language that uses a Single Byte Code Set (SBCS) for scoring well in code golf. It also retains some of the key features of version 2, such as contexts, modifiers and many, many type overloads.

It also maintains the more prac-lang-centric features such as variables and comments that version 2 has.

That's about it.

Because here's what's new in version 3

Literate Mode

Ever wanted to write vyxal without needing an on screen keyboard or editor shortcuts? Well now you can! Literate mode is designed to allow you to write vyxal 3 programs in complete ascii while maintaining a SBCS score. It does this by simply converting the literate code into sbcs code. Wanna see it in action?

## A collatz conjecture program
stdin := n ## read the input into n
(. scan-fix: {if even? then halve else triple increment end}) := collatz
$n $collatz call

Try it Online!

turns into:

?#=n⸠ᵡλ#{e|½|Tꜝ}}#=collatz#$n#$collatzĖ

(Try it Online!)


## The classic fizzbuzz
100 map{
  n [3, 5] divides?
  "FizzBuzz" halve
  dot-product maximum
} join-on-newlines

(Try it Online!)

turns into:

100Mλn#[3|5#]Ḋ"FizzBuzz"½ḋG}ṅ

(Try it Online!)


## How about something that generates all the fibonacci numbers?
## Like actually all of them

relation add from [1, 1] end

## is it really that simple?!

(yes!)

turns into:

Ṇ+|#[1|1#]}

(Try it Online!)

Isn't it snazzy? You can finally do well at golf without needing to smash your head on a weird looking keyboard!

More modifiers

Notice that scan-fix: in the collatz example? That's a modifier! "But version 2 already has modifiers, you said so yourself!" you say. Well version 2 had a very limited selection of modifiers, as they were more experimental at the time. Now, there's like 20 modifiers, all waiting to be used. Plus, they've gotten a little upgrade, in the form of

Arity grouping

Ever wanted to use jelly but realised it's way too hard? (who even sells hard jelly anyway? I thought the whole point was that it was soft and jiggly.) Well forget about using Ohm, because Vyxal 3 just got its own element grouping based on arity system. Plus it's much easier to understand!

Say you have a nilad followed by a monad (basically a constant followed by something that takes a single thing). Usually this sequence would be treated as two elements. However, it's obvious that the monad is going to operate directly on the nilad, as it's the same as writing monad(nilad). So instead of treating it as 2 things, it treats it as a single thing. This is useful for modifiers because you might have a situation where you can squeeze an extra element into what a modifier modifies where you wouldn't have been able to do so previously.

Variable Buffs

But that's all esolang specific stuff. If you've never used a golfing language before, you're probably wondering what all of that element stuff means. Well I've got prac-lang material for you that I think you'll love.

To define a variable:

value #=name (sbcs)
value := name (literate)

And to retrieve its value:

#$name (sbcs)
$name (literate)

"that's all good and well, but that's the same capabilities of version 2, how is that a buff?"

Because a) augmented variable assignment:

function #>name (SBCS)
function :> name (literate)

(works with any element or function, not just the regular +=, -=, *= etc you're probably used to seeing)

And b) variable unpacking

#:[x|y|z] (SBCS)
:=[x|y|z] (literate)

Variable unpacking can support any number of depths (e.g. [a|b|[[[[c|d]]]|e]|f]). Think of it like tuple unpacking in python but a little more powerful.

Whole New Built-in Set

The entire list of elements has been re-worked to remove some unnecessary overloads in version 2, and add some sorely missing elements that would make golfing a lot easier and shorter.

For a more specific overview of Vyxal 3, check out the tour

How do I run Vyxal 3?

There's a few methods:

  1. Head over to the online interpreter (this is the easiest).

  2. Download one of the release jar files, and run using

java -jar vyxal-jar <arguments>
  1. Download one of the executables for your platform and run as you would usually run an executable.

  2. Download the repository source and run with ./mill jvm.run. See Building.md for more details.

Contributing

For instructions on how to set up a development environment and an overview of how the interpreter works, see the contributing folder.

Links

Enjoy the cookies.

vyxal.github.io's People

Contributors

amiller42 avatar gingerindustries avatar lyxal avatar steffan153 avatar vyxal-bot[bot] avatar ysthakur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vyxal.github.io's Issues

Website needs to be updated to use changed js api

So the way the dictionary is passed to scala.js was changed to make it so that the file doesn't need to be passed anymore.

Hence anything in the site code setting the dictionary is going to error and needs to be removed.

Codepage

Add a codepage tab to the element offcanvas

Fix the idioms tab

Is it possible to fetch this from the yaml or do all elements need to be added manually?

Suggestion

Describe the feature

Show sugarless code in online interpreter.

Details
I see a few ways to go about implementing this.

  • Add a flag to display sugarless code in the debug box.
  • If sugar is included, automatically display sugarless code in the debug box.
  • On execution, replace the contents of the code boxes with the sugarless code.
  • (My personal favorite) Replace sugared code with sugarless as you type.

If we go with the last option, we could also incorporate it with syntax highlighting and have it mark invalid sugars and elements.

tooltip autocomplete stuff

  • Make tooltip highlighting follow the cursor [probably not feasible -G]
  • Pressing ctrl+space should ideally list all elements when the search is empty
  • Add structures and modifers to tooltips
  • Exclude strings from autocomplete, eg. "stuff"map does not work
  • Autocomplete should probably split search by spaces, eg. hel map should show results for map
  • Tooltips go very slightly off-screen (pad sides equally)
  • Make literate keywords clickable

Autocomplete Duplicates `'`

The autocomplete on the interpreter, which automatically closes strings and open brackets, also "closes" strings started with ', although they aren't closable structures.

Make the Output header appear clickable

If we can't have an arrow on the Output tab, at least make it somewhat clear that it's clickable. Currently, it has the text highlighting cursor (which makes it look like normal useless text, rather than a button), but that's nothing a bit of button-highlighting and cursor-changing can't fix!

(insert tags version-3 and online interpreter)

Error reporting fails on versioned pages

When using any version other than latest.html, error reporting fails, and the code just hangs and times out. The error given in the browser is as follows:

Uncaught TypeError: errorFunc is not a function
    at $c_Lvyxal_JSVyxal$.execute__T__T__T__sjs_js_Function1__sjs_js_Function1__V (vyxal.js:221:7)
    at $c_Lvyxal_JSVyxal$.execute (vyxal.js:322:8)
    at worker.js:12:11

Try it Online!

some enhancements / bugs

Here's a list of features (subjectively sorted by priority) which don't need separate issues:

Medium priority

  • make idioms tab scrollable
  • Add basic mobile support (fancy css for resizing stuff, make tabs non-moveable and so on)
  • Fix the compressor tab
  • Syntax highlighting (once it's possible to do so)
  • Add hotkey support (ctrl-r for run, ...)
  • The navbar clips off

Low priority

  • Character substitution with tab (ideally list them somewhere too)
  • Make the "Add tab" screen align more with the dark theme
  • Add seperate tab for flags
  • Make SBSCify operator also turn SBSC to literate code
  • Tooltip for copy to clipboard / compress
  • Option to select version (once versioning works)
  • Fix padding

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.