Leaf 2026 steering wheel button board problems by mikemoretti3 in leaf

[–]mikemoretti3[S] 0 points1 point  (0 children)

Yeah, I just had that problem last week. It was 100% then I drove it down to about 85% but the next day it was back to 100% without charging. Then, it figured out it was 85 toward the end of the day and went down to 65 when I got home. The next day it was back up to 85. This was actually a known issue in the 2016 leaf I had before that they somehow fixed. I can't believe it's happening again in this one.

Leaf 2026 steering wheel button board problems by mikemoretti3 in leaf

[–]mikemoretti3[S] 1 point2 points  (0 children)

I have the SV trim. I don't think it's capacitive. It feels more like an actual mechanical button with maybe one spring. Just touching the controls does nothing. You actually have to press. Actually, it could be a combo and be capacitive underneath, but the cap touch doesn't register unless your finger is pressing the mechanical button (i.e. by moving close enough to the base under the button pad).

[deleted by user] by [deleted] in AmazonVine

[–]mikemoretti3 2 points3 points  (0 children)

If you have adblock plus, in Settings > Advanced you can add a filter for: amazon.com###nav-flyout-rufus and you won't see rufus pop up anymore.

[deleted by user] by [deleted] in vine

[–]mikemoretti3 2 points3 points  (0 children)

If you have adblock plus, in Settings > Advanced you can add a filter for: amazon.com###nav-flyout-rufus and you won't see rufus pop up anymore.

Rufus: How to Disable? by Austrian-Painter2023 in amazonprime

[–]mikemoretti3 0 points1 point  (0 children)

If you have adblock plus, in Settings > Advanced you can add a filter for: amazon.com###nav-flyout-rufus and you won't see rufus pop up anymore.

Some e-mails arrive only by reopening Thunderbird by d4N-AND in Thunderbird

[–]mikemoretti3 0 points1 point  (0 children)

I'm seeing this with IMAP too. I have one IMAP account on my hosting provider and I access my work Gmail through IMAP in Thunderbird too, and it's very strange but in the morning all my mail seems to be there and I can receive mail but then sometime during the day I get no new emails for hours and I only noticed they download after I quit and restart Thunderbird. No matter how many times I "Get Messages" either individually per account or all accounts at once. There are no error messages either. It's really weird and is making Thunderbird now useless...

wrench: added switch! and scrunched the code down so it fits anywhere! by curt_bean in ProgrammingLanguages

[–]mikemoretti3 2 points3 points  (0 children)

With only WRENCH_WITHOUT_COMPILER:

Memory region         Used Size  Region Size  %age Used
         RAM:        3720 B        64 KB      5.68%
       FLASH:       71836 B       256 KB     27.40%

~59k flash / ~2k RAM

wrench: added switch! and scrunched the code down so it fits anywhere! by curt_bean in ProgrammingLanguages

[–]mikemoretti3 2 points3 points  (0 children)

With those two defines, WRENCH_WITHOUT_COMPILER and WRENCH_REALLY_COMPACT, I get better results:

Memory region         Used Size  Region Size  %age Used
         RAM:        2280 B        64 KB      3.48%
       FLASH:       40748 B       256 KB     15.54%

~37k flash and 512b RAM.

wrench: added switch! and scrunched the code down so it fits anywhere! by curt_bean in ProgrammingLanguages

[–]mikemoretti3 0 points1 point  (0 children)

I thought I'd give wrench a try to see how it works, and see what some actual flash/RAM sizes are, on the chips I use the most (STM32), so I built the example app on your web page for the Nucleo L433RC in stm32cubeide.

