IntroductionEastwest is a highly experimental structurally edited programming language. It's goal is to show that editing large pieces of source code can be done quickly, efficiently and easily. The only interface to Eastwest is through its structure editor, so presenting source code snippets is, unfortunately, not possible. Fortunately, it can be done with videos. This tutorial is composed of a series of videos which can be imitated. After watching and imitating all the videos the user will have a grasp of everything you can do with Eastwest. Basic usesHello WorldIn this example you will see how to:
Naming functionsIn this video you will learn the finer point of naming functions in eastwest and you will learn about the floatArithmetic module. In Eastwest, function names are very flexible. The functions
are all valid function names. In this video you will see how to:
Simple DatatypeIn this video you will learn how to:
Notice how constructor naming is very flexible. In this case, the constructor names are infix. http://www.youtube.com/watch?v=LAccfmDqH8I Polymorphic DatatypeIn this video you will learn how to define a polymorphic list.http://www.youtube.com/watch?v=A5E96AF0lk4 User inputThe easiest way to get input from a user is to use the prompt keyword. prompt simply prompts the user for a value for the type which is infered. In this tutorial you will learn:
http://www.youtube.com/watch?v=JTlRpE7Y_X4 Saving, loading and clearingIn this video you will learn how to save, clear and open a module. There is no "save as" feature in Eastwest. Instead you must first rename a module then save it.http://www.youtube.com/watch?v=nWMJ_dRlMh8 PatternsIn this tutorial you will learn how to do some basic pattern matching. We will continue with the calculator example with the aim of writing a function which evaluates a calculator.http://www.youtube.com/watch?v=L1g7qUXdEIw LetIn this tutorial you will learn how to use let. Let simply lets you define a function or value locally. http://www.youtube.com/watch?v=Tt_Uik-Creo KeybindingsThese are the keybindings in Eastwest:
Using these key bindings we can usually completely avoid using the mouse. Putting it all together: a calculatorWe will build a calculator from scratch, thus recapitulating the "simple datatype","patterns", "user input" and "let" tutorials. In this tutorial we will avoid using the mouse by only using the key bindings.http://www.youtube.com/watch?v=SSZBc2ohR2o A note on types and errorsThe type of an expression is always displayed on the top of the screen. The only way to encounter a type error is when you change the type of a function or constructor. When this happens, the expression is highlighted in red. Selecting the expression will display the type error. Another error often encountered is when a function or type is not found because it was since deleted. In that case, the offending expression is once again highlighted. Changing fonts Eastwest does not differentiate between different character sets however you the default font only supports latin characters. To change this set the environment variable OSET_FONT_LOCATION to the font you wish to use. Here is a video which demonstrates changing the font to view a program written in japanese:http://www.youtube.com/watch?v=vwgvVpCRecE More advanced usesToken types, part 1In this tutorial you will learn how to deal with languages that contain contain identifiers. The language will be a form which will contain a name and an email address.http://www.youtube.com/watch?v=wpdlySeUUvk Token types, part 2In this tutorial you will learn a more advanced use of token types: to be able to handle scoped variables. In this case, we will focus on lambda calculushttp://www.youtube.com/watch?v=3KvHfoN7Ty8 Generalized Algebraic DatatypesIn this tutorial you will be introduced to generalized algebraic datatypes by writing a small simply typed language.http://www.youtube.com/watch?v=hOiI2oJZKgE Lambda calculus with type inferenceToken types combined with generalized algebraic datatypes can achieve some surprisingly powerful and safe languages, as seen in this tutorial.http://www.youtube.com/watch?v=eF9cLyWAnpg FormattingIt is possible to change the indentation and the newline placement in Eastwest. In this video you will see how to remove the default newline placement and the indentation of the plus operator. Furthermore, you will see an example of using copy/paste to reduce some repetitive work. http://www.youtube.com/watch?v=n-jEnsrMGPE |