SICP: What is meant by “data”?

Tekkie

I want to discuss what’s introduced in Section 2.1.3 of SICP, because I think it’s a really important concept.

When we think of data in typical CS and IT settings, we think of strings and numbers, tables, column names (or a reference from an ordinal value), XML, etc. We think of things like “Item #63A955F006-006”, “Customer name: Barbara Owens”, “Invoice total: $2,336.00”.

How do we access that data? We typically use SQL, either directly or through stored procedures, using relations to serialize/deserialize data to/from a persistence engine that uses indexing (an RDBMS). This returns an organized series of strings and numbers, which are then typically organized into objects for a time by the programmer, or a framework. And then data is input into them, and/or extracted from them to display. We send data over a network, or put it into the persistence engine. Data goes back and forth between containers…

View original post 2,498 剩余字数

Pointers in Java

Java Deep

Are there pointers in Java? The short answer is “no, there are none” and this seems to be obvious for many developers. But why is it not that obvious for others?

That is because the references that Java uses to access objects are very similar to pointers. If you have experience with C programming before Java it may be easier to think about the values that are stored in the variables as pointers that point to some memory locations holding the objects. And it is more or less ok. More less than more but that is what we will look at now.

Difference between reference and pointer

As Brian Agnewsummarized on stackoverflow there are two major differences.

  1. There is no pointer arithmetic
  2. References do not “point” to a memory location

Missing pointer arithmetic

When you have an array of a struct in C the memory allocated…

View original post 1,179 剩余字数

How I Learned Linux

Let's Go Larval

[Update: A bunch of you are here because Eric S. Raymond is awesome and nice. Thanks, ESR!]

And, by extension, how you can.

I’ll start this off with a disclaimer. I am not a Linux expert by any means–in fact, I’m not even fluent, and don’t use it as my main operating system. However, if I sit down in front of a Linux computer to do some work, I’m perfectly comfortable with using it. I can use the command line comfortably, I know what repositories are for and not to download just whatever interesting-looking tarball off the Internet (unless I’m doing so to tinker with it), I can do a tiny bit of shell scripting, and I can even compile or interpret my own programs (written in less annoying languages) via the command line.

Most people are not there. It took me a long time to get there; I remember…

View original post 1,643 剩余字数

PySonar: a type inferencer and indexer for Python

Surely I Am Joking

pysonar2

PySonar is a type inferencer and indexer for Python. It includes a powerful type system and a sophisticated inter-procedural analysis. Compared to style-checking tools or IDEs, PySonar analyzes programs in deeper ways and produces more accurate results. PySonar resolves more names than typical IDEs. The current resolution rate is about 97% for Python’s standard library.

Demos

To get a quick feel about what PySonar can do, here is a sample analysis result for a small fraction of Python’s standard library.

What’s in there

  1. A powerful type system. In addition to the usual types you can find in programming languages, PySonar’s type system has union types and intersection types — two of the most powerful elements I have found during my PL research. They are rarely found in programming languages. I know of only two languages with statically checked union types: Typed Racket and Ceylon. Different from these languages, PySonar can work without any…

View original post 299 剩余字数

Overview of Modern Concurrency and Parallelism Concepts

good summary about those confusing concepts

Nikolay Grozev

Introduction

Most software engineers know about operating system (OS) level processes and threads. They are taught in all university OS courses. However, newer concepts promising higher throughput, less overhead, latency, and development efforts have emerged.

I was perplexed as I couldn’t find a succinct and systematic description and comparison. This is precisely the goal of this article – to summarise, exemplify and compare terms like green threads, fibres, goroutine, actors etc.

This article aims to give a general overview of these concepts and is not exhaustive. There is still some terminological ambiguity with respect to some of the terms. For this article I have mostly followed the respective Wikipedia pages.

Concurrency vs. Parallelism

Let’s start by clarifying two important concepts – concurrency and parallelism. Until recently I considered them synonymous and there is still some ambiguity in the community about what they mean.

According to Rob Pike’s talk, concurrency…

View original post 3,501 剩余字数