The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Topics that can go away
Post Reply
bradrn
Posts: 6263
Joined: Fri Oct 19, 2018 1:25 am

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by bradrn »

Travis B. wrote: Sun May 09, 2021 12:54 pm
bradrn wrote: Sun May 09, 2021 1:20 am What a coincidence! I’ve also been writing a GoL implementation as my first Forth project. It’s been tricky, but in an interesting way. GoL was also my first Haskell project, and I’ve since written a more general cellular automaton simulator as well. (It’s not at a releasable stage yet, even after ~3 years of on-and-off work, but I’m sure I’ll get around to it one day…)
As you must know, GoL-specific implementations can be more tightly optimized. One note though is that there is a trade-off between memory and speed; e.g. the fastest GoL implementations (i.e. hashlife) are less memory-efficient, while the most memory-efficient GoL implementations (i.e. one bit per cell) are slower.
Oh, I know, but given my current knowledge of Forth even a naïve GoL implementation is challenging enough :)
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
Qwynegold
Posts: 735
Joined: Sun Jul 29, 2018 3:03 pm
Location: Stockholm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Qwynegold »

bradrn wrote: Sat May 08, 2021 10:30 am Don’t have time to look at this properly just right now (so apologies if I’m completely misunderstanding your problem), but have you tried the menu entry ‘View → Change Interface Language’ yet?
Of course. But only the built-in languages are available on that menu.

