Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The Nash C Programming Language

Name: Anonymous 2021-04-02 22:06

Name: Anonymous 2021-04-03 1:50

What about int &&x;?

Name: Anonymous 2021-04-03 1:50

You should probably make . and -> equivalent

Name: Anonymous 2021-04-03 10:06

>>3
First thing that I did.

Name: Anonymous 2021-04-03 10:20

Name: Anonymous 2021-04-03 14:12

>>4 respond to >>2

Name: Anonymous 2021-04-08 19:09

Name: Anonymous 2021-04-09 11:37

>>7
How does int &&x; work?

Name: Anonymous 2021-04-09 11:55

>>8
Any good reason it should work, instead of giving "error: you're a dolt"?

Name: Anonymous 2021-04-09 17:16

NiGG3r lol

Name: Anonymous 2021-04-09 18:55

Feature request: Make compilation fail on russian-locale machines.

Name: Anonymous 2021-04-09 19:03

>>11

Unfortunately I will be distributing it in the source code form, since most people will likely want to implement their own features. So there is no way I can limit target audience, and Russian are known to pirate software, ignoring the license.

I think USA made the wrong decision by lifting the ban on exporting any computer technologies to Russia. Because if Russians have no computers, they can't run any software, including the one powering their nukes.

Name: Anonymous 2021-04-10 2:41

Why should I use Nash C instead of Sepples?

Name: Anonymous 2021-04-10 8:38

Why should you use Nash C instead of ohrrpgce for creating games?
https://rpg.hamsterrepublic.com/ohrrpgce/Main_Page

Name: Anonymous 2021-04-10 10:46

>>14
because hamsters are too heterosexual

Name: Anonymous 2021-04-10 10:54

>>13
Nash C follows the original C's KISS principle and is fully compatible with C99. For example, templates are implemented through the improvement to the C macroprocessor, instead of bringing up additional turing complete language with broken semantics. Also, you can't compile the existing C99 code with C++ compiler, but you can Nash C: it is just as simple as modifying the Makefile to preprocess the file with NCC.

Name: Anonymous 2021-04-10 10:56

>>16
Nash C is also binary compatible with C99 and allows stuff like maintaining metadata to expose all the internals to another language (in my case Symta).

Name: Anonymous 2021-04-10 15:33

New feature - rewriting the symbols during the AST traversal:
#macro(a) name_@{typeof a}();
...
macro(x);


would call `name_int` if `x` has type int, or `name_int_ptr`.

not exactly C++/Java generics, result is rather similar, while the implementation is completely exposed to the user.

AFAIK, C99 doesn't use the @ character, so it can be used freely. The `$` is a bit more tricky, since both assemblers and C++ use it for different purposes, therefore it have to be passed to the C99 compiler unchanged, as part a symbol.

Name: Anonymous 2021-04-10 17:33

where's the full spec and the steering committee?

Name: Anonymous 2021-04-10 18:07

