Jump to content
Banner by ~ Ice Princess Silky

FiMSharp - A FiM++ interpreter in C# (Formerly NetFiM)


Jaezmien

Recommended Posts

FiMSharp

A FiM++ interpreter written in C#

(I ran out of buget to design a logo)

 

What's FiM++?

Quote

FiM++ is an object-oriented language made by fans of My Little Pony: Friendship is Magic, which takes its name from the initials of the show's subtitle. Its syntax and structure are inspired by Java and ALGOL. The original idea was published on October 4th, 2012 by Cereal Velocity, one of the bloggers on Equestria Daily and inventor of the language, after being unable to find pre-existing programming language based on My Little Pony. It was then picked up by an team of community programmers and completed within the month.

- esolangs.com description about FiM++

 

But what's new on this one since NetFiM?

There's still some minor bugs with this (which is why its still not on its first major version), but for the most part it should work.

 

* Subjective

What are the reports that can run on this?

See the test program for more details. Note that some reports require experimental functions.

 

Is it on NuGet now?

Hell yeah!

 

How do I use it?

using FiMSharp; // Available on NuGet and in the GitHub Release.

FiMReport report = new FiMReport(@"Dear Princess Celestia: Hello World!
Today I learned how to say hello world.
	I said ""Hello World!"".
That's all about how to say hello world.
Your faithful student, Twilight Sparkle."); // You can also use FiMReport.FromFile(string path); to use a path instead.

if( report.MainParagraph != null ) {
	report.MainParagraph.Execute(); // Outputs "Hello World!" into the console.
}

If you want to use the CLI instead:

Usage: ./fim [options] report_path
Interprets the specified FiM++ report.

Options:
  -p, --pretty               Prettify console output.
  -h, --help                 Show this message and exit.
  -e, --experimental         Add experimental functions.
  -j, --javascript           Convert file to Javascript.
  
Example: ./fim hello.fim

 

But what if I don't want to download it?

I got you! There is an online interpreter using Blazor to run the C# code.

Note that there are some limitations to it (such as being very slow on complicated reports), but this may change in the future.

The online interpreter transpiles your report into Javascript now!

 

Are you okay?

its been five years at this point and i am at the sixth iteration. there has been no development in the language for over what, 8 years now?

i think i have an addiction. but hey - its fun, and it makes for a nice challenge.

 

~ Links ~

Github Repository:  https://github.com/Jaezmien/FiMSharp

VS Code Syntax Highlighter: https://github.com/Jaezmien/NetFiM_Syntax

FiM++ Wikia: http://fimpp.wikia.com/wiki/FiM%2B%2B_Wiki

Language Specification: https://docs.google.com/

 

-- Old Post --

Spoiler

oh hey this is still a thing

 

NetFiM_Banner.png.229e9e38ca67508dd1936e0a7a000bd1.png

- Version 3 -

 

Now with (hopefully) cleaner code :yay:

I just did this when I realized that classes aren't illegal to use in C#.

 

Now this supports arrays, modifying and reading an array slot!

And you can now call this as a class and re-use it (finally).

 

To use NetFiM (why would you), you'll have to add the NuGet package MoonSharp to your project.

After that, just make a reference to all "NetFiM[X].cs" to your project and add:


using NetFIM.Core;

"Why not just make it a NuGet package?" ... eh nopony will use this lol

Also, the NetFiM folder contains an example Program which you can just run.

 

 

It's still not finished when it comes to fully implementing everything that's in the documents and the wikia.

And there's still missing features such as Switch and For Loops.

 

~ Links ~

GitHub:  https://github.com/Jaezmien/NetFiM-v2

VS Code Syntax Highlighter: https://github.com/Jaezmien/NetFiM_Syntax

 

FiM++ Wikia: http://fimpp.wikia.com/wiki/FiM%2B%2B_Wiki

Language Specification: https://docs.google.com/


-- Older Post --

Spoiler

this is just a little thing i decided to do so i can brush up on my c# knowledge
it's stable enough that it can run the example codes that i've found on the wiki, deviantart and the google drive document (though some needed modifications).

if anypony's interested/curious or brave enough to look at my code and try to improve it, here's the Github repository link.
(also here's a Visual Studio Code syntax highlighter)

and here's info about FiM++
FiM++ Wikia
[Google Drive] Language Specification

and of course, a download link. (not stable!!1!)


criticism/feedback is welcome /)

 

Edited by Jaezmien
Fixed repository link
  • Brohoof 5
Link to comment
Share on other sites

I liked how aggressive some of your comments are. I can't say I can approve of your sudden use of gotos at program.cs:476, but I'll give it a pass because it looks like you may have been edging on insanity in a few spots there. ^_^

I didn't know about moonsharp before, but it looks like a pretty useful tool. If I need something dynamic in C# like you did, I typically pull in Roslyn to compile dynamically generated C#Script. I'm not sure if there may or may not be any memory leaks there, I know I have to be careful when I do that stuff with Roslyn.

Overall though, nice work! Looks like a pain of a project. I've never been a fan of parsing text.

  • Brohoof 2
Link to comment
Share on other sites

i did it

i made a better version of it

 

i dont want to touch this project anymore :D

Anyway, it's now in a better shape where I'm comfortable with it now. Arrays are now supported, arithmetic is now also supported, and the code is now maintained in a clean(ish) way where executing a report is done inside a class. This might be the last time I do anything with FiM++ since it's hard doing something like this on a dead project.

Spoiler

next project might contain a certain pink pony on an unexpected "game engine"

its taking me a long time to do but it's 40% done

 

Link to comment
Share on other sites

  • The title was changed to FiMSharp - A FiM++ interpreter in C# (Formerly NetFiM)
On 2019-05-20 at 7:19 PM, Jaezmien said:

i dont want to touch this project anymore :D

Ha! This didn't age well.

After working on this iteration, attempting to do it again in Python in 2020, then going back to C# and spending the first months of 2021 doing another iteration. I did another iteration this year with cleaner (and hopefully easier to maintain) code.

I don't know why I keep doing it, but its really fun! (At the expense of not working on other projects :crackle:)
And yes, I did add a few things since NetFiM - check out the main post!

...dear Celestia, have i been making an iteration every year?

Link to comment
Share on other sites

Hello!

I've done some minor changes to this. Notably, the Javascript transpiler and experimental functions. Which means two things:

  • All reports in the Test project should work now! (Yes, including Brainfk).
  • The online interpreter should now be faster when dealing with complicated reports!

If the slowness of the online interpreter was bothering you, it should not happen as often as it was before. :)

  • Brohoof 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Join the herd!

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...