Programming thread -

omnihitler

kiwifarms.net
Something that I thought of recently that maybe I'm too much of a brainlet to understand: What's the purpose of embedded scripting languages? Take Lua, for example: You can embed a Lua interpreter in your C program so that it can run Lua code, but then what? What would be the purpose of doing that? I know that game developers do it so they can change some things dynamically without having to bring the whole program down (UI changes for WoW, as an example), but is that the only use for it?
Other reasons are ease of extensibility, along with program safety.

For example, redis has a facility for throwing in lua scripts as a way to execute arbitrary logic on groups of data structures in a single transaction. You can also write custom modules in C to link redis against at startup in order to add in arbitrary functions and data structures as well. The problems with doing so:

- a bug in the C module leading to a segfault crashes the server, instead of crashing the function call
- linking redis against the custom module requires a restart as you described
- C is slower to write than lua for most people, and isn’t beginner-friendly the way lua is

I guess lua in particular was designed as an embedded scripting language:


E: I didn’t answer the question. Haven’t had enough coffee yet. Main reason for embedding a scripting language is to let someone add in an arbitrary modification without needing to understand the entirety of the program’s source code. If I want to add in an additional arbitrary behavior into redis with a lua script, I only need to know redis’s API, not redis’s internals, and I don’t need to worry about introducing a bug into my local redis server that isn’t isolated to whatever script I loaded in.
 
Last edited:

Stock Image Photographer

Commander of the Canadian Nazi KKK League
kiwifarms.net
Anyone think it's a coincidence that Guido van Rossum got woke only after he gave up his BDFL status for Python?
Given all the weird things that went on with Python 3, his resignation, and the suddenly woke thing, I think Guido has an undiagnosed brain tumor that's very slowly making him crazy.
Did you use regex?
Yes, I did. I used a library to retrieve her statuses as a list of dicts, then examined the content part of each dict. I stripped out all the html tags and set the the content to lowercase to make searching easier, then iterated through a list of terms and tested matching using regex.
This is critically important.
May I ask why? Is there a better way to do it?

On an unrelated note, a part of a program I'm trying to write deals with changing the color of a picture without changing the shading of the picture. Would it be sufficient to represent the picture as a matrix of HSV colors and just change the hue component of the colors to achieve what I want?
 

Gangster Talk

You lookin' at my gut?
kiwifarms.net
How does a new programmer escape becoming a web developer?

I've been loving the first professional project I've been working on up until they told me that they want me to learn React for a front end web app. I actually really enjoyed studying for my Java certification and learning the deeper intricacies of the language, have been making my way through K&R to learn C to learn lower level fundamentals, but learning modern frameworks is just tiring. Web dev is a clusterfuck and it feels like I want to learn art history and I'm being taught how to use a crayon instead of a magic marker, knowing full well within a year or so there's going to be a brand new crayon I have to learn to use.

Am I just off base here and need to learn to adapt? I just feel like I would rather master a craft than master the ability to change to whatever meme dependency is hot on the marketplace.
 
  • Feels
Reactions: ConcernedAnon

MAPK phosphatase

Cell Death Regulator
kiwifarms.net
How does a new programmer escape becoming a web developer?

I've been loving the first professional project I've been working on up until they told me that they want me to learn React for a front end web app. I actually really enjoyed studying for my Java certification and learning the deeper intricacies of the language, have been making my way through K&R to learn C to learn lower level fundamentals, but learning modern frameworks is just tiring. Web dev is a clusterfuck and it feels like I want to learn art history and I'm being taught how to use a crayon instead of a magic marker, knowing full well within a year or so there's going to be a brand new crayon I have to learn to use.

Am I just off base here and need to learn to adapt? I just feel like I would rather master a craft than master the ability to change to whatever meme dependency is hot on the marketplace.
Mastering the ability to change to whatever meme dependency is hot is mastering the craft of web development.
 

Gorilla Tessellator

kiwifarms.net
How does a new programmer escape becoming a web developer?

I've been loving the first professional project I've been working on up until they told me that they want me to learn React for a front end web app. I actually really enjoyed studying for my Java certification and learning the deeper intricacies of the language, have been making my way through K&R to learn C to learn lower level fundamentals, but learning modern frameworks is just tiring. Web dev is a clusterfuck and it feels like I want to learn art history and I'm being taught how to use a crayon instead of a magic marker, knowing full well within a year or so there's going to be a brand new crayon I have to learn to use.

