Creating A C# Console App From My iPhone

Hyper IDE is an Open Source web-based Integrated Development Environment. It supports 100+ programming languages out of the box, and can be integrated with any type of command line tools, such as Git, compilers, etc. This leads to some interesting traits, such as the ability to actually create for instance C# console apps, from the browser on your phone. For the record, writing code on a phone is not easy, and not something I encourage people to do in general. However, the borderline use cases have interest.

For instance, reading code on your phone might provide value. If you need to emergency fix a bug, and you don't have access to your development machine, a phone might also work just fine. The magic lays in the accessibility.

This article has very little code because the actual code is not at the center of our attention here. What I want you to do though, is to download Phosphorus Five, which includes Hyper IDE out of the box. Make sure you download the correct source code file. Unzip it, open up the p5.sln file in for instance Visual Studio, and start the project. This will allow you to test out Hyper IDE, after a small security setup job.

Using Hyper IDE, you can then create a new folder in for instance "/users/root/documents/private/". You can name it whatever you wish, but I used "foo" as my folder name. Then create a new file and name it "foo.cs", and paste the following code.

  1. using System;  
  2. class Foo {  
  3.     static void Main() {  
  4.         Console.WriteLine("Hello World from foo");  
  5.     }  
  6. }  

Basically just a simple Hello World console app. Then make sure you click your "foo" folder in the TreeView, which functions kind of like your Visual Studio "solution explorer", and click the lightning button in your toolbar at the top. This will allow you to execute terminal commands, such as csc, git, etc. The terminal command you can choose as a template is called "csharp-compile". Make sure you modify its input parameters, such as at the very least your input code file is called "foo.cs", and if you want to you can also modify its output. I used "foo.exe" myself. Then click the "Execute" button, and your app will hopefully compile correctly.

C#

If it doesn't, you can notify me over at my GitHub page for the project, which you can find here, or see the following youtube video, where I walk you through each step of the process myself.

This article didn't feature the most interesting code on the planet, but hopefully, it can still be useful for you. I created Hyper IDE myself for the most parts in Hyper IDE in fact. This was how I tested it and made sure it worked correctly. Below you can find a screenshot of Hyper IDE, and how it looks like when you edit a Hyperlambda file, which is the programming language Hyper IDE was built with. If you are curious about how I pulled it off, the best tool for understanding how is actually Hyper IDE. You can find the entire code for Hyper IDE inside of the "/modules/hyper-ide" folder, from within Hyper IDE. As you edit its files, you can also click CTRL+SPACE to have autocompletion, which only works well for some few languages, such as JavaScript, CSS, HTML, and Hyperlambda. If you need any further help, you can send me an email at [email protected].


Similar Articles