Tuesday, May 31, 2016

Strace experiments on Python

I was watching the video on 'Type  Python ,Press enter. What happens'. I thought of checking whether 'strace' can get the fork() system call that he explained in the video.

Unfortunately I couldn't get ....



But i came to know about the write and read system calls when we type the arithmetic operatons on python ... strace log pasted below. Still I dont know where the calculation is happening.... is there any tool to list which part is calculating it ? where is the fork() ?? brk(0x19ed000) = 0x19ed000 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 write(2, ">>> ", 4) = 4 read(0, "1+2\n", 1024) = 4 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 6), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0206e7b000 write(1, "3\n", 2) = 2 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 write(2, ">>> ", 4) = 4 read(0, "1+4\n", 1024) = 4 write(1, "5\n", 2) = 2 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 write(2, ">>> ", 4) = 4 read(0,

Hackers school

This is something programming students can try to collaborate with self motivated programmers.

https://www.recurse.com/blog/77-hacker-school-is-now-the-recurse-center

Monday, May 30, 2016

How to start with RUST LANG in linux machine

I am started hearing about RUST programming language http://doc.rust-lang.org/book/README.html, so thought of give a try 'helloworld' program. The impressive thing is,the language focus on safety,speed and concurrency.

Rust is a systems programming language focused on three goals: safety, speed, and concurrency. It maintains these goals without having a garbage collector, making it a useful language for a number of use cases other languages aren’t good at: embedding in other languages, programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems

There is very good documentation - http://doc.rust-lang.org

Below is the installation steps, helloworld program . I gave a 'Strace' on the program to see any difference.I couldn't understand any difference :-).. i dont know how to find the difference in speed or concurrency.. need to read more ...