What was your original internship project timeline?

  • It takes about 2 to 3 weeks to become acquainted with the code base.
  • 2 weeks for adding more complicated tests, writing small examples, and improving the code.
  • 4–6 weeks for the core work, which will be to provide an interface for TopoJSON.
  • About 2 weeks to write some tests for the produced library, as well as fuzz-tests if time allows.

What goals have you met?
I have met the first two goals. I am currently working on the third and main goal of my project. And I can say that I am still on schedule.


What have you accomplished in the first half of your internship?

I have gotten more comfortable working with OCaml, I was able to solve about 3 pending issues on GitHub with the help of my mentor. And more importantly, I have a deeper understanding of my project.


What project goals took longer than expected?
It was the second goal. I doubt I would have been able to do it within that timeline without the help of my mentor.


Why did those project goals take longer than expected?

The issues and tests came from different angles that required deep brainstorming, understanding, and a better understanding of OCaml language. 


What would you do differently if you were starting the project over?
I would learn the basic syntax and ways of OCaml better. It would really help when you get to the more complex part.


Which original goals needed to be modified?
For now, I think the original goals are still very valid. I'm on schedule.


What is your new plan for the second half of the internship?
I plan to continue being on schedule, asking more questions, and getting the project done.

TopoJSON is an extension of GeoJSON that encode topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. TopoJSON eliminates redundancy by efficiently storing related geometries in the same file [1]. Typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms [2].

I am interning with the OCaml community on the project "Implement a non-blocking, streaming codec for TopoJSON". It encode and decode Topology Information in JSON text without blocking on IO and without a complete in-memory representation of the data. This allows for more fast and efficient transmission of data as well as minimal memory storage usage hence why this project is important.

Initially, I was all confused on how to approach the project, considering the fact that i was new to both OCaml and geospatial concepts. But I have always had strong interest in them, so this provided me the opportunity to learn. This project has exposed me to several geospatial concepts which i didn't know before now. Some of them include:
  • Transform : The purpose of the transform is to quantize positions for more efficient serialization.
  • Topology: This is the arrangement of how point, line, and polygon features share geometry.
  • Pretty printer: Used for formatting.
  • Alcotest: Exposes a simple interface to perform unit tests
  • TopoJson and GeoJson
  • Modules: OCaml modules allow to package together data structures definitions and functions operating on them. This allow to reduce code size and name confusion.

OCaml is the programming language the community I'm interning with works with. I first got to know about it during the Outreachy contribution phase. At first, it felt very intimidating and difficult, but with the help of my mentor Mr Patrick Ferris, Official OCaml documentation, the OCaml community and this wonderful series i found on YouTube I can say I have a good basic understanding of the language and i am still in the process of learning because i still have a lot to learn.

So far, one thing that has really helped me that i will also recommend to anyone is asking questions. I do not hesitant when I am stuck even the ones that may seem stupid or obvious. Thankfully, there are very supportive people eager to help. While asking technical questions it is important to say:
  • what you are trying to achieve,
  • what you have tried
  • what errors you are getting
  • depending on what the question is, you may also want to include how (the person you're hoping to help) can reproduce the errors
This will make it easier for people to know how to help. So let's talk OCaml!

Ocaml (Objective Categorical Abstract Machine Language) is a functional Programming language. Functional Programming means using functions to the best effect for creating clean and maintainable codes. That is to say that in OCaml,
Functions are first-class: you can use them as input to other functions, and produce functions as output. With my little knowledge about OCaml, I can say that it is a beautiful and interesting language but also challenging especially for a beginner.

For instructions on how to get up and running with OCaml check here alternatively, you can run it in your browser using TryOcaml with no installations required.

OCaml syntax is similar to that of most programming languages except for things like double semi-colon (;;) at the end of an expression instead of one as found in languages like PHP, also commenting is done using (* *) and documentation is done with (** *)

Some basic syntax includes

# let x = 50;; (* the variable x has the value of 50 *)
# let x = 100 in x * x;; (* the variable x has the value of 100 in the expression x * x. *)

This is the same as

# let x = 100;;
# x * x;;


Some Unique Characteristics of OCaml includes
  • It is Open source and free
  • Apart from the regular data types (char, string, float, int) OCaml has tuples and records
Record
A record is a composite of other types of data, each of which is named. Each component is identified by its name.

Tuples
Tuples
are a composite of other types of data. But instead of naming the components, they are identified by position.

For example:


type transform = {scale: (float * float); transform: (int * int)}
let transform_example = {scale= (2.0, 1.5); transform = (0, 0 )}


transform_example is a record of type transform with two components scale and transform.

(2.0, 1.5) and (0, 0) are tuples. It is important to note that members of a tuple does not necessarily has to be of the same type. (1, 2.5, "hello") is also a valid example of a tuple.
To access the value of transform in the above example we can write:

transform_example.transform

To access the second value of the transform, we can do:

let get_transform_member = transform_example.transform;;
let second_value = match get_transform_member with
|(_, y) -> y ;;
second_value;;

  • It uses pattern matching instead of loops in like say JavaScript
  • Recursive functions
To achieve a loop in OCaml we usually combine recursive function with pattern making.

let rec factorial n =
match n with
| 0 | 1 -> 1
| n -> n * factorial (n - 1);;
val factorial : int -> int = <fun>


As the name implies, factorial function given an integers finds the factorial of the given number. If the given number is 0 or 1 it. If it is any other number n it multiplies n with the result of the factorial of n - 1. For example

factorial 4;;


Can be expressed as

4 * factorial(4 -1);
3 * factorial(3 -1);
2 * factorial(2 -1);

and factorial(1) = 1;


This kind of behavior is called "tail recursion". Now to actually solve the task it will be

2 * factorial (1) = 2;
3 * factorial (2) = 3*2 = 6;
4 * factorial (3) = 4*6 = 24;


  • Uses Modules for abstraction and encapsulation
Other helpful resources include
  1. OCaml from the very beginning
  2. Realword OCaml
Thank you for reading.
Prisca’s photo

Hi all,

My name is Prisca Chidimma Maduka. But you can call me Priceless. I am one of the selected outreachy interns. I am interning with Ocaml in the project “ Implement a non-blocking, streaming codec for TopoJSON" I am from Nigeria. I’m interested in everything software development. I like the idea of solving real lives problems with codes. :))

I applied for Outreachy because of my newfound interest in Open Source Software and because I was looking for an opportunity to improve my skills while also making meaningful contributions to real-life projects.
I'd say my three core values are persistence, results, and compassion.
I value persistence because I believe it's one of the core values of every successful person. Let’s face it, life is not a bed of roses. It has never been. Persistence helps us stick to our goal, no matter how hard it gets, and see it to the end.

I value results. You can also call it productivity. Working without results is discouraging to the person doing the work and others as well. Results are not always mind-blowing, they also come as small wins but the most important thing is that you keep going and you aren't stagnant

I value compassion because well, people are important. Everyone’s feelings are valid. I believe in treating people with respect and compassion. It’s always nice to be the reason while others smile.

That’s a little about me. I’m so happy to be on the journey and I’ll make sure I do nothing less than my best.

Thank you for reading. I will be writing about my experiences in this internship from time to time. Talk to you again soon.

Profile

prisca_chidimma

January 2023

S M T W T F S
1234567
89 1011121314
15 161718192021
22232425262728
293031    

Syndicate

RSS Atom

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 19th, 2025 05:46 pm
Powered by Dreamwidth Studios