Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A SQL-like language for efficient code analysis, transformations, and tool use. Most useful for AI code assistants.
CEDARScript: a domain-specific language designed to improve how AI coding assistants interact with codebases and communicate their code modification intentions.
It provides a standardized way to express complex code modification and analysis operations, making it easier for AI-assisted development tools to understand and execute these tasks.
It also helps with tool use: it works as a gateway to external tools, so that the LLM can easily call local shell commands, external HTTP API endpoints, etc
The assistant will write CEDARSCript
commands that will be executed by the CEDARScript runtime editor.
Imagine a vast library (your codebase
) with millions of books (files
) across thousands of shelves (directories
).
Traditional code editing is like manually searching through each book, line by line, character by character, to find
relevant information or make changes.
CEDARScript, on the other hand, is like having a magical librarian with superpowers, like:
Code Analysis
):
function
) is mentioned Or where he/she was born?
Or find all the chapters (classes
) that discuss a particular topic (variable usage
)?
The librarian provides this information immediately, without having to flip through pages (waste precious tokens
)Code Manipulation
):
This magical librarian (CEDARScript
) collaborates with the LLM and allows it to assume the role of an Architect
who can work with your vast library of code at a higher level, making both understanding and modifying your codebase
faster and more intuitive. It bridges the gap between the LLM's high-level intent and the nitty-gritty details
of code structure, allowing the architect to focus on the 'what' while it handles the 'how' of code analysis
and modification.
Audio overview / Podcasts There are a few podcasts discussing CEDARScript you can listen to:
CEDARScript
(Concise Examination, Development, And Refactoring Script) is a SQL-like language designed to
lower costs and improve the efficiency and accuracy of AI code assistants. It enables offloading low-level code syntax and
structure concerns, such as indentation and line counting, from the LLMs.
It aims to improve how AI coding assistants interact with codebases and communicate their code modification intentions
by providing a standardized and concise way to express complex code analysis and modification operations, making it easier for
AI-assisted development tools to understand and execute these tasks.
CEDARScript transforms LLMs from code writers into code architects.
The Architect doesn't need to specify every tiny detail - instead of spending expensive tokens writing out
complete code changes, it simply provides high-level blueprints using CEDARScript commands like
UPDATE FILE "main.py" MOVE FUNCTION "execute" INSERT AFTER FUNCTION "plan"
.
This division of labor between the architect and CEDARScript is not just efficient - it's economical. The Architect (LLM) conserves valuable resources (tokens) by focusing on strategic decisions rather than character- or line-level editing tasks.
The CEDARScript runtime then handles all the minute details - precise line numbers, indentation counts, and syntax consistency - at zero token cost.
Let's get to know the 3 primary functions offered by CEDARScript:
SELECT
it and have the CEDARScript runtime show the contents?)AFTER
, BEFORE
, INTO
a function, its BODY
, at the TOP
or BOTTOM
of it...)64.0%
)76.4%
)LINE "if name == 'some name':"
VARIABLE
, FUNCTION
, CLASS
). Ex:
FUNCTION 'my_function'
Currently, CEDARScript
theoretically supports Python, Kotlin, PHP, Rust, Go, C++, C, Java, Javascript, Lua, FORTRAN, Scala and C#,
but only Python has been tested so far.
Cobol and MatLab: Initial queries for these languages are ready, but the Tree-Sitter parsers for them still need to be included.
CEDARScript
edit format for AiderCEDARScript
to LLMsCEDARScript
can be used as a way to standardize and improve how AI coding assistants interact with codebases, learn about your code, and communicate their code modification intentions while keeping token usage low.
This efficiency allows for more complex operations within token limits.
It provides a concise way to express complex code modification and analysis operations, making it easier for AI-assisted development tools to understand and perform these tasks.
Quick example: turn a method into a top-level function, using CASE
filter with REGEX:
UPDATE FILE "baseconverter.py"
MOVE FUNCTION "convert"
INSERT BEFORE class "BaseConverter"
RELATIVE INDENTATION 0;
-- Update the call sites in encode() and decode() methods to use the top-level convert() function
UPDATE CLASS "BaseConverter"
FROM FILE "baseconverter".py
REPLACE BODY
WITH CASE -- Filter each line in the function body through this CASE filter
WHEN REGEX r"self\.convert\((.*?)\)"
THEN REPLACE r"convert(\1)"
END;
Use an ED script to change a function:
UPDATE FILE "app/main.py" REPLACE FUNCTION "calculate_total" WITH ED '''
-- Add type hints to parameters
1s/calculate_total(base_amount, tax_rate, discount, apply_shipping)/calculate_total(base_amount: float, tax_rate: float, discount: float, apply_shipping: bool) -> float/
-- Add docstring after function definition
1a
"""
Calculate the total amount including tax, shipping, and discount.
Args:
base_amount: Base price of the item
tax_rate: Tax rate as decimal (e.g., 0.1 for 10%)
discount: Discount as decimal (e.g., 0.2 for 20%)
apply_shipping: Whether to add shipping cost
Returns:
float: Final calculated amount rounded to 2 decimal places
"""
.
-- Add logging before return
/return/i
logger.info(f"Calculated total amount: {subtotal:.2f}")
.
''';
There are many more examples to look at...
One can use CEDARScript
to concisely and unambiguously represent code modifications at a higher level than a standard diff
format can.
IDEs can store the local history of files in CEDARScript
format, and this can also be used for searches.
If explicit configuration is set, the CEDARScript runtime can act as a unified gateway through which any LLM can call external commands and obtain their output (a.k.a. Tool Use support).
This includes:
ls
, grep
, find
, open
)The output from the external tool is captured and sent back to the LLM.
-- Suppose the LLM has difficulty counting letters...
-- It can delegate the counting to a Python script:
CALL LANGUAGE "python" WITH CONTENT '''
print("Refrigerator".lower().count('r'))
''';
-- Using env var
CALL LANGUAGE "python"
ENV CONTENT '''WORD=Refrigerator'''
WITH CONTENT '''
import os
print(os.environ['WORD'].count('r'))
''';
-- Using env var from the host computer
CALL LANGUAGE "python"
ENV INHERIT ONLY 'WORD'
WITH CONTENT '''
import os
print(os.environ['WORD'].count('r'))
''';
CALL COMMAND
ENV INHERIT ONLY 'LOCATION' -- Get the current location from the host env var
WITH CONTENT r'''
#!/bin/bash
curl -s "wttr.in/$LOCATION?format=%l:+%C+%t,+feels+like+%f,+%h+humidity"
''';
CALL LANGUAGE "bash"
WITH CONTENT r'''
find . -type f -name "*.jpg"
''';
CALL LANGUAGE "python"
WITH CONTENT r'''
import pyautogui
import time
from datetime import datetime
import os
# Take screenshot and save it
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
screenshot_path = f"screen_{timestamp}.png"
pyautogui.screenshot(screenshot_path)
# Print the path so the LLM can analyze the image
print(f"IMAGE_PATH={screenshot_path}")
''';
After the LLM takes a look at the screenshot, it finds the clock and sends a mouse click:
CALL LANGUAGE "python"
ENV r'''
X=1850 # Coordinates provided by LLM after image analysis
Y=12 # Coordinates provided by LLM after image analysis
'''
WITH CONTENT r'''
import pyautogui
import os
# Get coordinates from environment
x = int(os.environ['X'])
y = int(os.environ['Y'])
# Move and click
pyautogui.moveTo(x, y, duration=1.0)
pyautogui.click()
print(f"Clicked at ({x}, {y})")
''';
FAQs
CEDARScript grammar.js for tree-sitter
We found that cedarscript-grammar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.