Idea is that using goto your program can be mostly a loop where you make forward jumps to anywhere in the code & everything converges or jumps back to the start. It ends up making for very terse code since you're no longer passing values back & forth as much through structs/params/returns. You align variables & jump to code. Each label has a kind of ABI where the variables are the registers
Show HN: Gemini web client in 100 lines of C
21–30 of 47 posts
Re: Show HN: Gemini web client in 100 lines of C
#22It's a nice project, but - I guess as is tradition with the majority of C projects - it has resource leaks and buffer overflows. There is at least one resource leak, namely, `sfd` is not closed when certain `WARN()` invocations jump back to the `start` label; for example, when `gethostbyname()` fails (i.e. try a non-existent domain and observe that the sockets remain open with `lsof`). (It also seems to be leaked in…
Not to make any excuses, just for the context. I'm a beginner in C programming and I wrote only few small programs. My tooling is basically non existent. I will try to improve tho.
Re: Show HN: Gemini web client in 100 lines of C
#23Earlier quoted context omitted.
Yea, you are right. Poor choose of words on my side. One can argue the definition of "web" but it would be much more precise to write "CLI client".
There’s nothing to argue. The "World Wide Web" or "Web" is defined as servers and clients communicating using the HTTP protocol. (Usually, it means that content is using HTML but this is not mandatory). "Gemini" is defined as servers and client communicating using the "Gemini" protocol (and content is usually in the gemtext format). Both are part of the Internet, which is defined as an INTERconnection of NETworks, th…
It's basically the Web but instead of HTTP it uses its own protocol over TCP thus still within the Internet protocol suite. Qualifying it as the "Gemini web" already communicates that just fine and is less less whimsy than Geminiverse or whatever.
I suppose I could see grounds for suggesting OP use the community-preferred vernacular as a personal preference, but that's about all the bite I see in this bark. Maybe that's reason enough to change it so you don't piss off Gemini's 12 users—I can grant that one.
Also, "Gemini web client" does make it sounds like it's a web client for Gemini. I'd just change it to "a client for the Gemini web".
Re: Show HN: Gemini web client in 100 lines of C
#24This is the most unreadable code I may have ever seen. Congrats on successfully writing it and getting it to work.
The most unreadable code would be the code that was intentionally obfuscated. Here I at least try to pretend that it is readable in some parts.
Thanks for kind words.
Re: Show HN: Gemini web client in 100 lines of C
#25Nice, except the dependency on openssl. It would have been a great opportunity to use BearSSL[0]. 0. https://bearssl.org/
Re: Show HN: Gemini web client in 100 lines of C
#26Nice, except the dependency on openssl. It would have been a great opportunity to use BearSSL[0]. 0. https://bearssl.org/
Is BearSSL still actively maintained? My approach is abstracting SSL away so the API can be exchanged wit OpenSSL, MbetTLS, etc.
Re: Show HN: Gemini web client in 100 lines of C
#27This is the most unreadable code I may have ever seen. Congrats on successfully writing it and getting it to work.
F1(jttable){A z,zz;I r,wr;
F1PREFIP;ARGCHK1(w);
// We accept the pristine calculations from ravel
wr=AR(w); r=(RANKT)jt->ranks; r=wr0),jtravel,z)); // perform ravel on items
R r?z:IRSIP1(z,0L,0L,jtravel,zz); // If we are raveling atoms, do it one more time on atoms
} // ,."r y
Quoting https://corecursive.com/065-competitive-coding-with-conor-ho... :> Yeah. I started a project a couple months ago. I’m slowly porting that code base, the J source code to C++ 20. And yeah, I think there should be a name for these types of code bases, because it’s not C, it’s like a macro variant of C, where it’s a CDSL, where 80% of your “library” is macros. I did a search, there’s 10,000 macros in the source code, and those macros are used like functions.
Re: Show HN: Gemini web client in 100 lines of C
#28On golang, Bombadillo today supports "images" with Unicode-art and searching inside the "pages" a la ctrl-f in browsers, so it's better than Amfora and one of the best TUI clients ever. Also, it does gopher and https thru external tools like lynx.
Re: Show HN: Gemini web client in 100 lines of C
#29It's a nice project, but - I guess as is tradition with the majority of C projects - it has resource leaks and buffer overflows. There is at least one resource leak, namely, `sfd` is not closed when certain `WARN()` invocations jump back to the `start` label; for example, when `gethostbyname()` fails (i.e. try a non-existent domain and observe that the sockets remain open with `lsof`). (It also seems to be leaked in…
This is such a great feedback. Thank you a lot. OFC I will try to correct my mistakes. Not to make any excuses, just for the context. I'm a beginner in C programming and I wrote only few small programs. My tooling is basically non existent. I will try to improve tho.
Re: Show HN: Gemini web client in 100 lines of C
#30Earlier quoted context omitted.
Web refers to Gemini here, it being a command-line client for the Gemini web. These line-based browsers used to be more common, there were a few ones for the www but also ‘ftp’ has such a mode. As does my little ‘nostt’ Teletext reader.
I've only ever heard it called "Gemini", not "Gemini web". "Gemini web" is a bad name because Gemini's not being part of the web was the main motive in Gemini's creation. "Geminisphere" or "Geminiverse" would be fine with me as a name for the totality of Gemini servers considered collectively.
It even supports mime types, you can serve text/gemini from an HTTP server, or a text/html file from a Gemini server.