📜 ⬆️ ⬇️

IBM Swift Sandbox - Swift web sandbox for those who want to understand the Apple programming language



IBM has been working with Apple for quite some time. The interaction of the two companies concerns many areas, and one of them is programming. And programming on Swift. The fact is that Apple has made the source code for the Swift programming language open. And IBM’s Mobile Innovation Lab created a special sandbox for developers who would like to get to know Swift.

Thanks to the discovery of the code, developers who create applications for iOS, OS X and watchOS can easily bypass existing limitations, complementing many functions if necessary. Apple to attract a wider audience has published a fairly massive library of various documentation, which is positioned as a guide for novice programmers. It should be noted that Swift is licensed under the Apache 2.0 license. This license allows you to use the software for your own purposes, and Apple does not need to pay.

IBM Swift Sandbox allows you to use all the advantages of open source programming language, with writing your applications in Swift and then running the program on a Linux server. The code can be written in a text editor directly on the site "sandbox". This is the purpose of the editor located on the left side of the page. The right one shows the result - the created program or its prototype.
')
Hello swift

One of the participants in the development of the "sandbox" offers to begin familiarization with the new product with simple steps. For example, just write the code:

print ("Hello Swift!")

In order to check what is written, you need to select the blue button located at the top. If everything is good, then the corresponding phrase will appear on the result page.

If you make a mistake, it will not work, and the “compiler” will show that there is a problem somewhere.



It is impossible to write something complicated yet - this is just a demonstration model that opens up the possibility to try out the basics of a programming language. For an early acquaintance, the developers of the sandbox added a few examples. To use them, you need to select "Source Samples" in the upper left corner, after which a list of available templates will open. For example, if you select filestat.swift and run the program, the following will appear in the results window:

/ bin / bash is 1037464 bytes

If you change “/ bin / bash” to “/ tmp” in line 12, another number will appear.

As you can see, stat from glibc (The GNU C Library) is used here. This is possible because the sandbox runs under Linux.

Therefore, the code can interact with the system itself.

What's next?

So far, IBM Swift Sandbox only allows you to see what lies on the surface itself. After a while, it is planned to increase the functionality of the sandbox so that it can already work seriously. Follow the news of the project here Swift @ IBM .

Source: https://habr.com/ru/post/274067/


All Articles