HNHacker News
TopNewBestAskShowJobs

lochsh

226 karma · joined November 6, 2016

submissionscomments
lochsh··on Ask HN: Who is hiring? (November 2022)
Oxford Ionics | Senior Software Engineer | UK hybrid up to 4 days remote/1 day in office | Full time

Oxford Ionics are a quantum computing start-up building trapped-ion quantum computers. We're using Python and Rust to build our technology stack, which includes a custom optimising compiler for quantum circuits. Come join our growing team of engineers and scientists!

https://oxfordionics.bamboohr.com/jobs/view.php?id=32

lochsh··on Ask HN: Who is hiring? (September 2022)
Oxford Ionics | Senior Software Engineer | UK hybrid up to 4 days remote/1 day in office | Full time

Oxford Ionics are a quantum computing start-up building trapped-ion quantum computers. We're using Python and Rust to build our technology stack, which includes a custom optimising compiler for quantum circuits. Come join our growing team of engineers and scientists!

https://oxfordionics.bamboohr.com/jobs/view.php?id=32

lochsh··on Ask HN: Who is hiring? (September 2021)
Oxford Ionics | Embedded Software Engineers and Compiler Engineers | Full Time | ONSITE, HYBRID (Oxford, UK) | Quantum computing

Oxford Ionics is a small quantum computing start-up in Oxford, UK. We're looking for smart, motivated software engineers to join our growing team of engineers and scientists.

Rust | Python | FPGAs | qubits

This is a rare opportunity for a potentially really varied role, with the ability to make a big impact early on in the company's development. See links below for details

https://www.oxionics.com/careers

https://www.oxionics.com/software-engineer-embedded

https://www.oxionics.com/software-engineer-compiler

lochsh··on Designing a RISC-V CPU, Part 1: Learning hardware design as a software engineer
I've had this recommended and it looks v promising! https://vivonomicon.com/2020/04/14/learning-fpga-design-with...

Someone above has mentioned Robert Baruch too: https://github.com/RobertBaruch/nmigen-tutorial

I also found this helpful: http://blog.lambdaconcept.com/doku.php?id=nmigen:tutorial

And there is of course the IRC channel if you want to ask people questions, #nmigen on irc.freenode.net

lochsh··on Designing a RISC-V CPU, Part 1: Learning hardware design as a software engineer
I'm hoping to write part 2 this weekend or next week -- I realise anyone knowledgeable of logic design won't be super excited by this first installment. It's intended mostly for people who are new like me! I look forward to writing in more detail about RISC-V and my cpu design :)
lochsh··on Designing a RISC-V CPU, Part 1: Learning hardware design as a software engineer
I'm hoping to talk about this in the next installment where I actually talk about the design. It's been really interesting getting a feel for how the processes are different. It's something I've been aware of before from talking to hardware engineers, but I think I'm only truly understanding it now that I'm doing it myself :)
lochsh··on Why can't I pass std:vector<Child*> as std:vector<Parent*>?
Thanks for bringing up variance -- this is a concept I've since learned about and have added a small update to the blog post about.

I understand your point about the `children_as_parents` example, I've added another update to point out that the mutability of the vector makes it problematic to have the `children` variable.

lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
I think it's worth noting that there are multiple I2C peripherals by ST -- one for STM32F1, F4, and L1; and a different one used for STM32F0, F3, F7, L0, and L4.
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
I'm not sure I do have suggestions for such resources sadly :( If anyone has any please drop them here!
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
I love getting compliments on my site design, thanks very much.
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
Thank you for the compliment ^_^ I'm glad you found the post helpful.

This isn't a typo, actually. If you look at the documentation of the BSRR register (which is screenshotted in the blog post), it says of BRy:

> These bits are write-only [...] [Setting to 1] Resets the corresponding ODRx bit

So setting BR8 in the BSRR clears the ORD8 bit in the output data register. Because our LED is active low, this turns the LED on.

The indirection can make this a little confusing, I hope this cleans it up!

lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
This is lovely to hear, I'm so glad it was helpful!
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
Yes, probably! But you can do it yourself without one.

