ChubakPDP11

joined 9 months ago
[–] [email protected] 1 points 6 months ago (2 children)

First off, I apologize if I did not add a disclaimer saying I could be wrong. But given this, what is exactly the difference between denotaional and operational semantics? I base what I said on [my understanding of books about language theory. But it seems like I got the wrong gist. Where do you recommend I start?

PS: I'll add a void to the post rn.

[–] [email protected] 0 points 6 months ago

First, tell me what you mean by 'closure'. I did not mean 'closure' as an operational function literal. Keep that in mind.

[–] [email protected] 1 points 6 months ago

If you use JVM 8 yes. Use Zero.

[–] [email protected] 0 points 6 months ago

I think forks of it are being developed. I found a fork under active development, but I can't seem to find it.

[–] [email protected] 2 points 6 months ago (2 children)

I know about all this


I actually began implementing my own JVM language a few days ago. I know Android uses Dalvik btw. But I guess a lot of people can use this info; infodump is always good. I do that.

btw I actually have messed around with libgcc-jit and I think at least on x86, it makes zero difference. I once did a test:

-- Find /e/ with MAWK -> 0.9s -- Find /e/ with JAWK -> 50s.

No shit! It's seriously slow.

Now compare this with go-awk: 19s.

Go has reference counting and heap etc, basically a 'compiled VM'. I think if you want fast code, ditch runtime.

[–] [email protected] 1 points 6 months ago

I was mainly asking if this was even the case. If i go to the maintainers and say shit like this they b& me.

[–] [email protected] 1 points 6 months ago

1- Not sure, I can't read; 2- Yes, Fish; 3- Yes, it fixed it.

[–] [email protected] 8 points 6 months ago (10 children)

I think that happens when app developers learn2optimize. Stop using interpreted bytecode languages on small processors!

[–] [email protected] 16 points 6 months ago

My man we have UNIX because PDP-11 was expensive!

[–] [email protected] 0 points 6 months ago (2 children)

I posted my history as a response to @Technus. I know about --no-install-recommends but that's an apt(1) switch. How can I do that with dpkg(1)? Check my history, I've been building more than I have been installing lately. Like, for a long time I have been looking for a 'useful' language to make, and then I remembered that there's a swath of programmers in my country who are addicted to Delphi, and Nkki W. has not pushed to Pascal upstream since 1974. So I decided to host a Pascal on JVM. I made ANTLR. But then, it kept complaining that some targets fail, so I had to remove them from pom.xml. I myself am new to Java toolchain tbqh. I think one language that most people build from source is NodeJS. NodejS toolchain is not as good as say, Ruby's or Guile's, but it's good enough and easy to use.

Thanks.

[–] [email protected] -2 points 6 months ago* (last edited 6 months ago) (4 children)

Podman, gotcha. I am freaking tired of these Docker-esque companies. They use their status as a FOSS application to grift people. As if it's really 'hard' to do what Docker does! It's just mixing a namespaces(7) with cgroups(7), some other stuff too, like seccomp(7). Hashicorp is one of these companies, I think you know, it went entirely closed-source a few months ago. But truly, what is so 'complex' about a secure hashtable database? GNU has one! You can use libcrypto + libtokyocabinet to make one in matter of hours. I think the issue is, most sysadmins, especially old ones, are either clueless about systems programming, or if they are, they are just too lazy to roll their own. I'm not saying 'roll your own', I'm saying, you don't necessarily need super-stable software. Companies like Hashicorp and Docker find giant customers with rich pockets, e.g. AWS, either that, or some degenerate Black-Rock-esque corporate buys them out and you know, I don't wanna prescribe anything to Americans because I don't wanna be the pot calling the kettle black, but damn, imprison those damn investment bankers! They don't understand that closed source doesn't necessarily mean 'more moola'. What it means is more obscurity, more trouble finding bugs, etc. The closed-source software died fucking ages ago. Even Micrsoft open-sourced DOS, most likely they will start open-sourcing 9x and then NT, or at least, release Windows' specs; pretty soon. Say whatever about micropeni$ but they produce more FOSS these days than closed-source software! E.g. VSCode, Terminal, TypeScript, etc (I don't use any of them, but I appreciate the gesture!).

Sorry for the rant.

[–] [email protected] 1 points 6 months ago (2 children)

I posted my uname -a, it's Pop_OS!, Debian-based but not Debian. My kernel is the latest version, I just did a fresh install and did a dist-upgrade (uname -r says 6.8.0-76060800daily20240311-generic).

Here's my entire command history since I installed this one a few days back (I got nuthing to hide!)

https://pastebin.com/biThVQME

So if you guys really think there's something fishy here, please do something!

 

So we have all these control characters in ASCII and besides newline, horizontal tab and carriage return (on Windows) the only use for them is on terminal emulators (which I am making one!) Also as an extension, us NeoVim/Vim users have extensive use for them.

But all these control characters are 0-31, for example, newline is 10, horizontal tab is 9, carriage return is 13, etc. But DEL is aaaalll at the bottom, the last one, 127!

Here's my theory. So, DEL is supposed to delete one row of text, it's backspace that is supposed to just delete one character (I think backspace is 31?). So since 127 is literally 7 1s, marking it on a punch-card 'by mistake' would be kinda hard right? So you want have delete ruin your batch. It's kinda like a built-in 'Are you sure you want to delete this row of punch-card?'

Now I could be wrong. Opinions?

PS: If this is so, this kind of 'physical sentinels' is nothing new. According to Alan Kay, the earliest linked lists were not data structures, THEY WERE 1-TONN MAGNETIC DISKS! So basically, you had the address, and by 'address' I mean the physical address, a real location on planet earth, of the next magnetic disk stored on a fixed location on the previous magnetic disk. Fun huh?

 

Problem is it can't find mkdev.h:

cpio.c:101:10: fatal error: sys/mkdev.h: No such file or directory
  101 | #include <sys/mkdev.h>
      |          ^~~~~~~~~~~~~

Now a UNIX system, especially both POSIX and SuS is impossible without mkdev.h


at least a shitty wrapper. And when I googled mkdev.h to see the specifics the first result was an LXR.

WHY DO MY SYSTEM HEADERS DON'T HAVE A BASIC UNIX HEADER FILE THAT LOONIX HAS? (OR HAD)

Problem is I really wanna make Heirloom. I whole-heatedly disagree with GPL because RMS drinks children's blood. I refuse to use free software and in fact I use Pop_OS! which has more binary blobs in it than a 80s musical composer for Disney movies has had dicks in him. Heirloom is based on Solaris' utilities and they are unfree as my semen is to super modles. I WANT THIS.

joking aside, what is going on here?

ls  -R  /usr/include/ | grep mkdev

Exits with 1. Nothing.

So I guess this is a Pop_OS! thing? Should I install some package to get this header?

Or was it removed from 6.8?

uname -r
=> 6.8.0-76060800daily20240311-generic

Thanks.

 

I began programming when I was 16 and like most people my age (31) it was with some gaming-related DSL. Personally for me it was GML. I made a tetris game which my younger brother played to death but ever since the closest interest I have to vidya is Ncurses and X11. Which makes me think, why is there not such standard for vidya?

So hear me out. We need to make common runtime VM for vidya. Standardized. And it will sport a post-fix language like PostScript. You can learn more about PostScript here.

PostScript is the predecessor of pedophile language, like cat a PDF file and you'll see. Except pedophile language allows of binary blobs. PS does not. There's a lot of differences.

Pedophile and PS are 'page description languages'. Another PDL is ROFF, what UNIX manpages are written with. Launch loonix via WSL2 (I know none of you game devs run loonix natively! You won't be able to work!) and bring up a manpage like man awk. ROFF was why UNIX was written!

So I say, let's make a 'vidya description language', you could just use PS itself with addition of:

  • Input
  • 3D shapes

And Bob's your uncle (am I using this phrase correctly?). PS is a Turing-complete language, it has control structures and you can make a 'game play loop' with it (basically a non-halting decidable TM).

So this language will execute on a runtime VM, a stack VM of course, and this VM is common across several hosts. Just like Java's VM. In fact, Java's VM is already a 'common runtime vm' for vidya right? This time we'll have something more specific.

So this VM will execute the same VDL (Vidya Description Language) code the same across different hosts. Linux, Windows, MacOS, Haiku, Solaris, MacOS, Plan 9, BeOS, BSD, iOS, Android, FireOS, etc. Also it could target various APIs e.g. Meta, Vulkan, OpenGL etc.

I know Unity already has such runtime. But VDL and VdlVM will be more of an 'standard'. In fact, we would develop the 'standard'/specficiation first, then we'll develop the software. We would make one implementation, but someone else could make another implementation, both compliant and compatible! And our implementation of VDL and VdlVM would be FLOSS, released under GPLv3


but Johnny Schlomo can make a super duper closed-source implementation!

So you may look at PostScript and say, damn man, I can't code in this language! Well my good man it's not meant to be coded in directly. That's what I mean by 'assembly of vidya'. It's a language other engines and runtimes target. This is called a 'terese' syntax. The aim of a terse syntax is to have non-binary ASCII text as a portable way to move your code around. In fact, VdlVM does not need Vdl to function. VdlVM reads from binary cishet files, not directly from Vdl files.

Thoughts/critiques/appendages? Would really like to know what you think of this idea. I would implement thi,s, but as I said, it's an standard. An standard needs a community. An standard needs a publicity. An standard needs design. This is not a one-man job. If you would like to develop this standard with me, let me know (chubakbidpaa [at] riseup [dot] net). We can make a mailing list (Discord is for babies!).

Thanks.

 

About a few days ago I posted this, asking for help to implement the parser. It seems like I boomer'd and I forgot to set the Gist to public. This is public (hopefully!). Someone did gave me a link, but I kinda could not 'parse' it (get it? get it?). I still would appreciate it if you would give me guidance in parsing with Scheme, and not just tokenizing. I am using my experience from this to write a documentation language + macro preprocessor in Scheme called 'Makroon'. I will use your help in giving me tips for parsing to parse that, and also, more complex projects like my C compiler in Ocaml (Cephyr). Like I re-began this project soooo many times!

Enjoy.

 

With some help from the LLM that shall be unnamed, I created a full dossier on PostScript. You can build it to the original Markdown, or convert it to HTML, Latex, PDF, etc.

I will guarantee that you will at least learn 'a bit' about PostScript with this dossier.

Mind you, PostScript is meant to be compiled to, it's not a high-level language. As I say in the overview, it's a 'visual assembly'!

Some people may not know what PostScript is


well, this is understandable since PostScript's hayday is long since overdue, we got PDF now. PDF is kinda like a superset of PostScript though.

I am trying to make my own PostScript interpreter. I named it Nock. But first I need to see what I can do with it. There's enough PS toolchain around. I was working on an EBNF to PostScript translator in Scheme. But I realized I really dunnno not much about it so I spun this up to learn.

You may remember my PostScript manpages from... yesterday was it? Anyways those suck. Don't use them. Use these. You can even use Pandoc to make manpages from these:

cat _ps-dossier.md | pandoc -fmarkdown -tman | groff -man -Tascii | most
# need to install most, you can use less or more to page

Thanks.

 

These toolchain are created for experts to create industrial-level compilers. Even if you think you got a syntactic design concept that is such hot shit that you can't wait to get it bootstrapped, even if hell, it proves Rice's theorem wrong, please, write a simple interpreter for it to prove your syntax works. In fact, I think one way you can test your language's design is to have it mooch off an established VM like JVM, CPython's VM or CLR.

But if you wanna 'learn' compiler design, I beg you to roll your own backend. You don't need SSA or any of that shit. You don't need to super-optimize the output at first try. Just make a tree-rewrite optimizer and that's that.

Same is true with LP generators. From Yacc to ANTLR, they just make the experience harder and less rewarding. I know hand-rolling LP is hard in a language like C, in which case, don't fucking use it lol. There's honestly no inherent worth in using C in 2024 for compiler design.

But there's still use for C in being the subject of your compiler. It's a very simple, straightforward and more importantly, standardized language, you don't need to write a runtime for it, because when it comes to both UNIX and Windows, runtime is OS itself! Just make sure you add a syscall interface and then C runtimes like glibc and CRT can be easily strapped.

I'm going to do exactly this. I named my C compiler 'Cephyr'. I have started over several times now. I am using OCaml.

I know my point about using LP generators is preaching to the choir and most people despise them


but I just don't understand why people love to use IRs/ILs when doing so teaches you shit.

I recommend beginning to design your language with the IR -- your IR.

I don't just wanna focus on Cephyr. There are other stuff I wanna do, like Nock, a PostScript interpreter in Rust (because GhostScript had made me hard-reset 4-5 times. GhostScript is just un-secure, leaky garbage).

Anyways tell me what you think about my 'take' on this. Of course I am not saying you are 'less knowledgeable' for using LLM or MLIR, I'm just saying, they don't teach you stuff.

Still, some people just use LLVM and MLIR as a final 'portable' interface, having done the optimization on graphs and trees. i think there should be some sort of 'retargatble assembly' language. Like something with fixed number of registers which.. oh wait that's just a VM!

Also you don't need to necessarily translate to a super super low-level language. Just target C. GNU C to be exact. Cyclone does that, in fact, I am planning to bootstrap my functional language, which I named 'Xeph', based on Zephyr ASDL, into GNU C as a test. Or I might use JVM. I dunno. JVM languages are big these days.

PS: Do you guys know any cool VMs I can target beside CPython and JVM? Something with AoT perhaps?

Thanks.

 

I've been trying to learn PostScript so I made this. Took almost a day and a half. I'm still not sure all the pages are up to code. Please report any errors you see.

I know I promised Rust manpages, but with the experience from this, that would be easy. I am very new to this whole programming thing and I did not know much about scripting either (which is embarrassing because I'm 31 -__- ). But I with some help from ChatGPT (it did not generate any scripts because when I do I get confused, I guess it takes a lot of skill to not get confused by the scripts and programs ChatGPT generates) I just used it to ask questions about utilities I could use. For example hxpipe is the utility it recommended and it rally helped. Problem was that these HTML files were too old and rusty. I used tiidy and hxnormalize and hxclean to clean them up then I passed them through hxpipe. Then I parsed the script with Perl etc etc.

Sorry something happened to my displays I think I mistakenly pressed a shortcut key. Anyways if there's any problems lemme know.

Thanks.

 

In the Gist, I have explained my problem, and I have provided my tokenizer as well. If you can help me with the parser, that would be great. Also if my tokenizer is not very well-structured, please tell me.

btw the tokenizer is written in extremely portable Scheme. I think Chez is the best interpreter for Scheme.

4
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/[email protected]
 

Hey guys. I'm looking for some good PostScript templates and routines. I am writing something called 'EBNF Tools' in Scheme. I wrote the tokenizer and I am now writing the parser. From there, I wish to implement tools like:

  • EBNF2PEG
  • EBNF2Yacc
  • EBNF2Lex
  • EBNF2ANTLR
  • EBNF2Happy (fuck Haskell btw, ML for the win)

But I also wish to implement some EBNF typesetting stuff, such as EBNF2PS or EBNF2Latex.

I know libps exists, and I could potentially bind it. But I wanna use super portable Scheme. And FFIs are not portable. Plus it's not really needed. I have made a ChatGPT model that teaches me PostScript. I have learned a lot of operators. The syntax, well you gotta be brainlet to have issues learning its syntax but i digress.

What I need is this: A bunch of functions or code snippets in PS that would draw stuff like arrows, etc. Basically anything that is pre-made. Like macros.

Or something like a drawpad with which I can draw and it will give me a PS file. Does such thing exist?

If you know where I can get them please tell me.

 
 

This girl acts like Wikipedia owners don't realize this shit. It's about principles. Modern web is simply cancer that is eating out the planet from the inside, one TCP segment at a time (although with HTTP3 and QUIC we gotta call it a datagram!).

I realize this is just a fun video, but I got super triggered because I am dead tired of 'Silicon Valley Mindset' and this girl embodies it to the extreme.

 

The URL leads to a pastebin for a Ruby script I have been writing for the past 2-3 days. It's called mk_rustman.rb on my system. They will turn JSON files for Rust docs into UNIX manpages, with Groff ROFF macros for man (groff_man).

The script may be rewritten, or I may change the language. I wish to use:

1- An interpreted language; 2- A dynamically typed language

I will choose a fast language, because the JSON file for Core is very large. Ruby has not been very fast so far, but there's an alternative implementation of Ruby I may try. Another candidate is F#. Does anyone know a dynamic but functional scripting language? Not a giant programing language like OCaml, something small that is functional.

Anyways.

Let me explain the JSON files first.

If you install rust-doc on your system:

sudo apt-get install rust-doc

And:

exa /usr/share/doc/rust/json
or
ls /usr/share/doc/rust/json

You shall see these:

alloc.json.gz  core.json.gz  proc_macro.json.gz  std.json.gz  test.json.gz

All these JSON files have an 'index' object, this 'index' object is made up of sub-objects indexed by their ID:

zcat /usr/share/doc/rust/json/std.json.gz | jq '.index' | head -n 48
{
  "a:1:8659:4267-0:638:4291": {
    "id": "a:1:8659:4267-0:638:4291",
    "crate_id": 0,
    "name": null,
    "span": null,
    "visibility": "default",
    "docs": null,
    "links": {},
    "attrs": [],
    "deprecation": null,
    "inner": {
      "impl": {
        "is_unsafe": false,
        "generics": {
          "params": [],
          "where_predicates": []
        },
        "provided_trait_methods": [],
        "trait": {
          "name": "UnwindSafe",
          "id": "1:8659:4267",
          "args": {
            "angle_bracketed": {
              "args": [],
              "bindings": []
            }
          }
        },
        "for": {
          "resolved_path": {
            "name": "BacktraceFrame",
            "id": "0:638:4291",
            "args": {
              "angle_bracketed": {
                "args": [],
                "bindings": []
              }
            }
          }
        },
        "items": [],
        "negative": false,
        "synthetic": true,
        "blanket_impl": null
      }
    }
  },

This is the first object in the list.

The 'meat' of an object is the 'inner' field. Inner can be one of:

zcat /usr/share/doc/rust/json/std.json.gz | jq '.. | objects | .inner // empty | keys[]' | sort | uniq 

=>

"assoc_const"
"assoc_type"
"constant"
"enum"
"extern_crate"
"function"
"impl"
"import"
"macro"
"module"
"primitive"
"struct"
"struct_field"
"trait"
"type_alias"
"variant"

I have parsers for most of these, but not all .And the parsers are incomplete.

These all have common fields. The most important field is the type. Another one is generics field. These two occur a lot.

I wanna turn this into perhaps, a larger project. I made a ChatGPT model to teach me PostScript. I wanna write a documentation language, similar to POD, and I wanna write several targets for it. Then, the Rust Manpaes could use this language.


I know that there MIGHT be some people who may not be aware of what UNIX manpages are, maybe they use Window, dunno. So I wanna explain manpages, and why I am adamant to convert Rust documentation to them.

Basically, the story is:

MacIlroy, Thompson and Ritchie decided that, instead of sucking the dicks of higher-ups at Bell labs to buy them a shiny PDP-11 to expand their shiny new OS, UNIX, with, they could promise them some sort of 'clerical use' for it. Using computers for clerical use was not very common back then. In fact, it was only a few years after ASCII was introduced. Story goes, 20-25 years prior, Von Neumann himself slaughtered an undergrad student who had dared to write what is today's equivalent of a 'charset encoding' for one of them giant compooters. This was modern times and people were slowly realizing that computers have other uses than launching rockets at the Vietnamese rice field workers. But even a mini-computer was an investment.

So they conceived ROFF, a documentation system which was adapted by the patent office gals. These gals would get their asses slapped, their boobies touched (as was the custom of the time) and write patents on their terminals with ROFF.

Source of this story:

man 7 roff

The same documentation system was used when Bell Labs decided to sell UNIX to people. And today, we have GNU Roff to take its place. There's also the Hoodlum Toolchest or whatever it's called, and BSD's Roff (which happens to be identical to Bedlam or whatever toolchest).

Groff has a man macro package which makes it extremely easy to write manpages with.

Manpages have 'sections', which are numbered. They could also have letters in them. On Linux, the section for utilities like ls and sh and man itself is 1, then syscalls are 2, library is 3 etc:

These two are equivalent:

man ls
man 1 ls

But these two are not:

man getopt
man 3 getopt

Most languages have manpages.

man 3o List # Ocaml List manpage
man 3perl Pod::Usage # Perl Pod::Usage manpage

In both these instances, you can omit '3o' and '3perl'. On Linux, when man gets a conflict, it looks uses the default order ,which the user may set.

Man pages are saved at /usr/share/man and /usr/local/share/man.

You can use apropos to search man pages:

apropos pid

You can view all the pages in a section with:

apropos -s [section] -k .
# line
apropos -s 3o -k .

Why do I want Rust Manpages?

Simply put, manpages are simpler to navigate, at least for me, than a webpge. Convenience is key here.

Some people like to launch Firefox or Chrome or whatever, and search their shit on google. I don't like that. I consider myself an intermediate practicioner of programming. The last time I used Stack Overflow was several months ago. I don't need to see how a function is used to know how to use it. I can just look at the documentation. So I think that is why I find manpages necessary.

I may make them for Go too. And Nim! Python needs them too. Although Python is like 10 years older than Go and Rust (12 yo Rust, 14 yo Go) so there might be manpages for Python.

Tell me what you think? Do you like this? Has someone already done this?

Thanks.

view more: ‹ prev next ›