Karasic programming language

Hello Friend.


As you know, every respected coder sooner or later writes his own logger, json parser and programming language. Since we already wrote the first and second, we have no choice but to present our achievements in the new innovative programming language karasic.



The world, as you know, does not stand still. The evolution of programming languages ​​is not complete. New languages ​​appear every year, feature genes test on people, pass them on to their descendants and die off, some earlier, some later. Most of the innovations in any new language are not so much new developments as the evolution of existing ideas and the rethinking of old methods.


When constructing karasic, we were inspired by both recognized projects, such as rust, python, c ++, wolfram and experimental samples, such as dcastf, glink, whitespace and others, not so authoritative, but no less inspired.


So, let's begin to analyze the features that we brought to you, for this is the way.


Right Assignment Syntax


, , , , ( ) .


:


  • mov, .
  • , strcpy, memmove, .

, :


  • cp, ln.
  • std::copy .

, , , , , , ...


, . . , . - , .


karasic :


42 => answer
foo(42) => answer

, . , .


: - -:



, :


42 => answer = 42

,


, , , , , . karasic , .


<typing:dynamic> //    

fn foo(a,b) //   
{
    a + b => c
    return c
}

fn bar(a:i32,b) //       
{   
    a + b => c
    return c
}

[typing:static] //     
fn fubar(a:i32,b:i32) -> i32 //   
{
    a + b => c : i32
    return c

    //    :
    // a + b => return
    // a + b
}

, - , , ( jit ). , . ( , ).


karasic . , . , , , , , , :




karasic , , , whitespace. , go, , , , , .


karasic !


    a + foo(b) => c // 
    a + foo(b) => c // 

, . . ,


try {
    foo();
}
catch (...) {}

, . . , . -- .



, ( ), karasic .


, try-catch


try {
    throw Exception(42);
} catch ex {
    print(ex.value)
    exit(0)
}

, result-


fn foo() -> result(i32) 
{
    return Exception(42)
}

karasic , , tryso, , , stack_overflow.


tryso {
    throw Exception(42)
}

tryso_explicit, , stack_overflow, .


tryso_explicit {
    throw Exception(42)
}

force_retry, , .


force_retry {
    throw Exception(42)
}


smart_try, , .


smart_try {
    throw casdcasd sdfsadf Exception(42) //     .
}

, shallow_throw(N), N .


shallow_throw(n) Exception(42)

, , - .



. , karasic, , , , - . , karasic O(1). karasic ( ) , , karasic .



, karasic , . , , karasic , . karasic , , .



, . , . .


karasic.



, , , . , , gpu.


, .


, , .


.


, karasic , -, lua, python . karasic .


python:


import python3:numpy as np

fn main() 
{
    np.arange([42,41,40]) => arr
    np.log10(arr)
}

:


import clang:string.h as cstring
import clang:stdlib.h as cstdlib

fn main() 
{
    raw_buffer(cstdlib.malloc(40),40) => buf0
    cstring.strcpy(buf0, "HelloWorld")

    println(buf0) // HelloWorld
}

, , , . , , , , , , .




karasic ,


RFC1149


import rfc1149

fn main() 
{
    rfc1149.datagramm("HelloFriend") => dgramm
    rfc1149.send_bird("-  .12.  ,   ,  17  20.00", dgramm)
}

RFC2795


import rfc2795

fn main() 
{
    rfc2795.monkey("Jonh") => jonh
    rfc2795.monkey("George") => george
    rfc2795.monkey("Stephen") => stephen

    rfc2795.monkey_group([jonh, george]) => jonh_and_george

    "" => sonnet    
    do  
    {
        jonh_and_george.make_sonnet(66) => sonnet
    } while(stephen.do_critic(sonnet) is false)

    println(sonnet)

    /*

    Tired with all these, for restful death I cry,
    As, to behold desert a beggar born,
    And needy nothing trimm'd in jollity,
    And purest faith unhappily forsworn,
    And guilded honour shamefully misplaced,
    And maiden virtue rudely strumpeted,
    And right perfection wrongfully disgraced,
    And strength by limping sway disabled,
    And art made tongue-tied by authority,
    And folly doctor-like controlling skill,
    And simple truth miscall'd simplicity,
    And captive good attending captain ill:

    Tired with all these, from these would I be gone,
    Save that, to die, I leave my love alone. 

    */
}

.



, , . IT . karasic , , , , karasic , . , karasic, Junior Karasic Developer, Middle Karasic Developer, , Senior Karasic Developer.


karasic . , !


, .



(c) provided by Karasic inc.


Common crucian





UPD: English version of the text


All Articles