For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | PacificSpecific's commentsregister

If I'm writing Windows desktop GUIs I still stick to WPF. Might be Stockholm syndrome but I quite like it.

I don't see the reason to use any of the new ms ui frameworks. Especially if ms themselves don't even really use them.

As far as I know visual studio is still a WPF project so I'm not super worried about it no longer working.


WPF looks much nicer. Personally I find it hard as hell to debug.

Winforms just work, and have a well defined set of behaviors. It does not matter that they do not look as nice for most people.


That’s not so bad. I still stick to win32

I generally very much dislike dynamic languages but for some reason I've always really liked Lua. I'm not exactly sure why to be honest.

Maybe because you can fit the whole language spec on a single sheet of paper and adding more advanced features is pretty easy.

Love looks really cool. I never got into it personally but I still might


The Lua source code is also a masterclass in C, I recommend it to anyone learning that language. It's big enough to be an involved implementation, but small and focused and well-organized enough to (at least roughly) understand what's going on at the various layers. It's a very solidly-written mass of portable C, with only minor exceptions.

Oh I hadn't considered looking at the source but considering how minimal and clean Lua is I should have assumed so :)

Thanks for the tip. That should make for a fun weekend


I know it’s bikeshedding and leads to pointless discussions, but in my opinion Lua would be the perfect scripting language if it had 0-based indexing.

“It makes more sense this way” is not a good enough reason to break convention.


Sometimes I feel like I'm the only person in the world who does not care about zero-indexed VS one-indexed. It's just the way Lua is, no big deal. Then again, I don't care about significant whitespace either. Maybe I'm just weird.

It bothered me in theory, but when I started writing lua it quickly became clear that it really doesn't matter. It's just another quirk, like significant whitespace: I don't prefer it, but it's so far down my list of language priorities that it basically doesn't matter.

Pardon my ignorance. But in many languages that have alternative ways of iterating you tend to user indexes less and less. Isn't that true in Lua?

There is nothing stopping you from doing someArray[0] = "the first item", you know.

For me, the table is extremely powerful. I like it that it can be used as a sparse array, a hash, a vector, whatever. Of course one must know, at heart, the difference between pairs() and ipairs() and what it means for your data, though ..


> For me, the table is extremely powerful. I like it that it can be used as a sparse array, a hash, a vector, whatever. Of course one must know, at heart, the difference between pairs() and ipairs() and what it means for your data, though ..

So, as someone only very peripherally familiar with Lua, can someone please explain the table thing to me? I've heard Lua fans gush that Lua is tables all the way down, except it seems like there's these tables on the one hand that work like arrays, and those other tables on the other hand that work like objects, and you can't mix them up...

Is that not just an ordinary dynamically typed language with arrays and objects then, except it overloads the word "table" to refer to both?

I'm sure I'm missing something, happy to hear what that is.


It's not really tables all the way down - Lua has datatypes like nil, boolean, number, string, table, userdata + lightuserdata, functions, coroutines. I think that's the entire list, actually.

So a table is a hashtable. Just about anything can be a key to the hash - a number, a string, a boolean, another table, a userdata. I can't recall if functions and coroutines can be keys but I suspect they could. I definitely know that nil can't be an index.

In Lua - all iterators are implemented as a function + state + current key. When you write "for x in (whatever)", that (whatever) is really a function call like func(state,key). Lua calls it repeatedly to traverse the loop.

Lua will take the first returned value and use it as the new key in the next call to func(). Once the function returns nil as the first value (or just returns no values) - the loop stops.

