• 2012-12-12

    SSDB – A leveldb server with zset data type

    Views: 11026 | No Comments

    The Google leveldb is just a c++ library, cannot be directly used by PHP/Java/Python. As it is a library, data can’t be accessed across multi machines(not even multiprocesses in one machine).

    SSDB(or zdb) is a network server that wrapping leveldb library, more important, besides key-value data type, SSDB supports zset(sorted set) and hash data type. Zset is the most valuable data type that widely used with Redis, to describe business abstracts such as inbox/outbox of a messaging system, posts list of a news site, etc.

    SSDB’s client APIs currently including PHP, Python, Cpy, and more can be added easily.

    Here is a list of SSDB features:

    • Network wrapping of Google leveldb, client-server supports
    • Persistent key-value, key-zset, key-hash storage
    • Very fast(benchmark)

    SSDB project: http://code.google.com/p/zdb/

    Posted by ideawu at 2012-12-12 11:15:58 Tags: ,
  • 2012-11-17

    Cpy is now open source

    Views: 8314 | No Comments

    Cpy provides you a C-like way to write Python programs. And now, Cpy is open source(the ANTLR grammar files).

    Download from here

    Posted by ideawu at 2012-11-17 16:41:23
  • 2012-07-24

    Why Cpy Beats Python

    Views: 8882 | 2 Comments

    A few ignorant Python programmers said that Python never neads a C-like for statement, they thought they can replace every C-like for looping to Python’s for.

    Cpy‘s way to loop:

    for(i=s; i<num; i+=step){
    }
    

    Python’s way to loop:

    for i in range(num)[s:e:step]:
    

    Recently I wrote a looping to loop 100000000, unfortunately (and as expected) Python eat up all memory(2 GB) of the whole machine and OS forces it to quit.

    But a Cpy looping works fine.

    Posted by ideawu at 2012-07-24 12:09:27
  • 2012-07-21

    The Real General Purposed Dynamic C-like Syntax Scripting Language

    Views: 5581 | No Comments

    Cpy is the real general purposed dynamic c-like syntax scripting language in the 21st century, totally built-up by a Chinese software engineer.

    Cpy provides you a way to write Python codes in C syntax!

    Like other C-like programming languages, it borrows the idea of C programming language, and many other C-like programming language, such as Java, JavaScript, PHP.

    It uses the Python programming language’s type model and runtime, but with a very clean and clear and elegant syntax. Since it is built on the Python runtime, all Python’s built-in modules and Python sources can be easily reused with an import.

    Programmer who has the expirence of Java/JavaScript/PHP development will have no difficulty to write his first Cpy codes, the learn cost is zero. It is a good idea for C programmers who never met a scripting language to start writing scripting codes with Cpy.

    Google project: https://code.google.com/p/cpy-scripting-language/

    Posted by ideawu at 2012-07-21 13:25:09
  • 2012-07-19

    Multi-thread programming with Cpy

    Views: 5759 | No Comments

    Multi-thread programming with Cpy is quit easy. Just import the thread module, then use thread.start_new_thread(func, args) to run a function as a thread.

    import time;
    import thread;
    
    function run(){
        while(true){
            printf("thread: %d says hello\n", thread.get_ident());
            time.sleep(1);
        }
    }
    
    
    foreach(range(0, 3) as i){
        args = tuple();
        thread.start_new_thread(run, args);
    }
    
    // press Enter to quit
    stdin.readline();
    

    Output:

    thread: 5032 says hello
    thread: 4708 says hello
    thread: 5676 says hello
    thread: 5032 says hello
    thread: 4708 says hello
    thread: 5032 says hello
    ...
    
    Posted by ideawu at 2012-07-19 11:12:38
|<<<12>>>| 1/2 Pages, 8 Results.