HNHacker News
TopNewBestAskShowJobs

ratboy666

226 karma · joined May 17, 2013

submissionscomments
ratboy666··on BBC censors its own archives
War of 1812. The Acadians. The Irish.
ratboy666··on Can artificially altered clouds save the Great Barrier Reef?
Ok -- first, let me quote the article:

"Three-hundred and twenty nozzles spewed a cloud of nano-sized droplets engineered to brighten clouds and block sunlight — providing a bit of cooling shade for the coral colonies below."

How big is the Great Barrier Reef?

"approximately 133,000 square miles"

How big is Germany?

"137987.506 square miles"

In other words -- use "cloud brightening" for an area the size of Germany? I would wonder if this is actually a good idea.

How bad is the coral doing? Let's get input from the Australian government":

https://www.aims.gov.au/news-and-media/reef-recovery-window-...

Moderate to High -- without cloud brightening.

Actually, I don't oppose the research. Just be careful if deployments are going to be "at scale".

ratboy666··on IRS: Stolen property must be reported as income on taxes
I like your cartoon. The difference with the dividend flow is that the payment was made... not for a good or service (which all the other flows have in common) but tax on a repayment. Not a fixed, negotiated payment either... A repayment that is, interestingly, not in the control of the shareholder. Thus differing from a loan.

I would no longer purchase stocks -- I would then prefer bonds (loans). Which means I would take risk into account, and this would stifle (some) innovation.

I don't mind taxation at all!

ratboy666··on Motorists have been stranded on a major interstate in Virginia since last night
What about the snow in Miami then? (Jan 19, 1977)
ratboy666··on Burn My Windows
Ah ha!

Thank you the detail. The philosophy is that Gnome is NOT configurable, really, just does a VERY limited and consistent desktop thing. It doesn't even have icons on the desktop (by default).

I find that it is "easy" for most users -- there is really nothing there! If you want icons on the desktop, add an extension for that. And, the idea of extensions is that they are small programs that are easy to manage. It is possible to turn them all off with a click! (if they are getting in the way).

I just counted -- I have 36 extensions on my Gnome 41. Note that icons on the desktop = extension, start menu for programs = extension. You can certainly start programs without a start menu -- that is the default "Gnome Way".