>>19
$ pwd
/Users/macbook/Documents/git/symta/ncc/src
$ ls -la
total 1184
drwxr-xr-x 30 macbook staff 960 Apr 10 20:54 .
drwxr-xr-x 13 macbook staff 416 Apr 10 19:15 ..
-rw-r--r--@ 1 macbook staff 8196 Apr 6 22:54 .DS_Store
drwxr-xr-x 8 macbook staff 256 Sep 19 2020 cgrammar
-rw-r--r--@ 1 macbook staff 1520 Apr 1 01:23 cnode.c
-rw-r--r--@ 1 macbook staff 1021 Apr 9 20:15 cnode.h
-rw-r--r--@ 1 macbook staff 670 Apr 8 18:55 cnode_ids.h
-rw-r--r--@ 1 macbook staff 300 Apr 1 01:19 common.h
-rw-r--r--@ 1 macbook staff 74861 Apr 10 21:26 lexer.c
-rw-r--r--@ 1 macbook staff 114 Apr 2 00:35 lexer.h
-rw-rw-rw-@ 1 macbook staff 7346 Apr 7 18:12 lexer.l
-rw-r--r--@ 1 macbook staff 2552 Apr 8 14:14 main.c
-rw-r--r--@ 1 macbook staff 1469 Apr 2 19:56 ncu_file.h
-rw-r--r--@ 1 macbook staff 597 Apr 2 19:25 ncu_opts.h
-rw-r--r--@ 1 macbook staff 179 Apr 2 00:35 parse.h
-rw-r--r--@ 1 macbook staff 143752 Apr 10 21:26 parser.c
-rw-r--r--@ 1 macbook staff 5462 Apr 10 21:26 parser.h
-rw-rw-rw-@ 1 macbook staff 24466 Apr 8 19:03 parser.y
-rw-r--r--@ 1 macbook staff 11575 Apr 10 20:54 patch.c
-rw-r--r--@ 1 macbook staff 881 Apr 9 20:17 patch.h
-rw-r--r--@ 1 macbook staff 24941 Apr 9 23:29 patchgen.c
-rw-r--r--@ 1 macbook staff 107 Apr 7 20:56 patchgen.h
-rw-r--r--@ 1 macbook staff 50 Mar 31 23:32 stb_ds.c
-rwxr-xr-x@ 1 macbook staff 68469 Mar 26 00:37 stb_ds.h
-rw-r--r--@ 1 macbook staff 3937 Apr 8 19:03 sym.c
-rw-r--r--@ 1 macbook staff 1225 Apr 8 01:48 sym.h
-rw-r--r--@ 1 macbook staff 1490 Apr 1 01:17 util.c
-rw-r--r--@ 1 macbook staff 299 Apr 2 00:38 util.h
-rw-r--r--@ 1 macbook staff 44786 Mar 11 13:12 wc.c
-rw-r--r--@ 1 macbook staff 956 Apr 1 01:23 wc.l
$

Name: Anonymous 2021-04-10 20:07

>>20
How do I ssh into your machine?

Name: Anonymous 2021-04-10 22:48

>>21
Why should a machine have an SSH access?

Name: Anonymous 2021-04-11 6:40

>>22
Are you being deliberately obtuse?

Name: Anonymous 2021-04-11 10:16

>>18
difference between macro and define?
will you share source?

Name: Anonymous 2021-04-11 11:50

>>24
>difference between macro and define?

`macro` is the name of the macro being defined. #define is the preprocessor directive. `#` defines a macro name. I found it bit cumbersome to write `#define x 123`, so I prefer writing "#x 123". That is my personal macroprocessor NCM, it also allows some more advanced stuff, like gensyms and scoped macros.

Name: Anonymous 2021-04-11 13:38

>>25
will you share source?
what happens if you do int &&x;

Name: Anonymous 2021-04-11 14:43

>>26

>will you share source?
I don't share anything. That is an internal project, part of Symta runtime and my voxel editor implementation.


>what happens if you do int &&x;
Error.

Name: Anonymous 2021-04-11 18:30

>>27
Why do you poast code here if you don't share it, microsoft-man?

Name: Anonymous 2021-04-11 19:28

>>28
I thought is just a chat to discuss programming and pedos, like Stallman.

Name: Anonymous 2021-04-11 20:03

https://dis.tinychan.net/read/prog/1582047203#reply_328
https://www.nbcnews.com/politics/politics-news/end-child-marriage-u-s-you-might-be-surprised-who-n1050471 ✞🐘✞ End child marriage in the U.S.? You might be surprised at who's opposed ✞🐘✞ Sept. 8, 2019 ✞🐘✞ Conservatives have found some surprising allies as they fight efforts to raise the marriage age. ✞🐘✞ A bill that would have ended child marriage in Idaho β€” which has no minimum age for couples who want to wed β€” died in the Statehouse this year. Republican lawmakers, who control the Legislature, opposed it, including state Rep. Bryan Zollinger, who said it "went too far." ✞🐘✞

Name: Anonymous 2021-04-11 20:04

https://dis.tinychan.net/read/prog/1596796049
I can take any political views, even contradictory, when it suits me. I.e. if Trump pays me a million USD to promote racism, I will be promoting racism, and if Hilary pays me million USD to speak against racism, I will be speaking against racism.
For now I just hope that Americans will start killing each other in a civil war, so America will become less full and I could immigrate there. America actually needs a bloodshed.
I.e. today I support both sides of the conflict, cheering for every American death.
My argument is: pay me money and I will follow the party line. Otherwise I will be false flagging from the both sides, writing nasty things. Nostrovia!
So I'm not right wing, I'm not left wing. I just hate Americans.
But no one gives any credence to someone with fluid and contradictory stances, so your false-flagging won't be anywhere near as efficient as it might be if you had credibility. That means that you are destroying the efficiency of your chosen tool, regardless of whether that tool choice makes any sense to begin with.
Not everyone is as smart as you. We are talking about the complete drooling American right wingers. These creatures have less intelligence than a retarded hamster. So why bothering puting in any effort, if most alt-rights get triggered?

