[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1766472565603.png (263 KB, 990x712)
263 KB
263 KB PNG
Welcome to the Daily Programming Thread. What are you working on, /g/?
Previous: >>107711909
>>
>>107730163
First for AI won
>>
>>107730163
pnpm fixes this, should be cargo instead
>>
how much trolling and schizo posting are we going to see in /dpt/ in 2026?
>>
>>107730137
Happy new year to you too.
>>
>>107726160
>>>107712416
>Normal humans don't go into programming.
screaming, I took up the runes
>>
File: sdr.png (18 KB, 1403x783)
18 KB
18 KB PNG
>>107730163
wrote a terminal spectrum analyzer in C. posted in last thread but didnt have a screenshot of it running
>>
does it make sense to support option types in a language without static typing? I had some interesting ideas about making if/else be the option wrap/unwrap operators, but I wouldn't want to shoehorn language constructs just because they're interesting, plus I have practical problems like how to let the user instantiate an empty option of some type
>>
>>107732006
In a dynamically typed language you can just return whatever type you want, so I don't think a Result type makes much sense unless it makes it easier for the caller to identify the type of the value returned.
I do think an Option type makes more semantic sense than returning null which basically is a " value that represents the absence of a value".
>>
>>107730342
Considering how many autists are poisoning the field: yes.
>>
>>107732006
the only real downside is you can't nest it
>>
>>107732006
>option types
>dynamic language
anon...
>>
>>107732149
>>107732183
I was thinking that maybe I could compromise and do a generic box type, without caring about the type of the boxed value. it wouldn't force me to having to expose types to the user, and I would still get better semantics for handling nullability. to me this syntax below looks fine but I don't know if I'm conditioning myself to think it is
some_num = 2!
no_num = ?
[1, 2, 3][0] // 1!
[1, 2, 3][4] // ?
if false 1 // ?, with lazy evaluation of the body
2! else 3 // 2
// streaked together, if <cond> <expr1> else <expr2> behaves like expected
>>
Sharing this 32 bit ARM dynamic loader project in the new dpt since I was super late to the old one.

Hopefully someone finds it useful and/ or wants to contribute. I don't think of young'ns work in embedded though...

https://github.com/HotelSierraWhiskey/TethysRT
>>
>>107732240
it could get annoying and confusing without types
are you going to give box all the same operators
also may be worth considering more than just optionality, e.g. asynchrony iteration etc etc
>>
>>107732240
What's the point of boxing a value in a dynamically typed language?
Boxed or not, if I'm getting a value I presumably want to do something with it, so I have to care about the type of the value to know what I can do with it. I don't see you doing me any favours by making that harder for me.
Good job reinventing NaN i guess.
>>
learning rust. i don't really have a reason to learn rust though.
>>
>>107732321
I do agree, I'll definitely need to add at least type hinting down the line
>>107732333
>I don't see you doing me any favours by making that harder for me.
I'm not sure why you say boxing the type would make it harder. in situations where you'd want to box a value, if the language supported null as opposed to boxed types, you'd still have to handle the nullability with if myval != null, with the only difference being that now you're not straight up forced to include the check which could lead to NPE-style bugs
>>
would you guys say its worth getting a claude sub? So far I had been using deepseek/chatgpt free and they fit my needs but claude's presentation seems way better and it did solve something for me the other 2 struggled with
>>
>>107732006
now might the time for you to re-evalute static typing
>>
>>107732476
>I'm not sure why you say boxing the type would make it harder.
I was referring to what you said after boxing the type
>without caring about the type of the boxed value. it wouldn't force me to having to expose types to the user
How am I supposed to work with a value if you refuse to tell me what type it is?
>>
>>107732583
ah, I didn't mean much by it, just that the user wouldn't need to pass along type info when instantiating an empty option. in general I imagine that the language is going to handle types like python, I'll support optional type hints down the line but otherwise you're just supposed to keep track of types in your head.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.