On the other hand -- being able to consistently customize is very nice (I particularly like "argos" extension, which makes it delightfully easy to add buttons, gather and display information and more -- and as a bonus, is fully compatible with the MacOS bitbar plugin.

Yes, I use a lot of extensions, but I do have 4 or 8GB of RAM is my laptops, and i3 or better processors, so this becomes a reasonable fit for me.

ratboy666··on Burn My Windows
Javascript for desktop extensions. Makes sense -- doesn't matter what processor you are running! Sure, depends on the version of the desktop environment - and each extension declares what version(s) it is operable for. The major problem is that I may be running (just for example) Gnome 40 on one machine and then Gnome 30 on another, and I really can't share the same home directory! That would be lovely if it could be worked out! Would also slightly simplify my backup strategies.

I don't see desktop extensions as the "core of the computation stack". Can you expand on that idea, please?

ratboy666··on IRS: Stolen property must be reported as income on taxes
1 - I have already paid tax on the money. 2 - In making the investment, I stand to lose (or gain) 3 - The lost money is not an expense

Given all of this, I expect that the capital gain rate is specified as lower to encourage me to invest.

If the capital gain rate were higher than the income rate, I would not make risky investments. I could use my money to invest in my own business -- where I have expenses available. And, take an income. Any loss would then be an expense.

I just wouldn't invest in other business.

How would you encourage investment behavior?

ratboy666··on CP/M Source Code
Um... PL/M is not safe, and does not have "safe strings and arrays". It doesn't have strings... It has bytes and addresses.

I hope /s means "sarcastic".

ratboy666··on Features of PL/I not realized in a modern language
And... for reference. In my Microsoft F80 github string repository:

https://github.com/ratboy666/string

(Microsoft F80 was a FORTRAN 66, slightly subset compiler -- no COMPLEX that Microsoft sold from the late 70s to early 80s).

In there find pop.mac which is a short 4 byte assembly routine to discard a stack level. That can be used as follows:

   ASSIGN 1 TO I        -- STORE ADDRESS OF LABEL 1 TO I
   CALL F(I)            -- PASS I TO SUBROUTINE F
   ...                  -- WE WILL NEVER GET HERE
 1 ... 
 
   SUBROUTINE F(I)
   EXTERNAL $POP 
   INTEGER $POP  
   JUNK = $POP(0)       -- REMOVE RETURN ADDRESS
   GO TO I              -- GO TO ASSIGNED LABEL I 
   END                              
The ASSIGN command puts the address of label 1 into INTEGER I GO TO I then transfers to that location. Note that we can pass I into the SUBROUTINE, use $POP to remove a stack level (the return address), then jump to the variable. Scheme is nicer, which continuations, of course, but that hadn't been considered yet...

The ASSIGN was deleted as a feature in FORTRAN 95 -- obsolescent by FORTRAN 90. I guess "very very old-school".

Now, the FORTRAN 66 standard doesn't mention if something like this is allowed... but, since no stack was involved in early implementations, and recursion was not allowed, I imagine that it would work more widely than might otherwise be expected.

ratboy666··on Features of PL/I not realized in a modern language
In FORTRAN IV, multiple return labels could be passed to a subroutine. This was carried into PL/I. In FORTRAN 66, this was not supported. But, FORTRAN IV and 66 both support assigned go to, which can be used to replace this -- WATFIV supported this (local routines that use ASSIGN, with a bit of syntax sugar). Note that this is a LONG time ago (mid sixties)...
ratboy666··on U.S. sets goal to drive down cost of removing CO2 from atmosphere
But where I live, it would be difficult. Yes, there is a "CO2 tax" here. Twenty years ago I converted my wood-burning fireplace to natural gas. That was being, in my opinion, environmentally friendly (I prefer burning wood -- more pleasant). If the cost of NG goes too high I can revert to wood. Electricity is out, because the local power company prices it at around 7 times higher than natural gas. $800 per month to heat my house. $125 for natural gas. Wood? 3 to 6 cords should do... At 1 cord per acre, I would need 3 to 6 acres. I could buy 40 acres, put up a house, and produce my own biofuel as well. No "price on carbon emissions". If you can convince me that CO2 is an existential threat, that is one thing. I can move to Memphis where I don't need to heat my home. You cannot deny me the right to do that, if you think that CO2 is that threat. Otherwise, you can tax me until I refuse to participate.
ratboy666··on U.S. sets goal to drive down cost of removing CO2 from atmosphere
CO2 is combined with sunlight by plants to produce wood (carbon) and O2. We take in the O2, combine it with carbon, and produce CO2. Its a cycle

https://oceanservice.noaa.gov/facts/carbon-cycle.html

https://pubs.acs.org/doi/10.1021/acs.energyfuels.8b02803

which is CO2 to calcium carbonate. This happens in nature and is used by coral.

So, all that CO2 in the atmosphere can become trees and coral.

ratboy666··on U.S. sets goal to drive down cost of removing CO2 from atmosphere
"Carbon footprint".

Ok -- Empty out the North.

http://www.mappedplanet.com/karten/klima/januar_temp-na.png

How about it? I get to move to Memphis, where I no longer need to heat my dwelling in the Winter.

https://www.chatelaine.com/home-decor/environment-eco-home-h...

I pay 11.3 cents per k/w for electricy

https://www.torontohydro.com/for-home/rates

Natural gas costs 4.71 US/MMBtu

https://www.torontohydro.com/for-home/rates

Now

1 MMBTU = 293.07107 kWh

So with ALL of this, electricity is 7 times more expensive than natural gas.

Now, it costs $125 or so per month to heat a house here - Using electricity, that would be $875. Per month.

https://www.torontohydro.com/about-us/company-overview

Only 6.3% Natural Gas.

In a nutshell, I can't afford it. That's ok, I can just to Memphis for my retirement.

ratboy666··on U.S. sets goal to drive down cost of removing CO2 from atmosphere
Reminds me of:

https://dilbert.com/strip/2019-02-12

ratboy666··on Faster JavaScript Calls
Being old... I read the article quickly, and had the same thought. Yes, C pushes arguments in reverse order... and we never cared if arguments were "under specified". Or over. Just needed to know where the first argument was, and how to get to the second, and how to return to the caller. The caller, of course, is then responsible for argument clean-up.

Made sense 50 years ago... makes sense now.

FredW

ratboy666··on Does Apple really log every app you run? A technical look
tin foil -- not just for hats anymore
ratboy666··on C++ still isn't cutting it
Yes, very good programmers can make mistakes.

To meet your challenge, think about the problem. How about this?

  file size + 1 => s
  allocate char buffer b[s]
  read file to b (all data must be in memory, or merge sort. if on linux and allocation worked, read may fail! oom will get us, or we bail on read failure)
  add final newline if missing
  count newlines => n
  allocate line pointers p[n] (if line pointers will not fit, we bail -- we could use offsets and fancy virtualization, if this is not a Z80)
  fill pointer array p
  sort => sorted[n] (if sorting fails, bail)
  output sorted lines
Same for C and C++. UTF-8 is ok.

Do you want more data than will fit into memory? Even then, C++ doesn't bring much to the table. Separating the sort algorithm? Yes C++ BEGINs to pull ahead by a bit.

safe? yes. easy to write? yes. no fancy bits? yes. Transcribe to C C++ as you will. Java? won't be as pretty. Rust, Go? don't know. Javascript. Not even close.

Since this is a "beginning programmer" problem, give a design that works for another language that makes sense to a beginning programmer.

ratboy666··on Crush: A command line shell that is also a powerful modern programming language
You are correct. It is all about how you think about things.

"ls" lists files. Sure. Simple interactive command. But, thinking about this, "echo " also lists files. "ls" provides information about files. Sure. Simple interactive command. But, "stat" specifically provides information.

So, I would reach for

stat --format "%n %a"

To get name and octal permissions. You are correct, and wrong at the same time. Easy enough to accomplish -- but using * instead of ls. Note that the "space in filename" becomes the big issue (use %N in stat format).

So your conclusion is 100% correct. Thank you for your post and insight

ratboy666··on New Jersey needs COBOL programmers for their unemployment claims system
Depends on what you mean.

For example, my editor (which I use for work like this)

  MODE-'COBOL'
    72.b -.a -.t -.h 8.h 12.h
    .r
Roughly: for COBOL - ring alarm bell if I type past column 72. Do not autoindent. Do not use tabs (spaces only). Remove all tabulation except at column 8 and column 12. For FORTRAN 66 (77) work, I just set a single tabulation at column 7.

But that is just me. You should look into THE: The Hessling Editor on linux, etc. Look into Regina Rexx.

which would be all the "tooling" needed. You could run a mainframe emulator (look into Hercules)

How is 80 column "punch card" style editing and printer output terrible?

ratboy666··on New Jersey needs COBOL programmers for their unemployment claims system
It makes no sense to me... JCL, DB2, VSAM -- ok. SDLC?

If it referred to SNA, it should be SNA/SDLC. Not referencing that (or VTAM) means Software Development Life Cycle.

ratboy666··on GNU Make Guile Integration

  : fred@tara ~ $; cat /etc/fedora-release 
  Fedora release 31 (Thirty One)
  : fred@tara ~ $; make -p | grep FEAT
  make: *** No targets specified and no makefile found.     Stop.
  .FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver output-sync check-symlink guile load
  : fred@tara ~ $; 
guile available -- so, its enabled in Fedora.

  : fred@tara ~ $; ls -l `which make`
  -rwxr-xr-x. 1 root root 248624 Dec 10 17:34 /usr/bin/make
  : fred@tara ~ $; 
and, just to validate guile availability:

  : fred@tara ~ $; ldd `which make`
   linux-vdso.so.1 (0x00007ffce61cb000)
   libguile-2.2.so.1 => /lib64/libguile-2.2.so.1 (0x00007fc423432000)
   libdl.so.2 => /lib64/libdl.so.2 (0x00007fc42342b000)
   libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc423409000)
   libc.so.6 => /lib64/libc.so.6 (0x00007fc423240000)
   libgc.so.1 => /lib64/libgc.so.1 (0x00007fc4230e1000)
   libffi.so.6 => /lib64/libffi.so.6 (0x00007fc4230d6000)
   libunistring.so.2 => /lib64/libunistring.so.2 (0x00007fc422f50000)
   libgmp.so.10 => /lib64/libgmp.so.10 (0x00007fc422ed3000)
   libltdl.so.7 => /lib64/libltdl.so.7 (0x00007fc422ec7000)
   libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007fc422e8c000)
   libm.so.6 => /lib64/libm.so.6 (0x00007fc422d46000)
   /lib64/ld-linux-x86-64.so.2 (0x00007fc4235ed000)
   libatomic_ops.so.1 => /lib64/libatomic_ops.so.1 (0x00007fc422d41000)
   libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc422d25000)
  : fred@tara ~ $; 