Am I just off base here and need to learn to adapt? I just feel like I would rather master a craft than master the ability to change to whatever meme dependency is hot on the marketplace.
My advice is: don't get intimidated by myriads of crayons. I consider web development as another tool in my tool-set. In fact learning correct design practices and writing clean code applies to any coding including web development. Personally, I started with Flask, but all this shit, as you will learn soon is quite similar, so it's not like you learn everything from scratch.

All this knowledge is not tied to a specific library, but it's transferable across domains. I bet that learning React you will start looking at your Java code from a different angle.

What is important is to learn this low level stuff, because this way you will not pigeonhole yourself in one area, and you will better equipped to survive in marketplace.
 

omnihitler

kiwifarms.net
How does a new programmer escape becoming a web developer?

I've been loving the first professional project I've been working on up until they told me that they want me to learn React for a front end web app. I actually really enjoyed studying for my Java certification and learning the deeper intricacies of the language, have been making my way through K&R to learn C to learn lower level fundamentals, but learning modern frameworks is just tiring. Web dev is a clusterfuck and it feels like I want to learn art history and I'm being taught how to use a crayon instead of a magic marker, knowing full well within a year or so there's going to be a brand new crayon I have to learn to use.

Am I just off base here and need to learn to adapt? I just feel like I would rather master a craft than master the ability to change to whatever meme dependency is hot on the marketplace.
If you pick up C, and then C++, everything else will seem pretty easy. But I mean really pick them up - do a basic project in C, like a redis module, and then move to something more complicated like a toy OS, a very basic relational DB, or a basic clone of apache or NGINX. Make sure to do C before learning C++. C++ has a lot of conveniences like std::string that will cause problems if you don’t have an idea of what they’re doing under the hood.

If you’re concerned about job security and don’t want to be on the JS treadmill, get good at SQL before anything else, and then get a basic understanding of database internals (i.e. how does a query planner work, how indexes work, how to reduce the damage of an expensive JOIN operation). A lot of devs tend to shit their pants when dealing with SQL even though relational databases are the best tool for most business applications. SQL doesn’t change that rapidly and most relational db dialects are fairly similar. SQL is also consistently used across most companies.

I avoided getting pigeonholed as a web developer by getting good with SQL, the command line, a smattering of other datastores, networking, TDD, and most importantly by being incompetent at visual design. My go-to colors are baby puke green, orange, and pink.
 

MAPK phosphatase

Cell Death Regulator
kiwifarms.net
833796

>tfw you give someone a 10 minute email and they say they'll email you right back, but they don't so you program a tampermonkey user-script that refreshes the email every 5 seconds, essentially giving you a permanent email that will kill itself if the tab isn't open.
Why do I do these things to myself?
 

Stock Image Photographer

Commander of the Canadian Nazi KKK League
kiwifarms.net
What's a good place to start with python?
I'd say either automating some boring, repetitive task you do on your computer or something that you think would be interesting but would take too long manually. An example of the former might be a program I wrote that took the CSV output from machines I worked with, collated them into one spreadsheet file, and computed averages. An example of the latter might be a program that combs through the post history of a lolcow and counts the number of time they say a certain set of words. Python is good for web scraping and has a lot of libraries that make it easy, so if you have any interest in that I'd say go for it.
 
  • Like
Reactions: Even Odder
Tags
None

About Us

The Kiwi Farms is about eccentric individuals and communities on the Internet. We call them lolcows because they can be milked for amusement or laughs. Our community is bizarrely diverse and spectators are encouraged to join the discussion.

We do not place intrusive ads, host malware, sell data, or run crypto miners with your browser. If you experience these things, you have a virus. If your malware system says otherwise, it is faulty.

Supporting the Forum

How to Help

The Kiwi Farms is constantly attacked by insane people and very expensive to run. It would not be here without community support.

BTC: 1DgS5RfHw7xA82Yxa5BtgZL65ngwSk6bmm
ETH: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
BAT: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
LTC: LSZsFCLUreXAZ9oyc9JRUiRwbhkLCsFi4q
XMR: 438fUMciiahbYemDyww6afT1atgqK3tSTX25SEmYknpmenTR6wvXDMeco1ThX2E8gBQgm9eKd1KAtEQvKzNMFrmjJJpiino