stillinbeta / friendshipismonadic Goto Github PK
View Code? Open in Web Editor NEWFim++ interpreter in Haskell
License: BSD 3-Clause "New" or "Revised" License
Fim++ interpreter in Haskell
License: BSD 3-Clause "New" or "Revised" License
This year, I decided to try Advent of Code using FiM++. I haven't finished the puzzles yet, but nonetheless i believe I have found a few minor deficiencies which would be very helpful to resolve.
Firstly, and most importantly, it would be good to be able to control which type of input I read in. Currently, the following code snippet:
Did you know that Spike was a number?
I asked Spike.
will give an error, as (currently) the 'asked' keyword causes a new variable called Spike to be declared of the appropriate type, and the user input read into this variable.
What I would like to see would be that, if Spike is already declared and has a type, then the asked keyword reads a value of that type into the variable Spike. This is useful when I expect to read in a number and the user enters '2' (currently that would be read as a character); it is vital when I wish to read in a string, as the current state of string manipulation in FiM++ (i.e. virtually nonexistent) means that if I read in a string, there is no reasonable way to split it into its composite characters; if I want to split up a string, it becomes possible if I am able to read it in character by character, and perhaps store it in a character array.
The second thing that I believe would be very useful would be implicit conversion between types. For example, if I have a character variable containing the value 'a', and I attempt to put it into a number variable, I currently get an error. I believe that it would be better if I got the value 97 (ascii value of the character 'a') and that, if I later put a number with the value 97 into a character variable, that the result is 'a'.
I do not believe that either of these tweaks would run contrary to the language specification, and they would make the language far more usable; by which I mean, it would become possible to solve Advent of Code problems without specifically editing the input file so that the data can be read in in non-string format.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.