LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

N# Compiler v1.8

Root / Submissions / [.]

computableeCreated:
Download:CKANY53Y
Version:Beta 1.7Size:
The N# Compiler is a compiler that reads N# code and outputs legal SmileBasic code. Its intention is to be an optional COMPLETE replacement for SmileBasic, as it contains the ability to do all that SB can do, plus more, easier. N# is a multi-paradigm (Object-Oriented, Functional) language with extra capabilities that SB does not have (such as classes, lazy evaluation, higher-order functions, etc.). The compiler eliminates need for variable and function suffixes (the compiler handles them automatically) and improves syntax of existing commands (for example, C-style "for," "while," "if," etc). N# is not an extension of SB, but rather a total replacement. It is not the same language by any means. All code must be in a function, and all functions should be in a class. If a function is not in a class, it will assume inheritance by the next occurring class. The compiler automatically runs "entry.main" at program start. Here's the official discussion/help thread: http://smilebasicsource.com/forum?fpid=5814

Instructions:

[N# manual has not been published] 1: Set PRG:N_SHARP as your SmileTool. 2: Write your N# program in slot 0 of the editor. 3: When you're ready to compile, press the Smile button. Your program will compile and will appear in slot 1 of the editor. This new PRG file is in pure SB, so it can be loaded, saved, and published independent of any N# tools. N# "Hello World" example:
use "Console"

static class entry
 def public void main()
  Console.Println "Hello World!"
 end
end static
As this is Beta, there are a few glitches I am aware of. However, almost all of these are crunched, and so the development should hopefully come out of beta soon. Update List: Beta v1.0: *Original publication Beta v1.1: *Private functions *Changed array declaration syntax *Fixed calculator example *Bug fixes Beta 1.2 *Revamped objects *Assigning objects class references *Bug fixes Beta 1.3 *Library importing *Completed object functionality *MML and Graphics classes *Class variables (private keyword doesn't work yet with these) *Passing an object's value as a parameter works now *Inline SB editor using [SB] tag in front of a line *Bug fixes Beta 1.4 * += and -= operators to work on objects * /=, %=, *=, <<=, and >>= operators added * % instead of MOD *Console and Hardware class *Class variables *Immutable value types *Foreach blocks *Basic array comprehension using [| and |] *Compile code to a standalone PRG! (No more mandatory runtime compilation) *Bug fixes Beta 1.5 *Changed syntax of switch blocks ("end" is no longer required after each case, only at the very end) *Changed compilation process of +=, -=, *=, /=, %=, <<=, and >>= (this does not affect the user) *Removed runtime compiler *Added progress bar to compilation *Removed support for labels *Partial sprite library *App library *Resource library *Bug fixes Beta 1.6 *By reference parameter passing *Brace syntax *Dictionary library *Wildcard variable (equal to anything) *Runs as SmileTool (much easier to use) *Ignore command *Lambdas and higher-order functions *Bug Fixes Beta 1.7 *Getter functions *Setter functions *Init functions *Modified Sprite and MML classes Beta 1.8 *Lazy evaluation *eval() function *BigInt library Expected Updates: Beta 1.9 *Completed Sprite Library *Function overloading *Bug Fixes

Notes:

Intended for use by experienced programmers.

Replying to:NateDogg1232
A cool thing would be to have an object have its own local arrays that work on an object's instance, not the object as a whole including all its instances (I hope that made sense)
You're talking about non-static members?

Replying to:NateDogg1232
A cool thing would be to have an object have its own local arrays that work on an object's instance, not the object as a whole including all its instances (I hope that made sense)
Yes, I'm talking about non-static arrays. Sorry, the term was blanking my mind.

n# programmed by basic? wow

How I can use this? I need help

Replying to:the_squat1115
How I can use this? I need help

Replying to:the_squat1115
How I can use this? I need help
Hello! N# was mainly made to introduce some basic object-oriented concepts while also providing a cleaner-looking syntax. It's buggy, and I made it only a couple years after I started programming when I didn't know much about object-oriented design. I would suggest, personally, if you want to learn an object-oriented language, to learn something like C# or Java. Lowerdash for SmileBasic also has some of these features. If you're simply looking for another language to learn, as much as I dislike it, Python is really good for beginners.

Personally I would prefer this one. And it's very neatly structured.

Replying to:the_squat1115
How I can use this? I need help
are there any intentions to continue developing this?

Replying to:the_squat1115
How I can use this? I need help
if he did, it would be a complete remake. also phil_ doesn't work on anything sb anymore really