PSudo Guidebook

by Team Symlink(Final Child, RanolP), with contributions from PSudo community.

This book targets PSudo 0.1.0 or higher. You can find how to install PSudo and how to update it from Chapter 1: "Installation". You can get information about the version from Appendix E.

Foreword

PSudo is a programming language which focused on Problem Solving. Whatever you want to solve, Your solving will be accelerated.

For instance, Attention to I/O speed is really harmful in Problem Solving. PSudo provides input statement and output statement so that you can handle I/O actions not only easier but also faster. Additionally, you can configure how I/O actions work by Compiler Directive.

Besides, PSudo provides a toolchain which removes pitfalls, furthermore gives you a modern way. Tools are designed ergonomically. We hope you to think that Problem Solving is easy and fun.

Moreover, PSudo purposes only Problem Solving, won't purposes general programming world. So the features are designed to use be on Problem Solving. Also, standard libraries are.

Introduction

Welcome to the PSudo Guidebook, an introductory book about PSudo. This book helps you to write better PSudo code faster. In Problem Solving, It is always hard to handle I/O and to implement a data structure. We couldn't use other modern languages in the ecosystem what uses C++, Python or Java as a standard language. Created based on our experiences so far, PSudo will be the first step to make up better Problem Solving Ecosystem for ourselves.

Targets

We wrote texts assuming you had programming experiences. Surely, we've minimized programming backgrounds. But this book didn't aimed to teach programming. We don't spend a lot of time talking about what programming is or how to think about it.

Reading Guide

In general, books are read from front to back sequentially. The later story builds on contents in an earlier story. And the earlier story might not give you details, we typically meet the topic again in a later story.

This book holds two stories per each stuff: Concept Story and Try Story. in Concept Story, we will explain the background behind, targets, and technical form about the stuff. in Try Story, we will introduce a situation the stuff can be used, and give an example code which tests the stuff from the situation.

Moreover, at the end of this book, there is some appendix which contains useful information in the more reference-like format. "Appendix A" is talking about characters and token processing on PSudo. "Appendix B" is talking about TODO. "Appendix C" is talking about a lot of useful things on the standard library. "Appendix D" is talking about development tools provided officially or community provided. "Appendix E" is talking about the version of PSudo...?

Actually, there is no wrong way and the right way to read this book. If you want to skip ahead then skip. When you're confused, go back. Just read it what you want to for you.

Finally, a really important part remains, the way to read errors on the sample code. Error codes will lead you to write working code. So, we wrote a lot of error codes. Therefore, Read the main text carefully, check whether the code works, then run. Check is there any marker exists is the good way to check is the code works. Remember those markers.

Marker Meaning
🤔 This code doesn't compile
😱 This code will panic
💀 This code contains unsafe-code
🙄 This code doesn't work as expected

Most of the cases, we've written code which works as expected after the error code.

The Beginning

Let's start to use PSudo right now! We have a lot of stuff to learn, But a journey begins with small things. On this chapter, we will learn these stuff:

  • How to install PSudo
  • Write a small Hello, world script on PSudo

Installation

PSudo will be able to download in the future. T_T

Troubleshooting

We'll fill this section as soon as possible!

Hello, PS

We've installed PSudo, It's time to try! Traditionally, When starting a new programming language, we write down a little program that prints Hello, world! on a terminal. So, Let's try it!

Note: This book assumes you to know command-line interface. This book won't limit you to use editor or development tools and place the file where. Just develop in your favorite environment.

Create a Folder

Note: PSudo never requires folder because codes and compiler configurations are stored in a single file. But we recommend you to create a folder and store all the PSudo codes on it. Because it is easier to organize.

First, create a folder where store code. It's not a matter where to place code, But this book assumes that you're creating a psudo-solutions folder in your home directory. Open a terminal and enter following commands to create the folder.

for Linux, macOS, Windows:

mkdir ~/psudo-solutions
cd ~/psudo-solutions

for Windows CMD:

mkdir "%USERPROFILE%\psudo-solutions"
cd /d "%USERPROFILE%\psudo-solutions"

Write and Run Your First Solution

Next, Make a new source file and call it hello-world.ps. PSudo file should end with .ps extension. If you're using more than one word on your file name, use the hyphen to separate them.

Now open the file and write down below codes.

output "Hello, world!"

Save the file and go back to your terminal window. Then run following command.

psudo run hello-world.ps

Whatever your OS is. It will print Hello, world on your terminal. If you didn't see these output, Go to Chapter 1: Installation - Troubleshooting part to get help.

However, if you did these jobs successfully, Congratulations! You've written a PSudo Solution! Which means, from now on you're PSudoer - welcome!