Thursday, July 25, 2024

Code Tutor If you have arrived here with questions about Code Tutor feel free to email questions to our support staff.

Coding Tutor was created to help anyone that would like to understand and learn about coding.

The best description might be that it works like an interactive book where you can both read and try.

You will learn by doing.

One of the great joys of writing code is watching it execute and being able to interactively engage with the program as it executes. No currently available coding app on iOS offers the ability to execute (interpret) code and run interactively on the device. Instead they submit the code to a remote server.

Not so here.

When read(expresion, expression, …) is running, you are prompted to enter responses for the variables interactively.

Learning by doing is fun.

I chose Pascal as the language because it is easy to read and understand. Pascal is a well structured procedural language with relatively simple structure.

Today there are many beautiful object oriented (OO) programming languages. In my experience, object oriented languages (Java, Swift, C#, Python, Kotlin, TypeScript, etc.) are significantly harder to grasp.

Pascal simple and provides a solid foundation for the novice learning to code.

I have implemented a tiny Pascal compiler, interpreter and runtime environment where you can safely learn and play in a sandbox which will not crash or otherwise wreak havoc on your device.

Keep in mind my goal here was not to create a complete Pascal compiler supporting every aspect of the language and runtime. This is a tiny app designed for teaching. Once you have the basic concepts, I would encourage you to go investigate Free Pascal or any of a number of complete Pascal compilers that are freely available.

Here’s a brief summary of what is supported.

Variable data types:

  • Integer
  • Real
  • String
  • FileHandle
  • Arrays of Integer, Real, or String.


This represents enough to begin learning. I have not implemented user defined types, Boolean, or Records all of which are provided by a complete and full Pascal compiler. File writes are restricted to a limit of 8,192 writes per FileHandle. Array length is similarly limited to 8,192 elements. Enough to learn but not blow-up your devices.

Runtime library:
  • Console write, writeln, read
  • File (sandboxed) read, write, assign, append, reset, rewrite, close, seek (begin, or end), and delete.
  • Array length (ArrayLen)
  • String manipulation including StrLen, SubString (a.k.a. Copy), StrSplit
  • Type conversions ToReal, ToInteger
  • IsFinite to test for finite Real values
  • Exit to end currently executing program


Control flow:
  • if expression then else
  • while expression do
  • repeat statements until expression
  • for var := expression {to,downto} do


Operator support is similarly a subset of the full Pascal language.

The App explains these concepts in detail and provides complete working code that can be modified, and executed interactively to help teach the concepts.

Finally, programming is a trade that can be learned by anyone with the aptitude. I created this app to help others discover the joys of writing code.

I am happy to answer questions, review programs you have written for which you have questions. In the Forward section of the doc’s you will find an email where you can send questions.

I am personally grateful to all of the giants that have gone before me and provided beautiful programming languages. Specifically I want to thank Anders Hejlsberg, a giant that helped me along the way.

Hopefully this tiny app will similarly inspire future programmers.

Cheers- jkountz

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.