Name: Anonymous 2021-04-11 20:26

>>30
The bill went too far, to be honest.

Name: Anonymous 2021-04-12 6:37

>>29
like Stallman.
Bad rold model.

Name: Anonymous 2021-04-12 12:57

Like in C++, destructor (dtor method) is called on variables when they leave
scope. There is one exception. If the class has no copy constructor defined,
then its dtor wont be called before return, and the object will
be copied as is (byte-by-byte):
CLst foo() {
CLst xs;
return xs; //if CLst has CLst.ctor_CLst method, it will be called
//to make a copy, and the original object will get dtor'ed.
//otherwise no dtor/ctor will be called, and xs itself
//will be returned
}

rationale: it is more intuitive and useful default behavior.

Name: Anonymous 2021-04-12 14:16

Bit-level access to numbers please

Name: Anonymous 2021-04-12 14:44

>>35
C++ won't let you access int a=60343;a[1] //(1st bit)
It has to be enum/class/struct.

Name: Anonymous 2021-04-12 15:20

>>35
Just redefine [] for something like num[bit]

int int."[]"(int bit) {
return ((*this)>>bit)&1;
}

int main() {
int x = 123;
if (x[0]) printf("%d is odd\n", x);
else printf("%d is even\n", x);
return 0;
}


Bit set would require defining `int int."[]="(int bit, int value)`

That is compared to C++, where operator[] leaks abstraction by returning a reference or some crazy wrapper. Because Straustrup is a schizo.

Name: Anonymous 2021-04-12 16:23

>>37
Here is it in action
$ cat ../example/bitarr.c
#include <stdio.h>
#include <stdint.h>

int int."[]"(int bit) {
return ((*this)>>bit)&1;
}

int &int."[]="(int bit, int val) {
uint32_t sb = (uint32_t)1<<bit;
*this = ((uint32_t)*this & ~(uint32_t)1<<bit) | ((uint32_t)val << bit);
return this;
}


int main() {
int x = 123;
if (x[0]) printf("%d is odd\n", x);
else printf("%d is even\n", x);

x[0] = 0;

if (x[0]) printf("%d is odd\n", x);
else printf("%d is even\n", x);

return 0;
}
$ ./ncc ../example/bitarr.c bitarr.nc.c
$ cat ./bitarr.nc.c
#line 1 "../example/bitarr.c"
#include <stdio.h>
#include <stdint.h>

int int_m__get_(int *this,int bit) ;static int int_mp__get_(int this,int bit) {return int_m__get_(&this,bit);}int int_m__get_(int *this,int bit) {
return ((*this)>>bit)&1;
}

int *int_m__get__set_(int *this,int bit, int val) ;static int *int_mp__get__set_(int this,int bit, int val) {return int_m__get__set_(&this,bit,val);}int *int_m__get__set_(int *this,int bit, int val) {
uint32_t sb = (uint32_t)1<<bit;
*this = ((uint32_t)*this & ~(uint32_t)1<<bit) | ((uint32_t)val << bit);
return this;
}


int main() {
int x = 123;
if (int_m__get_(&x,0)) printf("%d is odd\n", x);
else printf("%d is even\n", x);

int_m__get__set_(&(x),0,0);

if (int_m__get_(&x,0)) printf("%d is odd\n", x);
else printf("%d is even\n", x);

return 0;
}
$ cc bitarr.nc.c -o ./bitarr && ./bitarr
123 is odd
122 is even

Name: Anonymous 2021-04-13 8:35

https://www.youtube.com/watch?v=JxI3Eu5DPwE

The guy basically explains what modern language should look like and why C++ is garbage.

Name: cristopher 2021-04-13 14:22

πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚πŸ†πŸ†πŸ†πŸ†πŸ†πŸ₯šπŸ₯šπŸ₯šπŸ†πŸ₯šπŸ™πŸ™πŸ™πŸ™πŸ™πŸ¦ΆπŸ¦ΆπŸ¦ΆπŸ¦ΆπŸ¦ΆπŸ¦Ά

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List