Here is an example in C using libopencm3, that uses timers to trigger an interrupt used to flash LEDs https://github.com/libopencm3/libopencm3-examples/tree/maste...

lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
You don't need an OS to do more advanced or efficient sleeping. You could have one of the timer peripherals generate an interrupt on a regular basis, and then put the chip in a lower power sleep mode in between interrupts.
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
Oh actually I was being sleepy and hadn't understood what you'd said! I hadn't realised you could do that actually, neat, thanks!

So you could do `mov r1, #0x01000000` right? nice.

lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
This is true! If I was writing something to be optimal speed- and size-wise, I'd do that. I think I just liked the consistency with the other parts of the code where using both was necessary :)
lochsh··on How to flash an LED: writing ARM assembly for an STM32 microcontroller
I don't have experience with this, but from talking to people who do, there are indeed open source implementations. They say the documentation is a bit confusing, but it does describe everything.

This Rust library is an abstract USB library that can implement CDC serial https://docs.rs/usb-device/0.2.5/usb_device/, and this library connects it to the STM32 USB peripheral https://github.com/stm32-rs/stm32-usbd

Examples here: https://github.com/stm32-rs/stm32-usbd-examples

lochsh··on C++ is not a superset of C
I've made some updates to the blog post based on feedback -- thank you everyone who pointed out mistakes helpfully :)

I've made the updates clear, and linked to the archived version of the original post.

lochsh··on C++ is not a superset of C
you're right, I messed up here. I'm working on some updates to the blog post based on feedback.
lochsh··on C++ is not a superset of C
I haven't been able to find anything in the C11 standard about the initialisation of bar being a constraint violation. In 6.7.3, the only constraints for type qualifiers listed are for _Atomic and restrict. Could you let me know where you got the information you talk about here from? I could be missing part of the standard.
lochsh··on C++ is not a superset of C
It would only be a VLA if defined in a block, I intended the code snippet to be at file-scope, giving the buffer size and array static storage duration.

But it does indeed compile in Clang, and I'm looking into why. I think this line in the C11 standard might be key: "An implementation may accept other forms of constant expressions."

lochsh··on C++ is not a superset of C
This is what I was going for in the blog post, but I got confused after seeing these comments as Clang _does_ compile this when the buffer is of static storage class.

Which I don't think is standard -- but it's not using VLAs. I wondered if it just has constant expression semantics for const variables.

Weirdly, adding a _Static_assert to test this theory proves it for c99 but not c11 :/

https://godbolt.org/z/q-bb-n c99 with clang https://godbolt.org/z/ad14Ah c11 with clang https://godbolt.org/z/xJSDQa c11 with gcc (which is the only one giving the output I'd expect)

lochsh··on C++ is not a superset of C
Being told my web design is kinda cyberpunk is a great compliment, thank you ^_^ I like the banner image on yours.
lochsh··on C++ is not a superset of C
I've converted it to jpg and it's now 448K :)
lochsh··on C++ is not a superset of C
Thank you! ^_^
lochsh··on C++ is not a superset of C
Thank you so much! This is lovely to hear. ^_^ I like it too.
lochsh··on C++ is not a superset of C
Yes, I think I made an embarrassing mess up here by using a compiler that doesn't support VLAs, and not fully understanding VLAs. Thanks for pointing it out.
lochsh··on C++ is not a superset of C
I should probably make it smaller! 6MB is pretty indulgent. But I do like how it looks and this is mostly just a fun blog for myself :)
lochsh··on C++ is not a superset of C
Ah yes, what I meant was that more optimisations can be made on memmove if we restrict src and dst, as the overlap case no longer needs to be considered.

I've never used restrict, so I could be missing something, but this is what I meant in the blog post by mentioning memmove.

lochsh··on C++ is not a superset of C
This is all totally fair -- I've never used restrict, so it's hard for me to have a useful opinion on it.

I think it's easy to dismiss things that can help optimisation when you've never seen their effect first-hand. I imagine if I'd had an experience where I'd used it to great advantage I'd be wishing it was in the C++ standard too :)

Page 1 of 2Next →