Homebrew Question Wich coding language is used on the switch

Bedel

The key of the blade
Member
Joined
Oct 28, 2015
Messages
1,384
Trophies
0
XP
2,831
Country
United States
Mostly C, but you now can program in python, lua or javascript. I also remember someone talking about C++, but not sure.
 

Crownfox

Active Member
Newcomer
Joined
May 19, 2018
Messages
38
Trophies
0
Age
33
XP
137
Country
United States
C is good for a lot of things, but does expect you to be able to program a lot of things from scratch.

Python for Switch seems to be good for filesystem tools, as it doesn't have access to much else.

Lua for Switch is capable of doing a lot of things on Switch, but whether or not C libs are usable on the switch in the context of Lua would be a defining factor in whether or not this as useful as using C.

JS for Switch isn't complete yet, but it doesn't have much access to the Switch outside of the SD card filesystem.

Out of these, I would recommend C if you know how to program using it.

If you just want to use Lua for some basic stuff, I'd recommend giving Love Potion for Switch a shot.
 

Bedel

The key of the blade
Member
Joined
Oct 28, 2015
Messages
1,384
Trophies
0
XP
2,831
Country
United States
I'd add that I would personally prefer C++ over C due to conveniences with strings, vectors, objects, etc that are not available in plain C.
Yeah you are right. I program in Java and C# (ignoring javascript, php and phyton). Do you recommend me to learn some C++ in my free time to program homebrew for Switch, using devkitpro and libnx?
 

vickdu31

Well-Known Member
Member
Joined
Nov 14, 2016
Messages
228
Trophies
0
Age
27
XP
353
Country

Lets say there is a genius here, are these libraries enough at their current state to reverse engineer the .nsp files/ build a package installer such as FBI or WupInstall ?

Yeah you are right. I program in Java and C# (ignoring javascript, php and phyton). Do you recommend me to learn some C++ in my free time to program homebrew for Switch, using devkitpro and libnx?
Once you master C++, you can pretty much do anything.
 

Bedel

The key of the blade
Member
Joined
Oct 28, 2015
Messages
1,384
Trophies
0
XP
2,831
Country
United States
Lets say there is a genius here, are these libraries enough at their current state to reverse engineer the .nsp files/ build a package installer such as FBI or WupInstall ?


Once you master C++, you can pretty much do anything.
I know what an OOP language can do. That was not what I asked xD
 

LeifEricson

Coming Soon™
Member
Joined
Jun 22, 2012
Messages
234
Trophies
0
Age
27
Location
New York, USA
Website
www.youtube.com
XP
534
Country
United States
I know what an OOP language can do. That was not what I asked xD

It wouldn't hurt to familiarize yourself with it, I'd say go for it. Another great thing is that C source files can be used in C++ projects, so for instance if you want to include a C library or existing C code you can do so, or you can just start teaching yourself by modifying some of the examples for C++ instead of C.
 
  • Like
Reactions: Bedel

Shrike

Well-Known Member
Member
Joined
Mar 10, 2018
Messages
120
Trophies
0
Age
34
XP
832
Country
Germany
If you just want to use Lua for some basic stuff, I'd recommend giving Love Potion for Switch a shot.

THIS ^

Especially when you are not that used to low level programming ...
With the right library LUA supports simple Classes, too. So simple OOP is no problem ;)
More information & sourcecode here: https://github.com/TurtleP/LovePotion/tree/switch

I suggest you downloading my port of Snake (https://gbatemp.net/threads/homebrew-snake-port-lovepotion.498467/) and look inside the *.lua files inside /game/.
You will see LovePotion gives you a good support for switch specific functions like controls or vibration.
Best usecase for LovePotion would be most 2D-Game genres like RPG, JumpAndRuns, PuzzleGames, ...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    ButterScott101 @ ButterScott101: +1