DescriptionThe 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=5814Instructions[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 FixesNotesIntended for use by experienced programmers.
69 Comment(s)plinkopenguinOh I see. Thanks!computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsitePlinko, the .LIB files are all coded in N#, so feel free to browse those.plinkopenguinThis looks really neat. Are there more code examples?Otacon8xNoob question, does this work with the smil3 tools? If I install this new language wil I be able to work on my program still? Will I be able to finish it with the new language? And will I lose my custom sprites or be able to use them with the new language? Thank you.chemicalexDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming Strengthosu! Is Awesome!I love osu!Express YourselfIt compiles a program from one program file to another and runs it. Everything else in SmileBASIC outside of the folder will remain unaffected. MyLegGuyWhen are you going to publish a manual? How am I supposed to use this without that?computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteRight now, people have been reading the .LIB files and learning from those. It seems to be working with most people. I don't appreciate your demanding attitude, and I am working on the manual. I hope to have it done before the final release. After all, the language is still in beta.GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthWhen you do make the manual, you could send it with the Petit Modem and quote all the lines out. Then put LOAD "PRG3:MANUAL",0:USE 3 or something like that so you can read the manual anytime while coding.computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteI'll include a link to it in the compiler so that you can run it on the 3DS's web browser (since you can run it whilst an app is running).GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThat makes sense.MyLegGuySorry I sounded demanding and rude. I didn't mean to sound like that.GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThis will either be incredibly useful, or completely useless to me. I don't know C# or F#, but I might learn. I really like the concept, so keep up the good work.computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteN# is closest to C#. The part of N# that F# influenced was mainly syntax (for example, no line semicolons, [| and |] for assigning values to arrays, etc.)GuzzlerFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteDrawingI like to draw!HobbiesIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthOkay.16bitcoderHow do you use this?computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteInstructions are on this page.16bitcoderSo IAmAPersson (offtopic) how does it feel when people beg you to port Minecraft ds? I know two people are making Minecraft 3ds (they called it block craft as a retextured version) on miiverse. (Hopefully now you can relax right?)computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteI think people have gotten the hint that I don't intend on making MCDS. While they are disappointed, I myself find it a relief. MCDS was very stressful.
Also, if you're still having problems with N#, you can check out the help thread here: http://smilebasicsource.com/forum?fpid=5814Super_DefaultioVideo GamesI like to play video games!HobbiesDay PersonI like the warm sunshine and wake up early!Express YourselfZelda Is Awesome!I love The Legend Of Zelda!Express YourselfQuestion: do you need the commands to be in lowercase?computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteEverything is case sensitive, so if it's supposed to be lowercase, it has to be lowercase. However, you can define your own functions uppercase like:
def public void MYFUNCTION()
end
and now you reference MYFUNCTION() in all uppercase.computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteOkay, so N#'s development is almost complete. It's so close to completion, I've already started making H#, an alternative to SB with a functional paradigm (based off of Haskell and F#, hence the name H#).
All that's needed in N# still are a few libraries. The language itself is done unless bug fixes are required.computableeScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteOkay, so tons of progress has been made so far. Objects as class references are not complete yet, but I am working on them. Check out Phillip's posts (AKA me) on Miiverse for regular updates and examples of Nossrec programs!joelableFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfVideo GamesI like to play video games!HobbiesVery cool!
1
2
def public void MYFUNCTION() end
and now you reference MYFUNCTION() in all uppercase.