Yes, libgc and libgmp are needed (182k for libgc, 1.3mb for libgmp, 1.3mb for libguile itself) as opposed to 3.3m for python3. Seems comparable, including dependencies.
ratboy666··on Two New Moms Return to Work – One in Seattle, One in Stockholm
No. You have to define how a country can be rich. And what "basic healthcare" is. And what "for all" means.

A country cannot be rich. Its people can be. If you have a definition that differs, we can discuss. I am going to avoid "basic healthcare" for now. We can discuss "for all". Does that mean for people born in the country? Or does it really mean "for all people"?

FredW

ratboy666··on Show HN: Base24 binary-to-text encoding for humans
I like this. Hacked together a quick implementation in javascript (using quickjs as the interpreter):

https://github.com/ratboy666/qjs-3word

ratboy666··on Does memory leak? (1995)
I think the story isn't nuanced. The program runs once, the missile explodes, garbage collection is done!

No need for garbage collection, no need for "memory management". Not shoddy work. An expression of "YAGNI". The interesting thing (in my opinion), is the realization. The teller of the story went to the trouble of discovering that memory is leaking. She could have simply asked before engaging the work.

FredW

ratboy666··on Want to call C from Python? Use D
Email me at fred(underscore)weigel(at)hotmail(dot)com

I interfaced CEF to Java in 2000 lines of C++

