Langage de programmation Karasic

Salut l'ami.


Comme vous le savez, chaque codeur respecté écrit tôt ou tard son propre enregistreur, analyseur json et langage de programmation. Puisque nous avons déjà écrit le premier et le second, nous n'avons d'autre choix que de présenter nos réalisations dans le nouveau langage de programmation innovant karasic.



Le monde, comme vous le savez, ne reste pas immobile. L'évolution des langages de programmation n'est pas terminée. De nouvelles langues apparaissent chaque année, présentent des gènes testent les gens, les transmettent à leurs descendants et meurent, certaines plus tôt, d'autres plus tard. La plupart des innovations dans une nouvelle langue ne sont pas tant de nouveaux développements que l'évolution des idées existantes et la repensée des anciennes méthodes.


Lors de la construction de karasic, nous nous sommes inspirés des deux projets reconnus, tels que la rouille, le python, le c ++, le wolfram et des échantillons expérimentaux, tels que le dcastf, le glink, le blanc et d'autres, pas si autoritaires, mais pas moins inspirés.


Commençons donc à analyser les fonctionnalités que nous vous avons apportées, car c'est la voie.


Syntaxe d'affectation droite


, , , , ( ) .


:


  • 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) fourni par Karasic inc.


Carassin commun





UPD: version anglaise du texte


All Articles