Git Product home page Git Product logo

learn-nesc's Introduction


/TinyOS_Logo.jpeg

Learning nesC

I am not too experienced with the nesC programming language at the moment. This document will go over my knowledge of the nesC language so far.

This document used version ? of the nesC programming language. The version will be listed with each example.

Comments in nesC

Comments in nesC are similar to languages lika C, C++, C#, Java, JavaScript, Google Go, etc.,

// This is a single line comment
/* This is
a multi-line
comment */

This example works with every version of nesC.

Break keyword in nesC

nesC supports the break keyword:

break

To this day, I am still not entirely sure what the break keyword does, but most languages support it.

Hello World in nesC

A hello world program in nesC is similar to a C hello world program, as nesC intends to be an improved clone of C,

interface hw() {
	printf("Hello World\n");
}

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Interface keyword in nesC

nesC commonly uses the interface keyword. It is similar to using int main and is used like so:

interface nescinterface() {
	printf("Welcome to my nesC program!\n");
	break
}

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Return keyword in nesC

nesC supports the return keyword. It is used like so:

interface returntoSender() {
	printf("Return to Sender\n");
	break
}
return returntoSender();
break;

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Read keyword in nesC

nesC supports the read keyword. I think it is used for reading files, but I am not sure. I feel that is what #include is for.

Here is how I have been using it:

read(main.nc)

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Include keyword in nesC

nesC, like C, supports including header files. It is used like so:

#include <header.h>
#include <header.nc>

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Char keyword in nesC

nesC supports the char keyword for defining characters. Here is how I have been using it:

char("String character");
char("UTF-8");

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

Int keyword in nesC

nesC supports the int keyword for defining integers. Here is how I have been using it:

int y = 10;
printf(y);

This example works with every version of nesC.

/!\ This example has not been tested yet, and may not work

If and else statements in nesC

Like most programming languages, nesC supports if and else statements, and they are used like so:

// If/Else statements in nesC
char s = "x is greater than y";
char t = "y is greater than x";
int x = 7;
int y = 10;
if x > y
	return s()
else
	return t()

This example works with every version of Elm.

/!\ This example has not been tested yet, and may not work

Source

The majority of my nesC knowledge comes from self-experimentation, and Wikipedia. Self experimentation didn't go far, and unfortunately the majority of knowledge currently comes from Wikipedia. I wanted to make source code more original, but there isn't any other way I would have written it.

Other knowledge of nesC

  1. nesC is a curly bracket and semicolon language

  2. nesC is a C-like programming language designed for the TinyOS operating system

  3. nesC uses the *.nc file extension

  4. nesC is spelled with all lowercase, except for the last letter. It is not to be spelled in any way other than this, even at the start of a sentence, or in an ALL CAPS RANT.

  5. nesC is a language recognized by GitHub

  6. nesC is an open source programming language.

  7. No other knowledge of nesC at the moment.


File version: 1 (2022, Tuesday, April 19th at 3:25 pm PST)


learn-nesc's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

seanwallawalla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.