Simple, easy API. I run CEF in a separate process, and use the Window manager (Linux and Windows) to cause the Chrome windows to overlay the application windows. Standard pipes are used between the controlling process and CEF.

Email me if you are interested. As a ps -- I can use CEF from shell scripts as well. Anything with a C FFI works.

FredW

ratboy666··on Programmer's critique of missing structure of operating systems
Text is structured: character, word, line, possibly field. Even "bytes" (octets) have some structure. On top of text, I usually layer, these days, usually JSON. Bytes? usually sqlite3

Yes, creating a parser with grep isn't usually desired. But, "plain text" is quite useful. And, with JSON and sqlite3 in easy reach, I don't see the massive issue.

Please -- I would like examples where you had issues with doing something even slightly complicated with "just text", and had difficulty. I really want to examine this. Either the text toolkits are not adequate, or I will be convinced that I am wrong, and will investigate structured CLI and OS interfaces.

FredW

ratboy666··on Programmer's critique of missing structure of operating systems
I would disagree.

Take /etc/passwd. It does have a query language. getpwent(), login, passwd

It has data types -- again getpwent() (man getpwent) needs pwd.h

It has "parallel writes". Multiple users can use passwd at the same time. It has "transactions" -- mostly because of inodes.

Similar comments apply to utmp and wtmp (note that utmp and wtmp are not ascii -- they are binary records). /etc/services is ALSO structured but is ascii. Less controlled, because it is almost always "read-only".

Of course, in a very strange sense, you are correct. Any structure imposed is NOT by the kernel -- this is "post init", or user level.

FredW

ratboy666··on Time safety is more important than memory safety
Pascal has neither generics nor exception handling. At least, with reference to ISO Pascal.
ratboy666··on Time safety is more important than memory safety
And, for those who have been contemplating parameter widening: on the 68000, insert s += 3. For "portable" C89 code, declare the parameter an int (not char) -- then introduce char c2 = c and s = &c2 instead. This transformation is "safe" because parameters are copied by value and cannot be returned that way.

As to debugging -- many of these systems did not have "debuggers" -- an example would be Whitesmiths C in the late 70s and the 80s. We used a strategy of old-school paper validation, combined with function testing. Yes, things moved more slowly.

Code can be maintained. The above C89 code was just compiled with gcc 9.2.1 -- with gcc -std=c89 c89.c it compiled without warning, and ran (40 year old code).

The issue with (say) bring forward Whitesmiths C is that the Whitesmiths standard library is not POSIX. Not hard to convert, though. For example (as I recall) %d was %i

FORTRAN 77 (and FORTRAN IV) is in a similar category. As is COBOL and Common LISP.

SNOBOL4 is a bit of an outlier -- The original interpreter was written in macro assembler. That assembler is now converted to C, and the original interpreter can still be run:

The Macro Implementation of SNOBOL4 in C (CSNOBOL4BX) Version 2.0 by Philip L. Budne, January 1, 2015 SNOBOL4 (Version 3.11, May 19, 1975) BLOCKS (Version 1.10, April 1, 1973) Bell Telephone Laboratories, Incorporated EXTENSIONS (Version 0.25, June 16, 2015) Fred Weigel

No errors detected in source program

CODE (TUE AUG 4 10:28:58 EDT 2015) RUNNING ON CSNOBOL4 MAINBOL WITH SPITBOL, BLOCKS, EXTENSIONS ENTER SNOBOL4 STATEMENTS (TRY ? FOR HELP) 5,541,616 BYTES FREE CODE:

And, yes, I modified the original interpreter to add some extensions back in 2015. However, Budne has published the pattern matching engine in Javascript so there is an easy migration for those programs (https://github.com/philbudne/spipatjs).

In my opinion (and this is strictly my opinion), only Javascript appears to have this "lasting" property wrt modern languages. An important characteristic is simplicity, and forward-backward compatibility. As well, multiple implementations are important.

FredW

ratboy666··on Time safety is more important than memory safety
As part of "C lore", the answer is yes. In C89:

int main() {

func('a');

}

func(c)

char c;

{

char * s = &c;

printf("%c\n", * s);

}

is, um, dangerous. c is an int, not a char. So on a big endian machine, s may end up pointing to the high byte. Taking the address of a parameter is dangerous, unless the widening is taken into account.

This does work on a little endian machine (tried it). On a 68000, it likely doesn't print 'a' (\0 is most likely).

On little-endian, this is a lot safer. ANSI C takes care of this as well. Yes, we can "debug it". There is a chance that all knowledge of this is lost. But, for now, those of us "in the know" have experience to keep the old alive.

← PreviousPage 3 of 7Next →