diff --git a/docs/404.html b/docs/404.html index 51e797b6..714c5e47 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,7 +1,7 @@
-Panda is a clear and stylish programming language for JVM based on top of the Panda Framework, focusing on safety, simplicity and extensibility.
\nNote: At this moment Panda is at an early stage of development and it is not recommended to use it in any kind of software that requires stability.
The purpose of the Panda is to reduce boilerplate code written in Java and improve the safety of various aspects of Java language using modern solutions.\nIt is also a default implementation of Panda Framework and presentation of some of its possibilities. Let's see who may be interested.
\nThe language and ecosystem is simple and friendly for people who just stared their journey with software development.\nTools like REPL or implementation like Light should make this path easier.
\nOpen Source is most of all a community that work together to reach the same goal. Be one of the first people who may create awesome libraries or contribute to the existing projects related with Panda.
\nEnhance your project by scripts written in Panda or create your own language on top of the Panda Framework. Implement in a few steps language that is suited to your case instead of trying to force existing solutions to your needs.
\nAs always, there is no perfect technology and here is a list of disadvantages that should be considered against using projects based on Panda Framework
\nPanda does not support primitive types, each operation on this kind of data causes autoboxing. In a standard code it does not really matter, but in case of any listed situation it may be a bottleneck.
\n"}},{"node":{"id":"101","title":"Installation","path":"/guide/installation/","content":"At this moment we offer two ways to install Panda. The first one is dedicated for users and developers who use and create applications in Panda. The second on is for developers who want to use Panda Framework as a scripting language in theirs applications.
\nAs we said, Panda runs on JVM (Java Virtual Machine). We have prepared installer with wrapped JVM to get rid of problems related to some kind of invalid/custom installations of an existing machines.
\n./panda-installer.exe\n
\nPanda supports various implementations of JVM and all their versions above 8+
\nAs a standard way to serve Java library, we host Maven artifact located in our own repository called Panda Repository:
\n<repository>\n <id>panda-repository</id>\n <name>Panda Repository</name>\n <url>https://repo.panda-lang.org/</url>\n</repository>\n
\nThe artifact may be found as:
\n<dependency>\n <groupId>org.panda-lang</groupId>\n <artifactId>panda</artifactId>\n <version>{version}</version>\n</dependency>\n
\n"}},{"node":{"id":"102","title":"Tools","path":"/guide/tools/","content":"Project is still unstable and there is no official and advanced tools yet. You may take a look at these concepts:
\nWe don't recommend to use API of Panda Framework before beta release.
\n"}},{"node":{"id":"200","title":"Project","path":"/guide/project/","content":"Projects in Panda should follow the standardized structure.\nCreate a directory for your new project called e.g. awesome-project
:
$ mkdir awesome-project\n$ cd awesome-project\n
\nEvery proper project should contain at least 2 files:
\npanda.cdn
- project configuration file in CDN (JSON5 like format) with some details about the current projectapp.panda
- main script file (Name of this file can be changed in a configuration)Let's see how it should look like:
\npanda-project/ # project directory\n src/ # sources\n app.panda # main script file\n tests/ # <concept> integration tests\n resources/ # <concept> non panda files\n panda.cdn # project configuration file\n README.md # project description for GitHub and Reposilite pages \n
\n"}},{"node":{"id":"201","title":"Configuration","path":"/guide/configuration/","content":"This file describes our project and the way how it works. It uses JSON-like format called 'JSON for Humans'
.\nStandard configuration file should contain name
, version
, author
and main
key-value properties:
name: awesome-project\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: src/app.panda\n}\n
\nYou may also declare dependencies by adding the dependencies section:
\n// <source>:<author>/<name>@<version>\ndependencies: [\n // Panda library from GitHub\n github:dzikoysk/panda-dependency@1.0.1\n // Java library from Maven\n maven:org.panda-lang/reposilite@2.8.2\n]\n
\n"}},{"node":{"id":"202","title":"Running","path":"/guide/running/","content":"Panda files always end with .panda
extension. You could already notice that we've declared our main file in project configuration as app.panda
in directory src
, so let's create it now:
panda@terminal ./project-awesome/\n$ mkdir src\n$ touch src/app.panda\n
\nNext, add the following code to your app.panda
file. You can use your favorite editor like e.g. Visual Studio Code.
main {\n log 'Hello, Panda!'\n}\n
\nYou can assume that the code that you have already used will print 'Hello, Panda!'
message in the console. Don't worry, we will analyze this code later. Let's check the result - to launch the awesome-project
you need just one more step:
panda@terminal ./project-awesome/\n$ panda panda.cdn\nHello, Panda!\n\n--- OR: you may call src/app.panda directly (it ignores project configuration file)\n\n$ panda src/app.panda\nHello, Panda!\n
\nCongratulations! You've officially written a Panda program. That makes you a Panda programmer - welcome!
\n"}},{"node":{"id":"300","title":"Basics","path":"/guide/basics/","content":"Many programming languages have much in common at their core.\nThis chapter is a list of available structures and expressions in Panda.\nThey are ordered in a way that may help during the learning process.
\n"}},{"node":{"id":"301","title":"Comments","path":"/guide/comments/","content":"Comments are statements in our code that the interpreter ignores.\nWe generally use them to explain the code.\nIt means comments won't be a part of the program and it will not be executed.
\n// single line comment\n\n/*\nMultiline\nComment\n*/\n\n/**\n * Documentation comment\n * It's used to generate documentation of your program in a standardized way\n */\n
\n"}},{"node":{"id":"302","title":"Main","path":"/guide/main/","content":"The main block is a launch station of your application.\nIt is called by the interpreter and it is always the first code that runs in every executable program.
\nmain {\n // code goes here\n}\n
\nRemember - You should specify file with a main statement in your project configuration file.
\n"}},{"node":{"id":"303","title":"Basic types","path":"/guide/basic-types/","content":"Data type identifies and describes values used in your code.\nBy default, we have types that identifies numbers, texts or logical values.
\nIntegral numbers are defined by the Int
type:
123\n-321\n
\nIn the similar way we can use floating-point numbers represented by the Float
type:
1.0\n-0.1337\n
\nThere are also other number types like Byte
, Short
, Long
and Double
.\nYou will learn about them in the future.
In programming, the type that describes text is called String.\nAs of today, every time you want to use some sequence of characters in your program, you have to call it String
.\nWe can declare String
in two forms:
// preferred way of declaring strings, \n// we can use quotation marks inside of the apostrophe string\n'Michael Scott said \"I love inside jokes. I hope to be a part of one someday.\"'\n\n// useful when we want to use apostrophe in string\n\"That's what she said\"\n\n// useful when we want to mix ' and \" \n`\"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.\"`\n
\nTo represent true
and false
states we need to use the boolean data type.\nThe boolean values in Panda are represented by the Bool
type.
Array is a collection of values with a predefined size.\nIt is well-known structure in programming,\nbut if you haven't never had a contact with any programming language,\nyou can imagine it as a primitive form of list.
\nTo create an array, you have to use []
operator:
String[] array = new String[5] // array of 5 elements\narray[0] = \"First element in array\" // store string value at position 0 in array\nlog array[0] // print value at position 0\n
\n"}},{"node":{"id":"304","title":"Log","path":"/guide/log/","content":"In a clear way, logging is just a fancy word to define a process of writing down what you do.\nIt is utility statement, used in most cases to display list of expressions to a default output of your application (e.g. console).
\nlog 'Hello', 'Panda!'\n
\nDespite this, serious projects should still consider custom logging libraries for a fuller experience.
\n"}},{"node":{"id":"305","title":"Modules","path":"/guide/modules/","content":"Every piece of your application should belong somewhere. This place is called module and it is defined on top of your file.
\nmodule awesome-app\n\n// for submodules\n\nmodule awesome-app:submodule\n
\nNames of modules supports:
\na-zf
0-9
-
:
(to separate submodules)As you could see, we can define modules related to some parts of our application.\nIt is a standard way to distribute utilities by libraries, to use delivered components we need to import them using the following structure:
\n// import java collections from std/module path\nrequire java:collections\n\n// import 'local-module' module in directory ./local-module\nrequire 'local-module'\n
\nThe require statement supports also single files:
\n// import './local-file.panda' file\nrequire 'local-file'\n
\n"}},{"node":{"id":"307","title":"Import","path":"/guide/import/","content":"Import works like the require statement, but for Java classes.\nUsing this structure you can easily use types from Java, they are mapped automatically.
\nimport java.lang.Thread\n
\nNote: Imported classes are not visible in another files. To make imported class visible use export
statement.
To improve overall scripting experience and simplify access to the Java types, you can use the export
statement.\nThe statement works like import
, but it also publishes the result to the other participants like files and modules that imports this module.
module extra-java-bindings\n\n// export StringUtils class, the class will be visible in \nexport org.panda_lang.utilities.commons.StringUtils\n
\nIt may be helpful during the process of creating wrappers and bindings modules for existing Java apps and libraries.
\n"}},{"node":{"id":"309","title":"Variables","path":"/guide/variables/","content":"A variable is a symbolic name for your information (value). Every variable must be declared. Any attempt to use a variable that hasn't been declared yet is a syntax error. By default, variables in Panda are:
\nString message = 'With Great Beard Comes Great Responsibility'\n
\nSometimes there is a need to change/update value of some variables. To make your variable mutable just add mut
keyword
mut String messageOfTheDay = 'Productivity'\n\nif true {\n messageOfTheDay = 'Cat Videos'\n}\n
\nIn some evil scenarios you may be also forced to handle null values (e.g. during the interaction with Java libraries).
\nnil String playingWithFire = null\n
\nRemember: You should avoid null values, it is really bad practice to operate directly on a value that in fact does not even exist. Null values are also known as The Billion Dollar Mistake. Panda supports null
values only because of the compatibility requirements with Java layer.
Let's say you want to assign value to a variable a little later due to e.g. some kind of condition.\nYou may use late
keyword to have a guarantee that the variable was assigned before its usage.\nYou can also still benefit from the immutability of this variable.
late String conditionalValue\n\nif true {\n conditionalValue = 'a'\n}\nelse {\n conditionalValue = 'b'\n}\n
\n"}},{"node":{"id":"310","title":"Operators","path":"/guide/operators/","content":"Operators are these all strange combinations of ~!=-+:/|()%&*
characters that do some basic stuff like e.g. comparing two values.\nThis article should be a part of the Chapter 5 about expressions,\nbut we need to explain it now to clarify some of the next basic structures.
Returns Number
as a result of operation
Operator | \nName | \nDescription | \nExample | \n
---|---|---|---|
+ | \nAddition | \nAdds together two values | \nx + y | \n
- | \nSubtraction | \nSubtracts one value from another | \nx - y | \n
* | \nMultiplication | \nAdds together two values | \nx * y | \n
/ | \nDivision | \nAdds together two values | \nx / y | \n
% | \nModulus | \nAdds together two values | \nx % y | \n
++ | \nIncrement | \nIncreases the value of a variable by 1 | \ni++ | \n
-- | \nDecrement | \nDecreases the value of a variable by 1 | \ni-- | \n
Returns assigned value as a result
\nOperator | \nDescription | \nExample | \n
---|---|---|
= | \nAssign value to a variable | \nx = y | \n
+= | \nAdd value to a variable | \nx += y | \n
-= | \nSubtract value from a variable | \nx -= y | \n
*= | \nMultiplicate value of variable | \nx *= y | \n
/= | \nDivide value of variable | \nx /= y | \n
Remember: Variables modified by these operators have to be mutable.
\nReturns true
or false
as a result:
Operator | \nName | \nExample | \n
---|---|---|
== | \nEquals to | \nx == y | \n
!= | \nNot equals to | \nx != y | \n
> | \nGreater than | \nx > y | \n
< | \nLess than | \nx < y | \n
>= | \nGreater than or equal to | \nx <= y | \n
<= | \nLess than or equal to | \nx >= y | \n
Returns true
or false
as a result:
Operator | \nName | \nDescription | \nExample | \n
---|---|---|---|
&& | \nAnd | \nTrue if both statements are true | \n(x == 0) && (y == 0) | \n
|| | \nOr | \nTrue if one of the statements is true | \n(x == 0) || (y == 0) | \n
! | \nNot | \nReverse the result value | \n!(x == 0) | \n
Conditions performs different computations or actions depending on a provided value:
\nString slogan = 'I’m lovin’ it'\n\nif slogan == 'Taste the rainbow' {\n // do something if the slogan variable is equals to the 'Taste the rainbow' text\n}\nelse if slogan != '' {\n // do something if slogan is not empty\n}\nelse {\n // do something if all of the above conditions hasn't been succeed\n}\n
\nAs you might suppose, the do something if slogan is not empty
section will be performed.
Loops are used to execute a set of statements repeatedly until a particular condition is satisfied.\nPanda supports 4 types of loops at this moment.
\nYou can just easily loop x
times using the standard loop
statement:
loop 5 {\n log 'ฅ^•ﻌ•^ฅ' // this code will be performed 5 times\n}\n
\nThe most popular for-loop in almost every programming language. The pattern of for
syntax is as follows:
for (initialization; termination condition; increment) {\n statement(s)\n}\n
\ntrue
, the loop will be performedAn example implementation of this statement might looks like:
\nfor (mut Int index = 1; index < 2; index++) {\n log index\n}\n
\nNote: You can also skip some of these expressions or even all of them:
\nfor (;;) {\n log 'What's happening?!'\n}\n
\nYou've just created the infinite loop!
\nYou can also use foreach
loop to iterate over iterable structures (in most cases just collections):
foreach (String element : collection) { \n log element\n}\n
\nAnother popular loop called while-loop.\nThe while loop loops through a block of code as long as a specified condition is true.
\nmut active = true\n\nwhile active {\n log 'Active: ' + (active = false)\n}\n
\nNote: As an alternative to infinite loops based on for (;;) { }
, you can just use while true { }
✧ʕ̢̣̣̣̣̩̩̩̩·͡˔·ོɁ̡̣̣̣̣̩̩̩̩✧
Branching statements interfere the control flow of your code.\nUsing these statements you can easily return values and interrupt some actions.
\nUsing the return
statement you can easily interrupt execution of current scope.
main {\n if true {\n return // the main scope will be terminated here\n } \n\n // this code is unreachable\n}\n
\nYou are also able to return a value.\nFor instance, method getMessage()
that returns String
\n(don't worry, we will explain methods later)
shared getMessage () -> String {\n return 'Hello Panda' // return value\n}\n
\nThe continue
statement allows us to skip current iteration of loop.\nBecause of this fact, it works only in loops.
for (mut Int index = 0; index < 10; index++) {\n if (index % 2) == 0 {\n continue // skip even numbers\n }\n\n log index\n}\n\n// prints 1, 3, 5, 7, 9\n
\nThe break
statement works like return
for loops.\nUsing the break
you can terminate flow of execution.
while true {\n if ThreadLocalRandom.current().nextInt(0, 100) == 50 {\n break // break infinite loop if we draw number 50 🤡\n }\n}\n
\n"}},{"node":{"id":"314","title":"Throw","path":"/guide/throw/","content":"An exception is an event,\nwhich occurs during the execution of a program,\nthat disrupts the normal flow of the program's instructions.
\nWhat does it mean?\nIn case of any unwanted situations (like passing invalid data),\nwe can interrupt execution of our application using the throw
keyword.
Let's say we want to make sure that nobody will perform division by zero:
\nInt by = 0 // user data\n\nif (by == 0) {\n throw new Exception('Cannot divide by zero') // throw error\n}\n\nlog 100/by\n
\nThese exceptions are fully compatible with Java exception system.
\n"}},{"node":{"id":"315","title":"Try","path":"/guide/try/","content":"We've just talked about throwing exceptions.\nIt might be very confusing to understand, why would you throw these strange exceptions,\nif you could just simply log an error message and return.\nThe whole thing is that actually, we can catch these exceptions using the try-catch
block:
Int by = 0 // user data\n\ntry {\n if (by == 0) {\n throw new Exception('Cannot divide by zero') // throw error\n }\n\n log 100/by\n} \ncatch (Exception e) {\n log e.getMessage() // print message of the caught exception\n}\n
\nUsing this try-catch
you can also catch exceptions thrown in Java sources.
Types describe values and its behaviors.\nYou've already used some of them like String
and Bool
.
It's time to create a new one, let's say a Cat
type.\nTo declare a new type, we need to use type
keyword:
type Cat {\n\n}\n
\nTo use a new type, you have to create a new instance using the new {TypeName}()
structure:
Cat garfield = new Cat()\nCat grumpy = new Cat()\n
\nIn the following articles about fields
, methods
, constructors
and many others, we will enhance this example.
Remember: Members of types (like fields
or methods
) are called properties
.\nSome of them can by called using the ()
structure.\nWe can also specify some extra data between this brackets - these values are called arguments
.
In fact, before we will start talking about all the mechanisms associated with types,\nwe need to introduce the visibility system.
\nVisibility allows us to control access to various properties declared by types.\nAt this moment Panda supports 3 visibilities:
\nopen
- we can access these properties wherever we areshared
- only module that owns this type, and its submodules, can access these propertiesinternal
- only type and its inheritors can access these propertiesBecause of the fact that it might be hard to understand for beginners,\nwe will declare every property as open
for the purposes of the guide.
Constructor is a block of code executed when we create an instance of our type.
\ntype Cat {\n constructor (String name) {\n log name\n }\n}\n\nmain {\n // new Cat() performs constructor()\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n}\n
\nIf we do not specify a custom constructor,\nPanda will generate the empty one constructor () { }
that just does nothing.
To put it simply, field is just a variable that belongs to the type.\nThe pattern that defines fields is as follows:
\n{visibility} {type} {name}\n
\nLet's say we want add field with a name of our cat to store this information:
\ntype Cat {\n // {visibility} {type} {name}\n open String name\n\n constructor (String name) {\n // to distinguish variable name with field name, \n // we can use 'this.` prefix to indicate field\n this.name = name\n }\n}\n\nmain {\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n\n // we can access field 'name', so let's print its value\n log garfield.name, grumpy.name\n}\n
\n"}},{"node":{"id":"404","title":"Methods","path":"/guide/methods/","content":"A function is a block of organized, reusable code that is used to perform a single, related action.\nFunctions that belong to types are called methods
.\nThe pattern that defines methods is as follows:
{visibility} {method name} ( {parameters} ) -> {return type} {\n // code\n}\n
\nLet's replace direct access to field name
with a method getName()
:
type Cat {\n internal String name\n\n constructor (String name) {\n this.name = name\n }\n\n // {visibility} {method name} ( {parameters} ) -> {return type}\n open getName () -> String {\n return this.name\n }\n}\n\nmain {\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n\n // we can call methods just like that:\n log garfield.getName(), grumpy.getName()\n}\n
\n"}},{"node":{"id":"405","title":"Static","path":"/guide/static/","content":"Fields and methods you've already used in the previous articles were called and accessed using some object instances.\nThere is also a way to declare properties that do not need an instance to work.\nThis kind of properties are called static
and are often used to declare some constant values and utilities.
It is good practice to use uppercase names for static fields:
\ntype Mars {\n open static Float RADIUS = 3389.5\n}\n\nmain {\n // we don't need to create instance of Mars\n // to access RADIUS field coz it is static\n log Mars.RADIUS \n}\n
\ntype Math {\n // find highest value of a and b\n open static max (Int a, Int b) -> Int {\n if (a > b) {\n return a\n }\n\n return b\n }\n}\n\nmain {\n // we don't need to create instance of Mars\n // to access max method coz it is static\n log Math.max(-10, 100)\n}\n
\n"}},{"node":{"id":"406","title":"Inheritance","path":"/guide/inheritance/","content":"Inheritance is a concept where we can share common properties between various types.
\nWe've already defined type Cat
.\nIf we'd like to create a new type Dog
that behaves exactly like Cat
, we could just copy-paste its content.\nIt is a little silly and exhausting solution, especially in larger projects.
Let's think about common characteristics of Cat
and Dog
.\nFor instance, they're both animals, so it is time to create the Animal
type:
type Animal {\n internal String name\n\n constructor (String name) {\n this.name = name\n }\n\n open getName () -> String {\n return this.name\n }\n}\n
\nTo inherit Animal
we need to extend
it using the type {Name} : {Type to extend}
:
type Cat : Animal { }\n\ntype Dog : Animal { }\n
\nVoilà! 🥖
\nNote: Unfortunately, we can extend
only one type.\nThis limitation is a result of problems that comes with a various conflicts between shared properties.
The main problem in inheritance is to support compatibility of object initialization process.\nLiterally speaking, we need to guarantee call to the base
(parent) constructor.
We will use previous example to explain and fix lack of base
call:
type Animal {\n constructor (String name) { }\n}\n\ntype Cat : Animal {\n\n}\n
\nBy default, every type without specified constructor has empty constructor without parameters.\nIt means that in fact, Cat
looks like this:
type Cat : Animal {\n constructor () { }\n}\n
\nAs you can see, we have conflict between constructors.\nCalling new Cat()
we cannot perform new Animal('name of animal')
due to lack of name
parameter.\nIt's time for the base
statement:
type Cat : Animal {\n constructor (String name) { \n base(name) // pass value to parent constructor \n }\n}\n
\nFixed 👍
\n"}},{"node":{"id":"408","title":"Interfaces","path":"/guide/interfaces/","content":"The interface
is a list of requirements that type has to contain.\nOne type can implement several interfaces.
interface AnimalType {\n\n getAnimalType () -> String\n \n}\n
\nImplementation of interface looks exactly the same as extending another type:
\ntype Cat : Animal, AnimalType {\n\n override getAnimalType () -> String {\n return 'Cat'\n }\n\n}\n
\nAs you can see, we've used strange new keyword - override
.\nIn Panda, we have to mark overridden (declared by other types) methods and thanks to that,\nwe can avoid unintentional overrides.
Welcome to the chapter 5 🤠.\nIt's been a while to get here.\nYou've already learned some expressions...\nWait, we didn't explain what expression
really is.
To put it simply, expression
is a statement that returns something as a result.\nSome of expressions that we used in previous chapters:
'Hello'\n123\ntrue\n10 != 20\nindex++\nnew Cat()\ncat.name\ndog.getName()\n
\nAs you can see, all of them return value that we can e.g. assign to a variable.\nIn this chapter we will show you other useful built-in expressions.
\n"}},{"node":{"id":"501","title":"Concatenation","path":"/guide/concatenation/","content":"String concatenation is the operation of joining string values.
\nlog 'We can add values ' + \"as strings and even other objects like\"\n
\nWe can also concatenate other types:
\nlog 'Value: ' + 1000\n
\nYou should be careful, for instance let's consider this case:
\nlog '🤔: ' + 1 + 2\n
\nThe following code prints 🤔: 12
.\nTo avoid strange behaviors we stringify all the parameters without exceptions.\nTo perform some kind of custom actions like math operations,\nyou have to wrap the operation into the ( )
brackets:
log '🤔: ' + (1 + 2)\n
\n"}},{"node":{"id":"502","title":"Number types","path":"/guide/number-types/","content":"List of available number types in std:
\nByte
represents values between -128 to 127
, defined as 123B
Short
represents values between -32,768 to 32,767
, defined as 123S
Int
represents values between -2^31 to 2^31-1
, defined as 123
Long
represents values between -2^63 to 2^63-1
, defined as 123L
Float
represents values between 32-bit floating point specified in Java Language Specification, defined as 123.0F
Double
represents values between 64-bit floating point specified in Java Language Specification, defined as 123.0D
To access primitive wrappers for primitive types, use Primitive{Type}
types.\nIt's sometimes necessary during the access to Java API:
PrimitiveChar[] primitiveArray = '#onlypanda'.toCharArray()\nArrays.sort(primitiveArray)\nlog new String(primitiveArray)\n
\n"}},{"node":{"id":"600","title":"Developers","path":"/guide/developers/","content":"Note: This chapter is dedicated only for developers that want to wrap Panda in their projects.\nIt is not a part of the language guide.
\nWarning: API is not stable
\nTo be continued ฅ^•ﻌ•^ฅ
\nPanda is a clear and stylish programming language for JVM based on top of the Panda Framework, focusing on safety, simplicity and extensibility.
\nNote: At this moment Panda is at an early stage of development and it is not recommended to use it in any kind of software that requires stability.
The purpose of the Panda is to reduce boilerplate code written in Java and improve the safety of various aspects of Java language using modern solutions.\nIt is also a default implementation of Panda Framework and presentation of some of its possibilities. Let's see who may be interested.
\nThe language and ecosystem is simple and friendly for people who just stared their journey with software development.\nTools like REPL or implementation like Light should make this path easier.
\nOpen Source is most of all a community that work together to reach the same goal. Be one of the first people who may create awesome libraries or contribute to the existing projects related with Panda.
\nEnhance your project by scripts written in Panda or create your own language on top of the Panda Framework. Implement in a few steps language that is suited to your case instead of trying to force existing solutions to your needs.
\nAs always, there is no perfect technology and here is a list of disadvantages that should be considered against using projects based on Panda Framework
\nPanda does not support primitive types, each operation on this kind of data causes autoboxing. In a standard code it does not really matter, but in case of any listed situation it may be a bottleneck.
\n"}},{"node":{"id":"101","title":"Installation","path":"/guide/installation/","content":"At this moment we offer two ways to install Panda. The first one is dedicated for users and developers who use and create applications in Panda. The second on is for developers who want to use Panda Framework as a scripting language in theirs applications.
\nAs we said, Panda runs on JVM (Java Virtual Machine). We have prepared installer with wrapped JVM to get rid of problems related to some kind of invalid/custom installations of an existing machines.
\n./panda-installer.exe\n
\nPanda supports various implementations of JVM and all their versions above 8+
\nAs a standard way to serve Java library, we host Maven artifact located in our own repository called Panda Repository:
\n<repository>\n <id>panda-repository</id>\n <name>Panda Repository</name>\n <url>https://repo.panda-lang.org/</url>\n</repository>\n
\nThe artifact may be found as:
\n<dependency>\n <groupId>org.panda-lang</groupId>\n <artifactId>panda</artifactId>\n <version>{version}</version>\n</dependency>\n
\n"}},{"node":{"id":"102","title":"Tools","path":"/guide/tools/","content":"Project is still unstable and there is no official and advanced tools yet. You may take a look at these concepts:
\nWe don't recommend to use API of Panda Framework before beta release.
\n"}},{"node":{"id":"200","title":"Project","path":"/guide/project/","content":"Projects in Panda should follow the standardized structure.\nCreate a directory for your new project called e.g. awesome-project
:
$ mkdir awesome-project\n$ cd awesome-project\n
\nEvery proper project should contain at least 2 files:
\npanda.cdn
- project configuration file in CDN (JSON5 like format) with some details about the current projectapp.panda
- main script file (Name of this file can be changed in a configuration)Let's see how it should look like:
\npanda-project/ # project directory\n src/ # sources\n app.panda # main script file\n tests/ # <concept> integration tests\n resources/ # <concept> non panda files\n panda.cdn # project configuration file\n README.md # project description for GitHub and Reposilite pages \n
\n"}},{"node":{"id":"201","title":"Configuration","path":"/guide/configuration/","content":"This file describes our project and the way how it works. It uses JSON-like format called 'JSON for Humans'
.\nStandard configuration file should contain name
, version
, author
and main
key-value properties:
name: awesome-project\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: src/app.panda\n}\n
\nYou may also declare dependencies by adding the dependencies section:
\n// <source>:<author>/<name>@<version>\ndependencies: [\n // Panda library from GitHub\n github:dzikoysk/panda-dependency@1.0.1\n // Java library from Maven\n maven:org.panda-lang/reposilite@2.8.2\n]\n
\n"}},{"node":{"id":"202","title":"Running","path":"/guide/running/","content":"Panda files always end with .panda
extension. You could already notice that we've declared our main file in project configuration as app.panda
in directory src
, so let's create it now:
panda@terminal ./project-awesome/\n$ mkdir src\n$ touch src/app.panda\n
\nNext, add the following code to your app.panda
file. You can use your favorite editor like e.g. Visual Studio Code.
main {\n log 'Hello, Panda!'\n}\n
\nYou can assume that the code that you have already used will print 'Hello, Panda!'
message in the console. Don't worry, we will analyze this code later. Let's check the result - to launch the awesome-project
you need just one more step:
panda@terminal ./project-awesome/\n$ panda panda.cdn\nHello, Panda!\n\n--- OR: you may call src/app.panda directly (it ignores project configuration file)\n\n$ panda src/app.panda\nHello, Panda!\n
\nCongratulations! You've officially written a Panda program. That makes you a Panda programmer - welcome!
\n"}},{"node":{"id":"300","title":"Basics","path":"/guide/basics/","content":"Many programming languages have much in common at their core.\nThis chapter is a list of available structures and expressions in Panda.\nThey are ordered in a way that may help during the learning process.
\n"}},{"node":{"id":"301","title":"Comments","path":"/guide/comments/","content":"Comments are statements in our code that the interpreter ignores.\nWe generally use them to explain the code.\nIt means comments won't be a part of the program and it will not be executed.
\n// single line comment\n\n/*\nMultiline\nComment\n*/\n\n/**\n * Documentation comment\n * It's used to generate documentation of your program in a standardized way\n */\n
\n"}},{"node":{"id":"302","title":"Main","path":"/guide/main/","content":"The main block is a launch station of your application.\nIt is called by the interpreter and it is always the first code that runs in every executable program.
\nmain {\n // code goes here\n}\n
\nRemember - You should specify file with a main statement in your project configuration file.
\n"}},{"node":{"id":"303","title":"Basic types","path":"/guide/basic-types/","content":"Data type identifies and describes values used in your code.\nBy default, we have types that identifies numbers, texts or logical values.
\nIntegral numbers are defined by the Int
type:
123\n-321\n
\nIn the similar way we can use floating-point numbers represented by the Float
type:
1.0\n-0.1337\n
\nThere are also other number types like Byte
, Short
, Long
and Double
.\nYou will learn about them in the future.
In programming, the type that describes text is called String.\nAs of today, every time you want to use some sequence of characters in your program, you have to call it String
.\nWe can declare String
in two forms:
// preferred way of declaring strings, \n// we can use quotation marks inside of the apostrophe string\n'Michael Scott said \"I love inside jokes. I hope to be a part of one someday.\"'\n\n// useful when we want to use apostrophe in string\n\"That's what she said\"\n\n// useful when we want to mix ' and \" \n`\"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.\"`\n
\nTo represent true
and false
states we need to use the boolean data type.\nThe boolean values in Panda are represented by the Bool
type.
Array is a collection of values with a predefined size.\nIt is well-known structure in programming,\nbut if you haven't never had a contact with any programming language,\nyou can imagine it as a primitive form of list.
\nTo create an array, you have to use []
operator:
String[] array = new String[5] // array of 5 elements\narray[0] = \"First element in array\" // store string value at position 0 in array\nlog array[0] // print value at position 0\n
\n"}},{"node":{"id":"304","title":"Log","path":"/guide/log/","content":"In a clear way, logging is just a fancy word to define a process of writing down what you do.\nIt is utility statement, used in most cases to display list of expressions to a default output of your application (e.g. console).
\nlog 'Hello', 'Panda!'\n
\nDespite this, serious projects should still consider custom logging libraries for a fuller experience.
\n"}},{"node":{"id":"305","title":"Modules","path":"/guide/modules/","content":"Every piece of your application should belong somewhere. This place is called module and it is defined on top of your file.
\nmodule awesome-app\n\n// for submodules\n\nmodule awesome-app:submodule\n
\nNames of modules supports:
\na-zf
0-9
-
:
(to separate submodules)As you could see, we can define modules related to some parts of our application.\nIt is a standard way to distribute utilities by libraries, to use delivered components we need to import them using the following structure:
\n// import java collections from std/module path\nrequire java:collections\n\n// import 'local-module' module in directory ./local-module\nrequire 'local-module'\n
\nThe require statement supports also single files:
\n// import './local-file.panda' file\nrequire 'local-file'\n
\n"}},{"node":{"id":"307","title":"Import","path":"/guide/import/","content":"Import works like the require statement, but for Java classes.\nUsing this structure you can easily use types from Java, they are mapped automatically.
\nimport java.lang.Thread\n
\nNote: Imported classes are not visible in another files. To make imported class visible use export
statement.
To improve overall scripting experience and simplify access to the Java types, you can use the export
statement.\nThe statement works like import
, but it also publishes the result to the other participants like files and modules that imports this module.
module extra-java-bindings\n\n// export StringUtils class, the class will be visible in \nexport org.panda_lang.utilities.commons.StringUtils\n
\nIt may be helpful during the process of creating wrappers and bindings modules for existing Java apps and libraries.
\n"}},{"node":{"id":"309","title":"Variables","path":"/guide/variables/","content":"A variable is a symbolic name for your information (value). Every variable must be declared. Any attempt to use a variable that hasn't been declared yet is a syntax error. By default, variables in Panda are:
\nString message = 'With Great Beard Comes Great Responsibility'\n
\nSometimes there is a need to change/update value of some variables. To make your variable mutable just add mut
keyword
mut String messageOfTheDay = 'Productivity'\n\nif true {\n messageOfTheDay = 'Cat Videos'\n}\n
\nIn some evil scenarios you may be also forced to handle null values (e.g. during the interaction with Java libraries).
\nnil String playingWithFire = null\n
\nRemember: You should avoid null values, it is really bad practice to operate directly on a value that in fact does not even exist. Null values are also known as The Billion Dollar Mistake. Panda supports null
values only because of the compatibility requirements with Java layer.
Let's say you want to assign value to a variable a little later due to e.g. some kind of condition.\nYou may use late
keyword to have a guarantee that the variable was assigned before its usage.\nYou can also still benefit from the immutability of this variable.
late String conditionalValue\n\nif true {\n conditionalValue = 'a'\n}\nelse {\n conditionalValue = 'b'\n}\n
\n"}},{"node":{"id":"310","title":"Operators","path":"/guide/operators/","content":"Operators are these all strange combinations of ~!=-+:/|()%&*
characters that do some basic stuff like e.g. comparing two values.\nThis article should be a part of the Chapter 5 about expressions,\nbut we need to explain it now to clarify some of the next basic structures.
Returns Number
as a result of operation
Operator | \nName | \nDescription | \nExample | \n
---|---|---|---|
+ | \nAddition | \nAdds together two values | \nx + y | \n
- | \nSubtraction | \nSubtracts one value from another | \nx - y | \n
* | \nMultiplication | \nAdds together two values | \nx * y | \n
/ | \nDivision | \nAdds together two values | \nx / y | \n
% | \nModulus | \nAdds together two values | \nx % y | \n
++ | \nIncrement | \nIncreases the value of a variable by 1 | \ni++ | \n
-- | \nDecrement | \nDecreases the value of a variable by 1 | \ni-- | \n
Returns assigned value as a result
\nOperator | \nDescription | \nExample | \n
---|---|---|
= | \nAssign value to a variable | \nx = y | \n
+= | \nAdd value to a variable | \nx += y | \n
-= | \nSubtract value from a variable | \nx -= y | \n
*= | \nMultiplicate value of variable | \nx *= y | \n
/= | \nDivide value of variable | \nx /= y | \n
Remember: Variables modified by these operators have to be mutable.
\nReturns true
or false
as a result:
Operator | \nName | \nExample | \n
---|---|---|
== | \nEquals to | \nx == y | \n
!= | \nNot equals to | \nx != y | \n
> | \nGreater than | \nx > y | \n
< | \nLess than | \nx < y | \n
>= | \nGreater than or equal to | \nx <= y | \n
<= | \nLess than or equal to | \nx >= y | \n
Returns true
or false
as a result:
Operator | \nName | \nDescription | \nExample | \n
---|---|---|---|
&& | \nAnd | \nTrue if both statements are true | \n(x == 0) && (y == 0) | \n
|| | \nOr | \nTrue if one of the statements is true | \n(x == 0) || (y == 0) | \n
! | \nNot | \nReverse the result value | \n!(x == 0) | \n
Conditions performs different computations or actions depending on a provided value:
\nString slogan = 'I’m lovin’ it'\n\nif slogan == 'Taste the rainbow' {\n // do something if the slogan variable is equals to the 'Taste the rainbow' text\n}\nelse if slogan != '' {\n // do something if slogan is not empty\n}\nelse {\n // do something if all of the above conditions hasn't been succeed\n}\n
\nAs you might suppose, the do something if slogan is not empty
section will be performed.
Loops are used to execute a set of statements repeatedly until a particular condition is satisfied.\nPanda supports 4 types of loops at this moment.
\nYou can just easily loop x
times using the standard loop
statement:
loop 5 {\n log 'ฅ^•ﻌ•^ฅ' // this code will be performed 5 times\n}\n
\nThe most popular for-loop in almost every programming language. The pattern of for
syntax is as follows:
for (initialization; termination condition; increment) {\n statement(s)\n}\n
\ntrue
, the loop will be performedAn example implementation of this statement might looks like:
\nfor (mut Int index = 1; index < 2; index++) {\n log index\n}\n
\nNote: You can also skip some of these expressions or even all of them:
\nfor (;;) {\n log 'What's happening?!'\n}\n
\nYou've just created the infinite loop!
\nYou can also use foreach
loop to iterate over iterable structures (in most cases just collections):
foreach (String element : collection) { \n log element\n}\n
\nAnother popular loop called while-loop.\nThe while loop loops through a block of code as long as a specified condition is true.
\nmut active = true\n\nwhile active {\n log 'Active: ' + (active = false)\n}\n
\nNote: As an alternative to infinite loops based on for (;;) { }
, you can just use while true { }
✧ʕ̢̣̣̣̣̩̩̩̩·͡˔·ོɁ̡̣̣̣̣̩̩̩̩✧
Branching statements interfere the control flow of your code.\nUsing these statements you can easily return values and interrupt some actions.
\nUsing the return
statement you can easily interrupt execution of current scope.
main {\n if true {\n return // the main scope will be terminated here\n } \n\n // this code is unreachable\n}\n
\nYou are also able to return a value.\nFor instance, method getMessage()
that returns String
\n(don't worry, we will explain methods later)
shared getMessage () -> String {\n return 'Hello Panda' // return value\n}\n
\nThe continue
statement allows us to skip current iteration of loop.\nBecause of this fact, it works only in loops.
for (mut Int index = 0; index < 10; index++) {\n if (index % 2) == 0 {\n continue // skip even numbers\n }\n\n log index\n}\n\n// prints 1, 3, 5, 7, 9\n
\nThe break
statement works like return
for loops.\nUsing the break
you can terminate flow of execution.
while true {\n if ThreadLocalRandom.current().nextInt(0, 100) == 50 {\n break // break infinite loop if we draw number 50 🤡\n }\n}\n
\n"}},{"node":{"id":"314","title":"Throw","path":"/guide/throw/","content":"An exception is an event,\nwhich occurs during the execution of a program,\nthat disrupts the normal flow of the program's instructions.
\nWhat does it mean?\nIn case of any unwanted situations (like passing invalid data),\nwe can interrupt execution of our application using the throw
keyword.
Let's say we want to make sure that nobody will perform division by zero:
\nInt by = 0 // user data\n\nif (by == 0) {\n throw new Exception('Cannot divide by zero') // throw error\n}\n\nlog 100/by\n
\nThese exceptions are fully compatible with Java exception system.
\n"}},{"node":{"id":"315","title":"Try","path":"/guide/try/","content":"We've just talked about throwing exceptions.\nIt might be very confusing to understand, why would you throw these strange exceptions,\nif you could just simply log an error message and return.\nThe whole thing is that actually, we can catch these exceptions using the try-catch
block:
Int by = 0 // user data\n\ntry {\n if (by == 0) {\n throw new Exception('Cannot divide by zero') // throw error\n }\n\n log 100/by\n} \ncatch (Exception e) {\n log e.getMessage() // print message of the caught exception\n}\n
\nUsing this try-catch
you can also catch exceptions thrown in Java sources.
Types describe values and its behaviors.\nYou've already used some of them like String
and Bool
.
It's time to create a new one, let's say a Cat
type.\nTo declare a new type, we need to use type
keyword:
type Cat {\n\n}\n
\nTo use a new type, you have to create a new instance using the new {TypeName}()
structure:
Cat garfield = new Cat()\nCat grumpy = new Cat()\n
\nIn the following articles about fields
, methods
, constructors
and many others, we will enhance this example.
Remember: Members of types (like fields
or methods
) are called properties
.\nSome of them can by called using the ()
structure.\nWe can also specify some extra data between this brackets - these values are called arguments
.
In fact, before we will start talking about all the mechanisms associated with types,\nwe need to introduce the visibility system.
\nVisibility allows us to control access to various properties declared by types.\nAt this moment Panda supports 3 visibilities:
\nopen
- we can access these properties wherever we areshared
- only module that owns this type, and its submodules, can access these propertiesinternal
- only type and its inheritors can access these propertiesBecause of the fact that it might be hard to understand for beginners,\nwe will declare every property as open
for the purposes of the guide.
Constructor is a block of code executed when we create an instance of our type.
\ntype Cat {\n constructor (String name) {\n log name\n }\n}\n\nmain {\n // new Cat() performs constructor()\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n}\n
\nIf we do not specify a custom constructor,\nPanda will generate the empty one constructor () { }
that just does nothing.
To put it simply, field is just a variable that belongs to the type.\nThe pattern that defines fields is as follows:
\n{visibility} {type} {name}\n
\nLet's say we want add field with a name of our cat to store this information:
\ntype Cat {\n // {visibility} {type} {name}\n open String name\n\n constructor (String name) {\n // to distinguish variable name with field name, \n // we can use 'this.` prefix to indicate field\n this.name = name\n }\n}\n\nmain {\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n\n // we can access field 'name', so let's print its value\n log garfield.name, grumpy.name\n}\n
\n"}},{"node":{"id":"404","title":"Methods","path":"/guide/methods/","content":"A function is a block of organized, reusable code that is used to perform a single, related action.\nFunctions that belong to types are called methods
.\nThe pattern that defines methods is as follows:
{visibility} {method name} ( {parameters} ) -> {return type} {\n // code\n}\n
\nLet's replace direct access to field name
with a method getName()
:
type Cat {\n internal String name\n\n constructor (String name) {\n this.name = name\n }\n\n // {visibility} {method name} ( {parameters} ) -> {return type}\n open getName () -> String {\n return this.name\n }\n}\n\nmain {\n Cat garfield = new Cat('Garfield')\n Cat grumpy = new Cat('Grumpy Cat')\n\n // we can call methods just like that:\n log garfield.getName(), grumpy.getName()\n}\n
\n"}},{"node":{"id":"405","title":"Static","path":"/guide/static/","content":"Fields and methods you've already used in the previous articles were called and accessed using some object instances.\nThere is also a way to declare properties that do not need an instance to work.\nThis kind of properties are called static
and are often used to declare some constant values and utilities.
It is good practice to use uppercase names for static fields:
\ntype Mars {\n open static Float RADIUS = 3389.5\n}\n\nmain {\n // we don't need to create instance of Mars\n // to access RADIUS field coz it is static\n log Mars.RADIUS \n}\n
\ntype Math {\n // find highest value of a and b\n open static max (Int a, Int b) -> Int {\n if (a > b) {\n return a\n }\n\n return b\n }\n}\n\nmain {\n // we don't need to create instance of Mars\n // to access max method coz it is static\n log Math.max(-10, 100)\n}\n
\n"}},{"node":{"id":"406","title":"Inheritance","path":"/guide/inheritance/","content":"Inheritance is a concept where we can share common properties between various types.
\nWe've already defined type Cat
.\nIf we'd like to create a new type Dog
that behaves exactly like Cat
, we could just copy-paste its content.\nIt is a little silly and exhausting solution, especially in larger projects.
Let's think about common characteristics of Cat
and Dog
.\nFor instance, they're both animals, so it is time to create the Animal
type:
type Animal {\n internal String name\n\n constructor (String name) {\n this.name = name\n }\n\n open getName () -> String {\n return this.name\n }\n}\n
\nTo inherit Animal
we need to extend
it using the type {Name} : {Type to extend}
:
type Cat : Animal { }\n\ntype Dog : Animal { }\n
\nVoilà! 🥖
\nNote: Unfortunately, we can extend
only one type.\nThis limitation is a result of problems that comes with a various conflicts between shared properties.
The main problem in inheritance is to support compatibility of object initialization process.\nLiterally speaking, we need to guarantee call to the base
(parent) constructor.
We will use previous example to explain and fix lack of base
call:
type Animal {\n constructor (String name) { }\n}\n\ntype Cat : Animal {\n\n}\n
\nBy default, every type without specified constructor has empty constructor without parameters.\nIt means that in fact, Cat
looks like this:
type Cat : Animal {\n constructor () { }\n}\n
\nAs you can see, we have conflict between constructors.\nCalling new Cat()
we cannot perform new Animal('name of animal')
due to lack of name
parameter.\nIt's time for the base
statement:
type Cat : Animal {\n constructor (String name) { \n base(name) // pass value to parent constructor \n }\n}\n
\nFixed 👍
\n"}},{"node":{"id":"408","title":"Interfaces","path":"/guide/interfaces/","content":"The interface
is a list of requirements that type has to contain.\nOne type can implement several interfaces.
interface AnimalType {\n\n getAnimalType () -> String\n \n}\n
\nImplementation of interface looks exactly the same as extending another type:
\ntype Cat : Animal, AnimalType {\n\n override getAnimalType () -> String {\n return 'Cat'\n }\n\n}\n
\nAs you can see, we've used strange new keyword - override
.\nIn Panda, we have to mark overridden (declared by other types) methods and thanks to that,\nwe can avoid unintentional overrides.
Welcome to the chapter 5 🤠.\nIt's been a while to get here.\nYou've already learned some expressions...\nWait, we didn't explain what expression
really is.
To put it simply, expression
is a statement that returns something as a result.\nSome of expressions that we used in previous chapters:
'Hello'\n123\ntrue\n10 != 20\nindex++\nnew Cat()\ncat.name\ndog.getName()\n
\nAs you can see, all of them return value that we can e.g. assign to a variable.\nIn this chapter we will show you other useful built-in expressions.
\n"}},{"node":{"id":"501","title":"Concatenation","path":"/guide/concatenation/","content":"String concatenation is the operation of joining string values.
\nlog 'We can add values ' + \"as strings and even other objects like\"\n
\nWe can also concatenate other types:
\nlog 'Value: ' + 1000\n
\nYou should be careful, for instance let's consider this case:
\nlog '🤔: ' + 1 + 2\n
\nThe following code prints 🤔: 12
.\nTo avoid strange behaviors we stringify all the parameters without exceptions.\nTo perform some kind of custom actions like math operations,\nyou have to wrap the operation into the ( )
brackets:
log '🤔: ' + (1 + 2)\n
\n"}},{"node":{"id":"502","title":"Number types","path":"/guide/number-types/","content":"List of available number types in std:
\nByte
represents values between -128 to 127
, defined as 123B
Short
represents values between -32,768 to 32,767
, defined as 123S
Int
represents values between -2^31 to 2^31-1
, defined as 123
Long
represents values between -2^63 to 2^63-1
, defined as 123L
Float
represents values between 32-bit floating point specified in Java Language Specification, defined as 123.0F
Double
represents values between 64-bit floating point specified in Java Language Specification, defined as 123.0D
To access primitive wrappers for primitive types, use Primitive{Type}
types.\nIt's sometimes necessary during the access to Java API:
PrimitiveChar[] primitiveArray = '#onlypanda'.toCharArray()\nArrays.sort(primitiveArray)\nlog new String(primitiveArray)\n
\n"}},{"node":{"id":"600","title":"Developers","path":"/guide/developers/","content":"Note: This chapter is dedicated only for developers that want to wrap Panda in their projects.\nIt is not a part of the language guide.
\nWarning: API is not stable
\nTo be continued ฅ^•ﻌ•^ฅ
\nSimple, clear and boilerplate free syntax.\nFrom now on, read the guide and start building amazing apps
\n"}},{"node":{"id":"2","title":"Versatile","link":"/guide","content":"Legacy free language for any kind of modern project,\nrunning in every environment supported by the JVM
\n"}},{"node":{"id":"3","title":"Extensible","link":"/guide#developers","content":"Enhance your project by scripts written in Panda or create your own language on top of the Panda Framework
\n"}}]},"allNewsPost":{"edges":[{"node":{"id":"4","title":"Panda 0.1.2-alpha","description":"","date":"16 August 2020","path":"/news/release-0-1-2-alpha/","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install\nDevelopers: panda-lang.org/guide#installation
\nArchives:
\n\n"}},{"node":{"id":"3","title":"Panda 0.1.1-alpha","description":"","date":"7 July 2020","path":"/news/release-0-1-1-alpha/","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n"}},{"node":{"id":"2","title":"Releases Roadmap","description":"","date":"2 July 2020","path":"/news/releases-roadmap/","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n"}}]}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"allFeature":{"edges":[{"node":{"id":"1","title":"Approachable","link":"/guide","content":"Simple, clear and boilerplate free syntax.\nFrom now on, read the guide and start building amazing apps
\n"}},{"node":{"id":"2","title":"Versatile","link":"/guide","content":"Legacy free language for any kind of modern project,\nrunning in every environment supported by the JVM
\n"}},{"node":{"id":"3","title":"Extensible","link":"/guide#developers","content":"Enhance your project by scripts written in Panda or create your own language on top of the Panda Framework
\n"}}]},"allNewsPost":{"edges":[{"node":{"id":"4","title":"Panda 0.1.2-alpha","description":"","date":"16 August 2020","path":"/news/release-0-1-2-alpha/","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\n"}},{"node":{"id":"3","title":"Panda 0.1.1-alpha","description":"","date":"7 July 2020","path":"/news/release-0-1-1-alpha/","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n"}},{"node":{"id":"2","title":"Releases Roadmap","description":"","date":"2 July 2020","path":"/news/releases-roadmap/","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n"}}]}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/install/index.json b/docs/assets/data/install/index.json index e36a772b..ef4cd5f9 100644 --- a/docs/assets/data/install/index.json +++ b/docs/assets/data/install/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":null,"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":null,"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/index.json b/docs/assets/data/news/index.json index 7fa1fbe4..8ea7e9fe 100644 --- a/docs/assets/data/news/index.json +++ b/docs/assets/data/news/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"allNewsPost":{"totalCount":5,"edges":[{"node":{"id":"4","title":"Panda 0.1.2-alpha","timeToRead":1,"description":"","date":"16 August 2020","path":"/news/release-0-1-2-alpha/","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install\nDevelopers: panda-lang.org/guide#installation
\nArchives:
\n\n"}},{"node":{"id":"3","title":"Panda 0.1.1-alpha","timeToRead":1,"description":"","date":"7 July 2020","path":"/news/release-0-1-1-alpha/","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n"}},{"node":{"id":"2","title":"Releases Roadmap","timeToRead":1,"description":"","date":"2 July 2020","path":"/news/releases-roadmap/","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n"}},{"node":{"id":"1","title":"Panda 0.1.0-alpha","timeToRead":1,"description":"","date":"1 July 2020","path":"/news/release-0-1-0-alpha/","content":"We're happy to announce 📢 the first official alpha release of Panda.\nUntil this day we'll distribute user-friendly binaries to provide simple access and preview of development progress.
\nGoals for alpha releases:
\nTo download and install Panda, visit install page.
\n"}},{"node":{"id":"0","title":"Pandasite","timeToRead":1,"description":"","date":"30 June 2020","path":"/news/pandasite/","content":"Finally, after a long time,\nwe're happy to announce and introduce the Pandasite -\na new website for panda-lang organization.\nAs a part of alpha release cycle,\nwe've add some extra sections with interesting content like:
\nNews
- regularly posted set of articles about changes and future updatesGuide
- simple introduction into the Panda world and its featuresIt's also time to say goodby to the old one:
\n\n
So goodby, you served us well 💕
\n"}}]}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"allNewsPost":{"totalCount":5,"edges":[{"node":{"id":"4","title":"Panda 0.1.2-alpha","timeToRead":1,"description":"","date":"16 August 2020","path":"/news/release-0-1-2-alpha/","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\n"}},{"node":{"id":"3","title":"Panda 0.1.1-alpha","timeToRead":1,"description":"","date":"7 July 2020","path":"/news/release-0-1-1-alpha/","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n"}},{"node":{"id":"2","title":"Releases Roadmap","timeToRead":1,"description":"","date":"2 July 2020","path":"/news/releases-roadmap/","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n"}},{"node":{"id":"1","title":"Panda 0.1.0-alpha","timeToRead":1,"description":"","date":"1 July 2020","path":"/news/release-0-1-0-alpha/","content":"We're happy to announce 📢 the first official alpha release of Panda.\nUntil this day we'll distribute user-friendly binaries to provide simple access and preview of development progress.
\nGoals for alpha releases:
\nTo download and install Panda, visit install page.
\n"}},{"node":{"id":"0","title":"Pandasite","timeToRead":1,"description":"","date":"30 June 2020","path":"/news/pandasite/","content":"Finally, after a long time,\nwe're happy to announce and introduce the Pandasite -\na new website for panda-lang organization.\nAs a part of alpha release cycle,\nwe've add some extra sections with interesting content like:
\nNews
- regularly posted set of articles about changes and future updatesGuide
- simple introduction into the Panda world and its featuresIt's also time to say goodby to the old one:
\n\n
So goodby, you served us well 💕
\n"}}]}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/pandasite/index.json b/docs/assets/data/news/pandasite/index.json index 3cbe2087..0e95d3c8 100644 --- a/docs/assets/data/news/pandasite/index.json +++ b/docs/assets/data/news/pandasite/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"0","title":"Pandasite","description":"","content":"Finally, after a long time,\nwe're happy to announce and introduce the Pandasite -\na new website for panda-lang organization.\nAs a part of alpha release cycle,\nwe've add some extra sections with interesting content like:
\nNews
- regularly posted set of articles about changes and future updatesGuide
- simple introduction into the Panda world and its featuresIt's also time to say goodby to the old one:
\n\n
So goodby, you served us well 💕
\n","date":"30 June 2020"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"0","title":"Pandasite","description":"","content":"Finally, after a long time,\nwe're happy to announce and introduce the Pandasite -\na new website for panda-lang organization.\nAs a part of alpha release cycle,\nwe've add some extra sections with interesting content like:
\nNews
- regularly posted set of articles about changes and future updatesGuide
- simple introduction into the Panda world and its featuresIt's also time to say goodby to the old one:
\n\n
So goodby, you served us well 💕
\n","date":"30 June 2020"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/release-0-1-0-alpha/index.json b/docs/assets/data/news/release-0-1-0-alpha/index.json index 060d8765..82f820fe 100644 --- a/docs/assets/data/news/release-0-1-0-alpha/index.json +++ b/docs/assets/data/news/release-0-1-0-alpha/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"1","title":"Panda 0.1.0-alpha","description":"","content":"We're happy to announce 📢 the first official alpha release of Panda.\nUntil this day we'll distribute user-friendly binaries to provide simple access and preview of development progress.
\nGoals for alpha releases:
\nTo download and install Panda, visit install page.
\n","date":"1 July 2020"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"1","title":"Panda 0.1.0-alpha","description":"","content":"We're happy to announce 📢 the first official alpha release of Panda.\nUntil this day we'll distribute user-friendly binaries to provide simple access and preview of development progress.
\nGoals for alpha releases:
\nTo download and install Panda, visit install page.
\n","date":"1 July 2020"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/release-0-1-1-alpha/index.json b/docs/assets/data/news/release-0-1-1-alpha/index.json index e272d737..7cd6fb24 100644 --- a/docs/assets/data/news/release-0-1-1-alpha/index.json +++ b/docs/assets/data/news/release-0-1-1-alpha/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"3","title":"Panda 0.1.1-alpha","description":"","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n","date":"7 July 2020"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"3","title":"Panda 0.1.1-alpha","description":"","content":"Panda 0.1.1-alpha has been released! 🎉
\nshared shouldReturnTrue () -> Bool {\n return true\n}\n
\nshared 'should return true' () -> Bool {\n return true\n}\n
\nString text = `text with ' ' and \" \" :)`\n\n// useful when we want to mix ' and \"\n`\"Two things are infinite: \nthe universe and human stupidity;\nand I'm not sure about the universe.\"`\n
\npublic
visibility to open
open type World { \n open String name = `Earth`\n\n open getName () -> String {\n return this.name\n }\n}\n
\nInterceptorData
and LocalCache
and delegate its functionalities to LocalChannel
CustomPattern
to FunctionalPattern
, improve its performance and add simplified API to the BootstrapInitializer
Installation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\nTo download and install Panda, visit the install page.
\n","date":"7 July 2020"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/release-0-1-2-alpha/index.json b/docs/assets/data/news/release-0-1-2-alpha/index.json index c77a72ba..003f430e 100644 --- a/docs/assets/data/news/release-0-1-2-alpha/index.json +++ b/docs/assets/data/news/release-0-1-2-alpha/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"4","title":"Panda 0.1.2-alpha","description":"","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install\nDevelopers: panda-lang.org/guide#installation
\nArchives:
\n\n","date":"16 August 2020"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"4","title":"Panda 0.1.2-alpha","description":"","content":"Panda 0.1.2-alpha has been released! 🚀
\nChanges in language:
\npanda.hjson
to panda.cdn
.name: panda-with-java-library-dependency\nversion: 1.0.0\nowner: dzikoysk\n\nscripts: {\n main: app.panda\n}\n\ndependencies: [\n maven:org.panda-lang/reposilite@2.8.1\n]\n\nrepositories: [\n https://repo.panda-lang.org/\n]\n
\nChanges in API:
\nDownload:\nInstallation: panda-lang.org/install
\nDevelopers: panda-lang.org/guide#installation
Archives:
\n\n","date":"16 August 2020"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/news/releases-roadmap/index.json b/docs/assets/data/news/releases-roadmap/index.json index 3fe7483e..d4461429 100644 --- a/docs/assets/data/news/releases-roadmap/index.json +++ b/docs/assets/data/news/releases-roadmap/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"2","title":"Releases Roadmap","description":"","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n","date":"2 July 2020"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"2","title":"Releases Roadmap","description":"","content":"It's time to introduce Panda release life cycle.\nThe development process is divided into 4 phases and we will describe them in this article.\nFor the sake of clarity, we've just entered the 2nd phase - alpha.
\nHere is a list of all phases:
\nindev
alpha
beta
stable
We've also prepared an image to visualize it and our plans for them:
\n\n„I can't think of anything more rewarding than being able to express yourself to others through painting”\n
\n","date":"2 July 2020"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/support/index.json b/docs/assets/data/support/index.json index e36a772b..ef4cd5f9 100644 --- a/docs/assets/data/support/index.json +++ b/docs/assets/data/support/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":null,"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":null,"context":{}} \ No newline at end of file diff --git a/docs/assets/data/tag/general/index.json b/docs/assets/data/tag/general/index.json index 74a2573a..1cd0b125 100644 --- a/docs/assets/data/tag/general/index.json +++ b/docs/assets/data/tag/general/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"general"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"general"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/data/tag/releases/index.json b/docs/assets/data/tag/releases/index.json index a19b001e..b395040a 100644 --- a/docs/assets/data/tag/releases/index.json +++ b/docs/assets/data/tag/releases/index.json @@ -1 +1 @@ -{"hash":"160146dc369dbcc2e5a285ecf32f7a1a340fab6d","data":{"post":{"id":"releases"}},"context":{}} \ No newline at end of file +{"hash":"dab88e5155df213f1e3335dfdad89229a16704aa","data":{"post":{"id":"releases"}},"context":{}} \ No newline at end of file diff --git a/docs/assets/js/app.751b0005.js b/docs/assets/js/app.29c1b1aa.js similarity index 99% rename from docs/assets/js/app.751b0005.js rename to docs/assets/js/app.29c1b1aa.js index afdea1d3..110d9dc1 100644 --- a/docs/assets/js/app.751b0005.js +++ b/docs/assets/js/app.29c1b1aa.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var r,o,s=t[0],l=t[1],c=t[2],_=0,u=[];_