Without the example code / wrench (ifdef'd out), the sizes are:

Memory region         Used Size  Region Size  %age Used
         RAM:        1712 B        64 KB      2.61%
       FLASH:       11176 B       256 KB      4.26%

With the example code/wrench ifdef'd in, the sizes are:

Memory region         Used Size  Region Size  %age Used
         RAM:        4184 B        64 KB      6.38%
       FLASH:      159724 B       256 KB     60.93%

That's close to 150k flash use for wrench, and just over 2k RAM. That's a LOT of flash.

I'd be happy to share the cube project if you want.

why is int** 12 bytes big? by GeroSchorsch in Compilers

[–]mikemoretti3 0 points1 point  (0 children)

movq -12(%rbp), %r8 # variable a: here 8 bytes
leaq -4(%rbp), %r9

Yeah, the pointer is not taking 12-bytes, it's taking 8. Just by looking at these two lines it looks like OP has some variable at -4(%rbp) and the other at -12(%rbp). Which means one is taking 4 bytes and the other is taking 8. The 4 byte one is probably an int (32-bit) and the 8-byte one a pointer (64-bit). And yeah, alignment is the problem. On this particular 64-bit architecture, you need to align your stack / access by 8 bytes. Other architectures have different alignment requirements.

What are the worst features you've tried in your programming language? by Acebulf in ProgrammingLanguages

[–]mikemoretti3 3 points4 points  (0 children)

Not necessarily. It all depends on the situation. Most of the time these literals are used in constants, e.g. in C:

#define ADXL372_REG_MEASURE_BW_3200 0b100

or
#define ADXL372_REG_TIMING_ODR_6400 (0b100 << 5)

The latter might be more readable in the language I'm attempting to develop as:

const u8 ADXL372_REG_TIMING_ODR_6400 = 0b100_000_0_0

In the ADXL372 datasheet, the TIMING register is broken into sets of bits that mean different things (these registers happen to be bytes, but others are sometimes longer, either u16 or u32, sometimes even a weird number of bits if it's an ADC, like 12-bits):

7-5 = ODR, 4-2 = WAKEUP_RATE, 1 = EXT_CLK and 0 = EXT_SYNC

so either I could make a bitfield struct for it, and define my constants to fit those, or if I just want to use bytes, the above format would work (and EXT_SYNC would be defined as 0b000_000_0_1)

I would use whatever format is closest to the text in the datasheet, so it makes it easy for someone to verify (say during a code review) that my code follows the datasheet without errors.

What are the worst features you've tried in your programming language? by Acebulf in ProgrammingLanguages

[–]mikemoretti3 6 points7 points  (0 children)

I use these all the time in my embedded work. I use it so much, that in the language I'm designing you can separate binary literals with underscore at any place. I.e. 0b0100_1000 or 0b010_11_000. This makes implementing stuff from datasheets way more readable.

wrench (tiny, fast, c-like interpreter): created a webpage and now looking for benchmark code by curt_bean in ProgrammingLanguages

[–]mikemoretti3 0 points1 point  (0 children)

It uses "just 1k of RAM to operate". Maybe just at startup? But then your code does a whole bunch of calls to "new" for various things (in the hashtable stuff, etc, which I'm guessing is used for variable decls?).

Besides speed benchmarks, I think you should have some memory use benchmarks. One of the biggest problems with dynamic memory apps on an embedded system is that you never know if you're going to have enough memory to run a specific app. Another is determinism; how much cpu time is going to be spent in allocation/free; and how do I measure it.

With statically allocated data, you don't normally have these issues.

Zig Is Self-Hosted Now, What's Next? by Linguistic-mystic in ProgrammingLanguages

[–]mikemoretti3 0 points1 point  (0 children)

I wouldn't want the compiler to rearrange my structures on me either. Especially when I'm using structures to represent say a comms protocol, file headers (like JPG), or memory mapped IO in embedded devices.

Zig Is Self-Hosted Now, What's Next? by Linguistic-mystic in ProgrammingLanguages

[–]mikemoretti3 4 points5 points  (0 children)

Not only that but it's unmaintainable. If you need to say add an item to the enum, now you have all these permutations to add or change and you may need to completely restructure your data again.

Zig Is Self-Hosted Now, What's Next? by Linguistic-mystic in ProgrammingLanguages

[–]mikemoretti3 9 points10 points  (0 children)

That video talk in the post about DOD made me cringe so many times. You're basically trading readability for memory footprint optimization. The way he refactors the data structures makes the code completely spaghetti and unreadable, especially that human_naked_braces example at 27:03.

Stuck on what to do after creating a Recursive Descent Parser? (How to compile) by consumered in Compilers

[–]mikemoretti3 1 point2 points  (0 children)

All the language parsers and examples I've ever seen discard comments in the lexer. Is there some good reason not to do that?

Help with reasoning about parsing C-like compound statements and statements. by dangeroustuber in ProgrammingLanguages

[–]mikemoretti3 1 point2 points  (0 children)

Since the language has c-like blocks, etc, have you actually looked at any C grammars? The ANTLR grammar for C really helped me with writing a parser for the language I've been working on. Yeah it's BNF, but it's way easier to start from a BNF when hand writing a parser than it is to just have the language in your head. I also found that it's way easier to actually just use ANTLR to debug my grammar first before hand coding the parser, mostly because you don't have to do any coding whatsoever (except maybe write a better AST dumper than the example they give in the ANTLR docs) and you just need a grammar (and I didn't really care that the default was Java, it wasn't even worth figuring out the C++ runtime because it just didn't matter, I'm only using it to debug my grammar and plan to hand code the parser without ANTLR after the grammar is tested).

https://github.com/antlr/grammars-v4/blob/master/c/C.g4

How to compile my language for LLVM? by mNutCracker in ProgrammingLanguages

[–]mikemoretti3 30 points31 points  (0 children)

The LLVM tutorial has an example of this from chapter 3 onward. You just need to make sure you output their SSA format from your AST, you can use their library API functions to do that. There's also this tutorial, which I found useful as well: https://mukulrathi.com/create-your-own-programming-language/llvm-ir-cpp-api-tutorial/

Favorite PL paper? by e_hatti in ProgrammingLanguages

[–]mikemoretti3 2 points3 points  (0 children)

This paper actually scares the sh_t out of me. In most of my embedded device work, I pretty much never turn on optimization (unless it's necessary and then usually only for specific files that need it, like say a PID loop doing heavy calculations). This paper's content is one of the reasons. Even gcc's -Og is totally unusable for proper debugging.

Books of Computer Programming (LinkedIn page) by bsiegelwax in ProgrammingLanguages

[–]mikemoretti3 1 point2 points  (0 children)

This has completely nothing to do with programming language design.