I'd really appreciate it if you wanna take a look at this.
My latest quiz:
[https://www.jetpunk.com/user-quizzes/25 ... -kaupungit]Kuvavisa: Pohjois-Amerikan suurimmat P:llä alkavat kaupungit[/url]
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

I have written up a temperature sensing project based on the LMT01 temperature sensor which uses zeptoforth 0.16.2 (or later).
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
bradrn
Posts: 6263
Joined: Fri Oct 19, 2018 1:25 am

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by bradrn »

Looks interesting! Perhaps I’ll try it one day if I ever get zeptoforth working. It can’t be too hard to translate it to Arduino. In fact, the hardest bit will probably be finding the temperature sensor in the first place.

That being said, I have no idea how this is working. The Forth code actually isn’t too hard to follow, at least in broad outlines, but I have no idea how that circuit works. Electronics is not my strength, though for a while now I’ve been wanting to learn more about it. (Hmm… you wouldn’t happen to have any resources, by any chance?)
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

bradrn wrote: Sat May 29, 2021 10:06 pm Looks interesting! Perhaps I’ll try it one day if I ever get zeptoforth working. It can’t be too hard to translate it to Arduino. In fact, the hardest bit will probably be finding the temperature sensor in the first place.

That being said, I have no idea how this is working. The Forth code actually isn’t too hard to follow, at least in broad outlines, but I have no idea how that circuit works. Electronics is not my strength, though for a while now I’ve been wanting to learn more about it. (Hmm… you wouldn’t happen to have any resources, by any chance?)
One clue about Arduino - Arduino people love their "libraries" and are lost without them to be honest. They in this case prefer a different temperature sensor, the DS18B20, which is much harder to work with and is much older tech than the LMT01, just because once upon a time someone wrote a "library" that supports it. The LMT01 is easy to find, by the way, on places like Arrow and Mouser.

I should note that electronics is not my strength, either; that logic is based off of something someone I know created, except this is a single-LMT01 version and that originally used multiple LMT01's. Right now as I write this I am working on a version that works with multiple LMT01's hooked up to a single MCU, which the MCU measures in a round-robin fashion.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
KathTheDragon
Posts: 783
Joined: Mon Jul 09, 2018 3:57 am
Location: Disunited Kingdom

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by KathTheDragon »

Travis B. wrote: Sat May 29, 2021 11:44 pmArduino people love their "libraries" and are lost without them to be honest
Why are you talking so derisively about libraries? What's wrong with using code someone else wrote?
bradrn
Posts: 6263
Joined: Fri Oct 19, 2018 1:25 am

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by bradrn »

Travis B. wrote: Sat May 29, 2021 11:44 pm
bradrn wrote: Sat May 29, 2021 10:06 pm Looks interesting! Perhaps I’ll try it one day if I ever get zeptoforth working. It can’t be too hard to translate it to Arduino. In fact, the hardest bit will probably be finding the temperature sensor in the first place.

That being said, I have no idea how this is working. The Forth code actually isn’t too hard to follow, at least in broad outlines, but I have no idea how that circuit works. Electronics is not my strength, though for a while now I’ve been wanting to learn more about it. (Hmm… you wouldn’t happen to have any resources, by any chance?)
One clue about Arduino - Arduino people love their "libraries" and are lost without them to be honest. They in this case prefer a different temperature sensor, the DS18B20, which is much harder to work with and is much older tech than the LMT01, just because once upon a time someone wrote a "library" that supports it. The LMT01 is easy to find, by the way, on places like Arrow and Mouser.
Ah, OK.
I should note that electronics is not my strength, either; that logic is based off of something someone I know created, except this is a single-LMT01 version and that originally used multiple LMT01's. Right now as I write this I am working on a version that works with multiple LMT01's hooked up to a single MCU, which the MCU measures in a round-robin fashion.
My problem here is that I’m a perfectionist and love to know exactly what’s going on; I’d hate to build electronics without a clear idea of what I’m doing, even if I know that someone else got it working. (Also, I’m doing a physics major, so I already have the right background for it.)
KathTheDragon wrote: Sun May 30, 2021 12:00 am
Travis B. wrote: Sat May 29, 2021 11:44 pmArduino people love their "libraries" and are lost without them to be honest
Why are you talking so derisively about libraries? What's wrong with using code someone else wrote?
I think it’s not the libraries that’s the problem; it’s the fact that most programmers don’t know what’s going on ‘under the hood’, so to speak. (I get the impression this is very much the philosophy of Forth: the ideal is to build everything yourself, from the operating system up.)
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

KathTheDragon wrote: Sun May 30, 2021 12:00 am
Travis B. wrote: Sat May 29, 2021 11:44 pmArduino people love their "libraries" and are lost without them to be honest
Why are you talking so derisively about libraries? What's wrong with using code someone else wrote?
It is not code reuse that's a problem with Arduino, but rather a lack of knowledge by many of the people who target it of the underlying hardware, an inability to read and interpret reference manuals and datasheets, and an inability to exercise the hardware without using someone else's code. For instance, when I have been working on zeptoforth, I have made good use of the reference manuals for the MCU's I am targeting rather than being limited to reusing someone else's code.

In this case, I was able to put together a simple solution to measuring temperature with the LMT01 based on what I was able to read from the STM32F407 reference manual and the LMT01 datasheet. I chose the LMT01 because it provides a simple solution (measuring the temperature is literally just measuring edges with an interrupt handler when combined with an NPN transistor and a couple resistors) whereas others would choose an archaic solution just because someone wrote a library for that once.

Of course, this is by necessity, because what Forth code does exist for Cortex-M MCU's is mostly part of Mecrisp-Stellaris, which I am unable to reuse because zeptoforth is MIT-licensed (so that users can integrate zeptoforth in their binaries without running into licensing issues) while Mecrisp-Stellaris is GPL3-licensed, which is unfortunate.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

bradrn wrote: Sun May 30, 2021 12:09 am
I should note that electronics is not my strength, either; that logic is based off of something someone I know created, except this is a single-LMT01 version and that originally used multiple LMT01's. Right now as I write this I am working on a version that works with multiple LMT01's hooked up to a single MCU, which the MCU measures in a round-robin fashion.
My problem here is that I’m a perfectionist and love to know exactly what’s going on; I’d hate to build electronics without a clear idea of what I’m doing, even if I know that someone else got it working. (Also, I’m doing a physics major, so I already have the right background for it.)
I wish I had a better understanding of electronics, TBH, but at this point I cannot even mentally exercise the relationship between volts, amps, and ohms...
bradrn wrote: Sun May 30, 2021 12:09 am
KathTheDragon wrote: Sun May 30, 2021 12:00 am
Travis B. wrote: Sat May 29, 2021 11:44 pmArduino people love their "libraries" and are lost without them to be honest
Why are you talking so derisively about libraries? What's wrong with using code someone else wrote?
I think it’s not the libraries that’s the problem; it’s the fact that most programmers don’t know what’s going on ‘under the hood’, so to speak. (I get the impression this is very much the philosophy of Forth: the ideal is to build everything yourself, from the operating system up.)
Exactly. Forth is all about knowing the whole system and building things from ground up, and it is unfortunate that so many programmers today do not understand how things really work 'under the hood'. Forth is one of the few systems out there where a single programmer can know and understand the entire system and where the ability to create an entire system is within the average programmer's reach. Likewise, Forth has probably one of the highest if not the highest implementation to programmer ratio of all languages...
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
alice
Posts: 963
Joined: Mon Jul 09, 2018 11:15 am
Location: 'twixt Survival and Guilt

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by alice »

Travis B. wrote: Sun May 30, 2021 12:20 am Exactly. Forth is all about knowing the whole system and building things from ground up, and it is unfortunate that so many programmers today do not understand how things really work 'under the hood'. Forth is one of the few systems out there where a single programmer can know and understand the entire system and where the ability to create an entire system is within the average programmer's reach. Likewise, Forth has probably one of the highest if not the highest implementation to programmer ratio of all languages...
And unless you build all the hardware from scratch (including all the components) yourself, you *still* aren't doing it right.
Self-referential signatures are for people too boring to come up with more interesting alternatives.
User avatar
KathTheDragon
Posts: 783
Joined: Mon Jul 09, 2018 3:57 am
Location: Disunited Kingdom

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by KathTheDragon »

Travis B. wrote: Sun May 30, 2021 12:14 am
KathTheDragon wrote: Sun May 30, 2021 12:00 am
Travis B. wrote: Sat May 29, 2021 11:44 pmArduino people love their "libraries" and are lost without them to be honest
Why are you talking so derisively about libraries? What's wrong with using code someone else wrote?
It is not code reuse that's a problem with Arduino, but rather a lack of knowledge by many of the people who target it of the underlying hardware, an inability to read and interpret reference manuals and datasheets, and an inability to exercise the hardware without using someone else's code. For instance, when I have been working on zeptoforth, I have made good use of the reference manuals for the MCU's I am targeting rather than being limited to reusing someone else's code.

In this case, I was able to put together a simple solution to measuring temperature with the LMT01 based on what I was able to read from the STM32F407 reference manual and the LMT01 datasheet. I chose the LMT01 because it provides a simple solution (measuring the temperature is literally just measuring edges with an interrupt handler when combined with an NPN transistor and a couple resistors) whereas others would choose an archaic solution just because someone wrote a library for that once.

Of course, this is by necessity, because what Forth code does exist for Cortex-M MCU's is mostly part of Mecrisp-Stellaris, which I am unable to reuse because zeptoforth is MIT-licensed (so that users can integrate zeptoforth in their binaries without running into licensing issues) while Mecrisp-Stellaris is GPL3-licensed, which is unfortunate.
So? Have you considered that this might not be a concern for other programmers? Like, if I were going to do a project that would require an Arduino, I wouldn't want to get bogged down in the details of how the hardware works. I would want to find out how to do what I want it to do, and do that.
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

KathTheDragon wrote: Sun May 30, 2021 5:33 am So? Have you considered that this might not be a concern for other programmers? Like, if I were going to do a project that would require an Arduino, I wouldn't want to get bogged down in the details of how the hardware works. I would want to find out how to do what I want it to do, and do that.
I.e. one wants to do a hardware project without any concern for how to interface with the hardware programmatically. One would want it all to be hidden behind libraries so one does not have to actually understand what one is doing, and one does not want to learn anything about the software side of things.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
KathTheDragon
Posts: 783
Joined: Mon Jul 09, 2018 3:57 am
Location: Disunited Kingdom

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by KathTheDragon »

I have no idea how to respond to this. It smacks of pure elitism. You're doing programming right, I'm not. Have you written your own operating system in machine code yet?
User avatar
alice
Posts: 963
Joined: Mon Jul 09, 2018 11:15 am
Location: 'twixt Survival and Guilt

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by alice »

It does rather sound like Travis is saying "In order to invent the wheel, one must first reinvent the wheel". I can see his point of view, but I don't think many people would agree with it.
Self-referential signatures are for people too boring to come up with more interesting alternatives.
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

My perspective is that if one wants to learn how hardware works, one should interface with it directly in terms of registers and GPIO's and like. Sure, one can simply use a pre-written library that abstracts everything away, but at the end of the day, what have you learned? And sure, for an Arduino project that might not be your goal, but what is then? To simply put together something without understanding what one is doing?
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
KathTheDragon
Posts: 783
Joined: Mon Jul 09, 2018 3:57 am
Location: Disunited Kingdom

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by KathTheDragon »

And what if you don't care about learning how the hardware works, you just want to use it? Idk, I think you're just being pretentious (like your use of "one", who actually talks like that?)
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

KathTheDragon wrote: Sun May 30, 2021 1:54 pm And what if you don't care about learning how the hardware works, you just want to use it? Idk, I think you're just being pretentious (like your use of "one", who actually talks like that?)
Why would one be building a temperature sensor project then when one can simply buy a self-contained thermometer off the shelf with far less hassle if one is not doing it to learn something?

(About my use of one here, it is specifically to avoid the implication of using you that I might be talking about you, KathTheDragon.)
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Travis B.
Posts: 6862
Joined: Sun Jul 15, 2018 8:52 pm

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by Travis B. »

I can see more of a role for a temperature sensor library if one is not just trying to build a temperature sensor setup for its own sake, but if one is building a larger project that uses one or more temperature sensors as just part of it where one might not care about the details of individual components as opposed to that of the whole.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
bradrn
Posts: 6263
Joined: Fri Oct 19, 2018 1:25 am

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by bradrn »

I think there is an argument for avoiding libraries in the specific case of electronics. If you’re doing anything much more complicated than just plugging one electronic device into the GPIO pins specified by the documentation, you’ll end up directly working with the hardware interface between the microcontroller and the device at some point. Which means that (a) you’ll need to know how everything works anyway, in order to avoid messing up the circuit, and (b) there’s a good chance of (accidentally or deliberately) doing something the library doesn’t support.

(And in general, I think there are good arguments for having at least a general understanding of the salient points of the level below yours. e.g. If I’m programming Haskell, it’s useful to have an idea of how the compiler deals with laziness internally. If I’m writing C, I need to understand memory management. If I’m making a webserver, it would be nice to know a bit about HTTP and TCP/IP so I know what’s going wrong. And so on and so forth.)
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
User avatar
KathTheDragon
Posts: 783
Joined: Mon Jul 09, 2018 3:57 am
Location: Disunited Kingdom

Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.

Post by KathTheDragon »

Travis B. wrote: Sun May 30, 2021 2:13 pmWhy would one be building a temperature sensor project then when one can simply buy a self-contained thermometer off the shelf with far less hassle if one is not doing it to learn something?
Oh, I don't know, maybe you're building something that needs a thermometer?
(About my use of one here, it is specifically to avoid the implication of using you that I might be talking about you, KathTheDragon.)
I'm smart enough to know what impersonal "you" is, thanks.
bradrn wrote: Sun May 30, 2021 8:36 pm I think there is an argument for avoiding libraries in the specific case of electronics. If you’re doing anything much more complicated than just plugging one electronic device into the GPIO pins specified by the documentation, you’ll end up directly working with the hardware interface between the microcontroller and the device at some point. Which means that (a) you’ll need to know how everything works anyway, in order to avoid messing up the circuit, and (b) there’s a good chance of (accidentally or deliberately) doing something the library doesn’t support.
I never disagreed with this, frankly. All I said is that the offence taken at the idea that people might want to use a library for a solved problem is ridiculous. If you want to use a component for which a library exists, refusing to use it because it's a library is absurd. If you test it and find out it has issues that make it intractable, well, that's a whole nother problem, isn't it? But you can't just assume that.
(And in general, I think there are good arguments for having at least a general understanding of the salient points of the level below yours. e.g. If I’m programming Haskell, it’s useful to have an idea of how the compiler deals with laziness internally. If I’m writing C, I need to understand memory management. If I’m making a webserver, it would be nice to know a bit about HTTP and TCP/IP so I know what’s going wrong. And so on and so forth.)
I never disagreed with this either, except I'd call this "having learnt the language/framework/toolchain/etc." properly.
Post Reply