There are two functions - pairs and ipairs - that really just return the built-in next function with a starting key. pairs returns (lua's next(), the table, nil), and ipairs returns (next(), the table, 0).

(there's a bit more to it than that and some under-the-hood changes between Lua versions but we'll just go with that explanation).

Lua repeatedly calls that next() function with the table and previous key.

Say you had an array like table like { [1] = some_value, [2] = another_value }.

When you write something like "for i,v in ipairs(a_table)" that roughly expands to:

  * pairs() returns next(), the table, 0. 
  * Lua calls next(table, 0) and next returns (1, some_value)
  * Lua calls next(table, 1) and next returns (2, another_value)
  * Lua calls next(table, 2) and next returns nil.
So - when is a table an array?

When you can iterate through it with sequential, integer keys.

Note - you don't necessarily need to use ipairs to iterate. Lua also has a numerical "for" loop so you could do that. Or - if you want to start your arrays at 0 instead of one you can write your own ipairs() like function in just a few lines of code. Observe:

  local zpair_it = function(table, key)
    key = key + 1
    if table[key] then
      return key, table[key]
    end
  end

  local zpairs = function(table)
    return zpair_it, table, -1
  end

  local tab = { [0] = 'yay', [1] = 'huzzah' }
  for i,v in zpairs(tab) do
    print(i,v)
  end

There - now instead of using ipairs(), you can use zpairs() with zero-based indexes.

As far as using like objects, that's getting into metatables and stuff but - basically lua has a syntactical sugar to make object-orientation nice.

If you write "obj:func()" - that's the same as writing "obj.func(obj)" - assuming "obj" is a table, Lua will fetch the "func" key from the table, then call it as a function with "obj" as the first argument (this can be referred to as self within your function definition).

If Lua tries to fetch "func" from your table and it doesn't exist - it will check to see if your table has a metatable defined with an __index metamethod (or table) and pull func from that. So - your table could just have your object's actual state data on it, and functions are referenced in a separate metatable.

Observe:

  local dog_methods = {
    bark = function(self)
      print("bark bark I'm a",self.breed)
    end
  }

  local dog_metatable = {
    __index = dog_methods
  }

  local huskie = setmetatable({
    breed = 'huskie'
  }, dog_metatable)

  local collie = setmetatable({
    breed = 'collie'
  }, dog_metatable)

  huskie:bark()
  collie:bark()

huskie:bark() is equivlanet to huskie.bark(huskie). bark doesn't actually exist on huskie, but huskie has a metatable with an __index table where bark is defined. So the function call is really more like dog_methods.bark(huskie).

Anyways wow that was a lot. Highly recommend going through the Lua manual. It's not a long read.


Thanks, that's a great answer and I really appreciate it!

Tables are kinda-sorta hashes that can hold anything, not unlike JavaScript objects. The array use case is just a table with automatically assigned numeric keys.

> There is nothing stopping you from doing someArray[0] = "the first item", you know.

Yes, there is:

    local l = {[0] = 'a', [1] = 'b', [2] = 'c'}
    for i, c in ipairs(l) do
        print(i, c)
    end
This will only print the last two pairs. Lua is 1-indexed, end of story. You can store values at index zero, but it's no different than storing values at index -1 or index 'lolrofl'. It does not exist in the array-part of the table as far as Lua is concerned.

If you're going to use a table as an array, use it as an array:

    local l = {[0] = 'a', [1] = 'b', [2] = 'c'}
    for i = 0,#l do
      print(l[i])
    end

    .. prints:

    a
    b
    c
Lua haters usually don't get past their misunderstanding of tables, but its really quite unfair on the language and those who have used it quite well to do big things ..

I've always assumed that there is some technical reason for Lua being 1 indexed, rather than it being a design choice.

Either way, I think it's a nitpick to complain about. I've written a decent amount of Lua and there's only been a handful of times where 1-indexing was even relevant to me.


It's a design choice. Lua was first intended to be a configuration language for engineers to enter data at an oil company. They were used to the 1st thing being number 1, the 2nd thing being number 2, and so forth. It's just a very natural way of counting.

You don't change something like that because it eventually got picked up by game programmers (never the intent of Lua, something that just happened after it was used by the Grim Fandango team, then it took off in the gaming world).


Lua will forever hold a special place in my heart. It was the first programming language that I actually managed to learn, instead of just attempting to learn it.

It was chosen around 2008 or so to be the scripting language in Multi Theft Auto: San Andreas.

We build entire worlds in Lua, there were many gamemodes, but my favorite was Roleplay.

Good old carefree times.


exactly, the simplicity is its beauty!

A single data structure (tables), no built in OOP (you build it with metatables).

Coroutines instead of threads.

I was curious and explored it in detail here - https://vectree.io/c/lua-language-design-metatables-coroutin...


It has a very lego-like feeling, with simple, orthogonal design that lets you build the language and constructs you need. Very elegant.

Because Lua is simple and elegant — like the moon, isn’t it?

Lua is a scripting language done right.

It doesn’t pretend to be more than it is. Anyone can learn it a couple of sessions. It has all the stuff you need to write a program.

Imagine if we had Lua instead of JS in the browser.

In fact the latter was once closer to Lua, but didn’t have the same philosophy of wanting to stay minimal.


I would as a Windows user if it works as advertised. The official client has been going downhill. I have to restart it about once a day because it gets into some weird stuck state where it struggles to load chat rooms.

Loading a browser context isn't helping.


You leveled up past a point a surprising number of people get stuck on essentially.

I feel likethe mindset you are describing is kind of this intermediate senior level. Sadly a lot of programmers can get stuck there for their whole career. Even worse when they get promoted to staff/principal level and start spreading dogma.

I 100 percent agree. If you can't show me a real world performance difference you are just spinning your wheels and wasting time.


Yes, I agree, and my experience is the same - there's just too many folks getting stuck in that mindset and never leaving it. Looking into the history I think software engineering domain has a lot of cargo-cult, which is somewhat surprising given that people who are naturally attracted to this domain are supposed to be critical thinkers. It turns out that this may not be true for most of the time. I know that I was also afoul of that but I learned my lesson.


I believe FNA is trying to be more loyal to the original XNA while my monogame tends to introduce new features.

I've been happy with monogame when I used it in the past. I'm pretty sure Celeste was made with FNA


You might be mistaken, the Monogame Github README cites Celeste as an example made with it.


Ah weird. Did a bit of searching and it looks like maybe it targeted multiple frameworks with the xna API. Including xna itself

https://www.pcgamingwiki.com/wiki/Celeste https://celeste.ink/wiki/Version_history


Several games used to target Monogame for consoles but XNA for PC, and later FNA for PC.

Monogame on PC used to be somewhat buggy in my hobbyist experience.


Oh interesting. I never hit any walls personally but I guess I didn't push that hard.


XNA was originally designed for XBox Live Arcade indie titles.


This matches my experience. Unless it's been done to death online (crud etc) it falls on its face every time.


It's okay shills and those with stock in the AI copies brainwashed themselves inside out and will spam forever on this website that if you just introduce the right test conditions agents can do anything. Never mind engineering considerations if it passes the tests it's good homie! Just spent an extra few hundred or thousand a month on it! Especially on the company I have stock in! Give me money!


Those are bad answers. Really bad.


What part of them were bad? And where is your contribution?

Asking Gemini spit out this:

https://godbolt.org/z/fzfnY6r39 - using a brush

https://godbolt.org/z/hdKe1b71P - using triangles for miter support.


It's not my responsibility to educate you. Especially if you won't take the time yourself to understand the problem.

I suggest you read through the sibling comments.


If the hardware changes significantly and those sites don't exist in the future wouldn't that mean gemeni would degrade in quality because it has nothing to pull from?


Right, that success story is only because there was "organic" (for lack of a better term) information from an original source. What happens when all information is nth generation AI feedback with all links to the original source lost?

Edit: A question from AI/LLM ignorance- Can the source database for an LLM be one-way, in that it does not contain output from itself, or other LLMs? I can imagine a quarantined database used for specific applications that remains curated, but this seems impossible on the open internet.


> Can the source database for an LLM be one-way, in that it does not contain output from itself, or other LLMs?

I think, for public internet data, we can only be reasonably confident for information before the big release of ChatGPT.


Yes, people have likened pre-LLM Internet content to low-background steel.

If in the hypothetical future the continual learning problem gets solved, the AI could just learn from the real world instead of publications and retain that data.


One reason why Google made that algorithm to watermark AI output


That's exactly why text written before the first LLMs has a premium on it these days. So no, all major models suffer from slop in their training data.


We've all tried to ask the LLM about something outside of its training data by now.

In that situation, they give the (wrong) answer that sounds the most plausible.


That's definitely been my experience. I work with a lot of weird code bases that have never been public facing and AI has horrible responses for that stuff.

As soon as I tried to make a todomvc it started working great but I wonder how much value that really brings to the table.

It's great for me though. I can finally make a todomvc tailored to my specific needs.


I'm not sure what sorts of weird codebases you're working with but I recently saw Claude programming well on a Lambda MOO -- weirder than that?


I had to Google that haha.

It's in that realm but more complex. I do plan to repeatedly come back and try though. Just so far it hasn't been useful.


Once or twice, for me it's deflected rather than answer at all.

On the other hand, they've also surfaced information (later independently confirmed by myself) that I had not been able to find for years. I don't know what to make of it.


> In that situation, they give the (wrong) answer that sounds the most plausible.

Not if you use web search or deep report, you should not use LLMs as knowledge bases, they are language models - they learn language not information, and are just models not replicas of the training set.


This then becomes the hardware manufacturers problem. If their new hardware fails for to many users it will no longer be purchased. If they externalize their problem solving like so many companies, they won't be able to gain market share.

This creates financial incentives to pay companies running the new version of search. Your thinking of this as a problem for these companies, when in reality it is a financial incentive.


> because it has nothing to pull from?

Chat rooms produce trillions of tokens per day now, interactive tokens, where AI can poke and prod at us, and have its ideas tested in the real world (by us).


Presumably companies will still provide manuals.


It'll be a single sheet of paper with a QR code that redirects to a canned prompt hosted at whichever LLM server paid the most to the manufacturer for their content.


If that was adequate then wouldn't there not be supplementary material?

Results vary of course. I have some very wonderful synthesizer manuals.


Yea so I’ve had an issue getting video output after boot on a new AMD R9700 Pro. None of the, albeit free, models from OpenAI/Google/Anthropic have really been helpful. I found the pro drivers myself. They never mentioned them.

Thats not to say AI is bad. It’s great in many cases. More that I’m worried about what happens when the repositories of new knowledge get hollowed out.

Also my favorite response was this gem from Sonnet:

> TL;DR: Move your monitor cable from the motherboard to the graphics card.


You could put a sim card in a tablet in that case. Might look a little funny when doing a phone call though.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You